Skip to content

het2576/PromptCraft

Repository files navigation

🌐 PromptCraft

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.

React Hook Form Tailwind CSS TypeScript Google Gemini API Next.js License: MIT

πŸ“– Table of Contents


🎯 About

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.


✨ Features

  • πŸ€– 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/ui and Radix UI components.
  • βš™οΈ 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.

πŸ› οΈ Tech Stack

🎨 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

πŸ“‹ Prerequisites

⚠️ Make sure you have all of these installed before starting.

  1. Node.js 18+ β€” Download Β· Check: node --version
  2. npm β€” Comes with Node.js Β· Check: npm --version
  3. Google Gemini API Key β€” Get your API Key

βš™οΈ Installation

Step 1 β€” Clone the repository

git clone https://github.com/het2576/PromptCraft.git
cd PromptCraft

Step 2 β€” Install dependencies

npm install

Step 3 β€” Configure environment

cp .env.example .env.local

πŸ’‘ Open .env.local and fill in your values. See Environment Variables below.


πŸ” Environment Variables

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.local file. It's already in .gitignore.


πŸš€ Usage

Development Server

To start the development server:

npm run dev

Open http://localhost:3000 in your browser to access PromptCraft.

Quick Start Example

Once the development server is running, open your browser to http://localhost:3000.

  1. 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").
  2. Select Platform (Optional): If available, choose a target AI platform or model from the options provided.
  3. 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.


πŸ“ Project Structure

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.


🀝 Contributing

Contributions make this project better. Here's how to get involved:

πŸ› Reporting Bugs

Before creating a bug report:

  • βœ… Check the existing issues
  • βœ… Collect your environment details (OS, Node version, browser)
  • βœ… Reproduce the bug consistently

Create a bug report β†’

πŸ’‘ Suggesting Features

Feature suggestions are tracked as GitHub issues.

Suggest a feature β†’

πŸ”§ Pull Requests

  1. 🍴 Fork the repository
  2. 🌿 Create a feature branch: git checkout -b feat/amazing-feature
  3. πŸ’Ύ Commit your changes: git commit -m 'feat: add amazing feature'
  4. πŸ“€ Push to the branch: git push origin feat/amazing-feature
  5. πŸ” Open a Pull Request

Commit convention: We use Conventional Commits

  • feat: β€” new feature
  • fix: β€” bug fix
  • docs: β€” documentation only
  • refactor: β€” code change, no feature or fix
  • test: β€” add or update tests

πŸ“„ License

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

About

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors