PromptCraft is an intelligent generator that crafts optimized, platform-specific prompts for diverse generative AI models, enhancing user interaction and improving AI-generated content quality by leveraging the Google Gemini API.
- π― About
- β¨ Features
- π οΈ Tech Stack
- π Prerequisites
- βοΈ Installation
- π Environment Variables
- π Usage
- π Project Structure
- π€ Contributing
- π License
Users often struggle to formulate precise and effective instructions for various generative AI tools, leading to suboptimal or irrelevant outputs. This common challenge wastes time and diminishes the perceived value of powerful AI models, as the quality of AI-generated content is directly tied to the clarity and specificity of the input prompt. Without a structured approach, crafting prompts becomes a trial-and-error process, frustrating users and hindering productivity.
PromptCraft solves this by acting as an intelligent generator that crafts optimized, platform-specific prompts for diverse generative AI models. By leveraging the Google Gemini API, it transforms vague user intentions into precise, actionable prompts. This enhances interaction with AI tools, significantly improving the quality and relevance of AI-generated content, and ultimately making generative AI more accessible and productive for everyone.
- π€ AI Prompt Generation β Dynamically generates optimized prompts using the Google Gemini API, ensuring high-quality AI outputs.
- π Categorized Prompt Templates β Offers structured templates for various use cases (e.g., Chat, Image Generation), streamlining prompt creation.
- π Dynamic Confidence Scoring β Provides real-time feedback on prompt effectiveness, helping users refine their inputs for better results.
- π¨ Intuitive UI with shadcn/ui β Delivers a clean, modern, and highly responsive user interface built with
shadcn/uiandRadix UIcomponents. - βοΈ Platform-specific Prompt Optimization β Tailors prompts for different generative AI models, ensuring compatibility and maximizing performance across platforms.
- πΎ Prompt History and Favorites β Allows users to review past prompts and save frequently used ones for quick access and reuse.
π¨ Frontend
| Technology | Purpose |
|---|---|
| Next.js | React framework for server-side rendering and static site generation |
| Next-Themes | Theme switching (light/dark mode) for Next.js applications |
| Radix UI | Unstyled, accessible components for building design systems |
| React Hook Form | Performant, flexible, and extensible forms with easy validation |
| Recharts | Composable charting library built with React and D3 |
| shadcn/ui | Reusable UI components built on Radix UI and Tailwind CSS |
| Sonner | An opinionated toast component for React |
| Tailwind CSS | Utility-first CSS framework for rapid UI development |
| TypeScript | Strongly typed superset of JavaScript for enhanced code quality |
| Zod | TypeScript-first schema declaration and validation library |
β οΈ Make sure you have all of these installed before starting.
- Node.js 18+ β Download Β· Check:
node --version - npm β Comes with Node.js Β· Check:
npm --version - Google Gemini API Key β Get your API Key
git clone https://github.com/het2576/PromptCraft.git
cd PromptCraftnpm installcp .env.example .env.localπ‘ Open
.env.localand fill in your values. See Environment Variables below.
Create a .env.local file in the project root:
# β
Required: Gemini API Key - Make sure this is a valid API key
NEXT_PUBLIC_GEMINI_API_KEY=your_gemini_api_key_here| Variable | Required | Description |
|---|---|---|
NEXT_PUBLIC_GEMINI_API_KEY |
β Yes | Your Google Gemini API Key. This key is crucial for interacting with the Gemini AI model. |
π Never commit your
.env.localfile. It's already in.gitignore.
To start the development server:
npm run devOpen http://localhost:3000 in your browser to access PromptCraft.
Once the development server is running, open your browser to http://localhost:3000.
- Input Task: On the main interface, enter a high-level task or desired outcome for your AI model into the input field (e.g., "Write a short story about a space explorer discovering a new planet").
- Select Platform (Optional): If available, choose a target AI platform or model from the options provided.
- Generate Prompt: Click the "Generate Prompt" button.
PromptCraft will then use your configured NEXT_PUBLIC_GEMINI_API_KEY to interact with the Google Gemini API, processing your input and generating an optimized, platform-specific prompt tailored for generative AI models. The generated prompt will appear on the screen, ready for you to copy and use.
PromptCraft/
βββ app/ # Next.js App Router root, containing pages, layouts, and API routes
β βββ api/ # (Optional) Next.js API routes for server-side logic
β βββ page.tsx # Main entry point for the application
βββ components/ # Reusable UI components (e.g., shadcn/ui, custom components)
β βββ ui/ # shadcn/ui components
β βββ ...
βββ lib/ # Utility functions, API clients (e.g., Gemini API client setup)
βββ public/ # Static assets like images, favicons
βββ types/ # TypeScript type definitions
βββ .env.example # Environment variables template
βββ package.json # Dependencies and scripts
βββ README.md # This file
The project follows a modular, feature-based structure typical for Next.js applications using the App Router. Core application logic and UI are organized within the app/ directory, while reusable components reside in components/ and utility functions in lib/, promoting maintainability and scalability.
Contributions make this project better. Here's how to get involved:
Before creating a bug report:
- β Check the existing issues
- β Collect your environment details (OS, Node version, browser)
- β Reproduce the bug consistently
Feature suggestions are tracked as GitHub issues.
- π΄ Fork the repository
- πΏ Create a feature branch:
git checkout -b feat/amazing-feature - πΎ Commit your changes:
git commit -m 'feat: add amazing feature' - π€ Push to the branch:
git push origin feat/amazing-feature - π Open a Pull Request
Commit convention: We use Conventional Commits
feat:β new featurefix:β bug fixdocs:β documentation onlyrefactor:β code change, no feature or fixtest:β add or update tests
This project is licensed under the MIT License.
You're free to use, modify, and distribute this project for any purpose. See the LICENSE file for full details.
Built with β€οΈ by het2576
If this project helped you, consider giving it a β
β Star this repo Β· π Report a Bug Β· π‘ Request a Feature