Skip to content

arpit2006/Prompt-Enhancer

Repository files navigation

πŸš€ PromptCraft

PromptCraft Logo

Analyze β€’ Improve β€’ Optimize your AI prompts

A powerful AI prompt engineering tool that analyzes and rewrites prompts for clarity, tone, and effectiveness.

Supports Gemini β€’ Groq β€’ OpenAI β€’ Ollama

License NextJS React TypeScript Supabase


🎬 Demo


✨ Features

🧠 Prompt Intelligence

  • Prompt Enhancement β€” Analyze and rewrite prompts with clarity + completeness scoring
  • Audience Tuning β€” Adjust tone: Technical, Simple, Executive, Creative, Child

πŸ€– Multi-Provider AI Support

  • Gemini
  • Groq
  • OpenAI
  • Ollama (local models)

πŸ” Prompt Analysis Tools

  • Diff Viewer β€” Word-level side-by-side comparison
  • Test Prompt β€” Run prompts directly against LLMs
  • Auto-Tagging β€” Prompts automatically tagged by type and tone

πŸ“š Prompt Management

  • Prompt History β€” Full version history with clarity score tracking
  • Folders β€” Organize prompts into color-coded collections
  • Template Library β€” Pre-built templates for writing, coding, data analysis, image generation, and more

πŸ“Š Insights & Analytics

  • Model usage breakdown
  • Prompt quality averages
  • 14-day activity chart

☁️ Cloud Features

  • Google & GitHub OAuth authentication
  • Privacy mode to skip saving history
  • Cross-device cloud sync via Supabase

🧱 Tech Stack

Layer Technology
Framework Next.js 15 (App Router)
UI React 19, Tailwind CSS 3.4, Radix UI
State Zustand 5 (localStorage + Supabase sync)
Database Supabase PostgreSQL via Prisma 5
Auth Auth.js v5 (Google + GitHub OAuth)
Language TypeScript (strict)
Icons lucide-react

πŸš€ Getting Started

1. Clone & Install

git clone https://github.com/your-username/prompt-enhancer.git
cd prompt-enhancer
npm install

2. Set Up Supabase

  1. Create a project at https://supabase.com

  2. Go to

Project Settings β†’ Database β†’ Connection Pooling
  1. Copy the Transaction Pooler URL (port 6543).

If your password contains special characters like @, encode them as %40.


3. Create the Database Table

Run this query in Supabase SQL Editor.

CREATE TABLE IF NOT EXISTS "UserData" (
  "id"        TEXT NOT NULL DEFAULT gen_random_uuid()::text,
  "userId"    TEXT NOT NULL,
  "entries"   JSONB NOT NULL DEFAULT '[]',
  "folders"   JSONB NOT NULL DEFAULT '[]',
  "analytics" JSONB NOT NULL DEFAULT '[]',
  "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
  "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
  CONSTRAINT "UserData_pkey" PRIMARY KEY ("id")
);

CREATE UNIQUE INDEX IF NOT EXISTS "UserData_userId_key"
ON "UserData"("userId");

4. Configure Environment Variables

Create .env.local

# Auth.js
AUTH_URL=http://localhost:3000
AUTH_SECRET=

# Google OAuth
AUTH_GOOGLE_ID=
AUTH_GOOGLE_SECRET=

# GitHub OAuth
AUTH_GITHUB_ID=
AUTH_GITHUB_SECRET=

# Supabase
DATABASE_URL=
DIRECT_URL=

Generate secret:

npx auth secret

5. Run the Development Server

npm run dev

Open

http://localhost:3000

πŸ”„ How Cloud Sync Works

State Behavior
Not logged in Data stored locally
Logged in Data synced from Supabase
Changes Auto-save after 1.5 seconds
New device Prompts load automatically

πŸ—‚ Project Structure

src
 β”œ app
 β”‚   β”œ api
 β”‚   β”‚   β”œ analyze
 β”‚   β”‚   β”œ analyze-groq
 β”‚   β”‚   β”œ analyze-openai
 β”‚   β”‚   β”œ analyze-local
 β”‚   β”‚   β”œ test-prompt
 β”‚   β”‚   β”” db/sync
 β”‚
 β”‚   β”œ login
 β”‚   β”” profile
 β”‚
 β”œ components
 β”‚   β”œ editor
 β”‚   β”œ analytics
 β”‚   β”œ api-request
 β”‚   β”œ history
 β”‚   β”œ templates
 β”‚   β”” layout
 β”‚
 β”œ store
 β”œ lib
 β”œ types
 β”” data

πŸ”Œ API Routes

Route Description
POST /api/analyze Enhance prompt via Gemini
POST /api/analyze-groq Enhance prompt via Groq
POST /api/analyze-openai Enhance prompt via OpenAI
POST /api/analyze-local Enhance prompt via Ollama
POST /api/test-prompt Run raw prompt against active LLM
GET /api/ollama-test Check Ollama connectivity
GET /api/db/sync Load user data from Supabase
POST /api/db/sync Save user data to Supabase

⚠️ Known Limitations (v1.0)

PromptCraft v1.0 is the first public release and is actively being improved.

Improvements in Progress

  • Performance optimization for prompt analysis
  • Improved diff viewer rendering
  • Better error handling for API providers
  • UI responsiveness fixes
  • Expanded analytics metrics

These will be addressed in upcoming releases.

πŸ’‘ Contributions, feedback, and suggestions are welcome.


πŸ›£ Roadmap

Future improvements planned:

  • Prompt benchmarking system
  • Prompt sharing marketplace
  • Team collaboration
  • Browser extension
  • VS Code extension

🀝 Contributing

Contributions are welcome.

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Submit a pull request

πŸ“œ License

MIT License


⭐ Support the Project

If you find PromptCraft useful:

⭐ Star the repository πŸ› Report issues πŸ’‘ Suggest new features

About

Prompt Craft is a multi-LLM prompt optimization tool that automatically analyzes and enhances user prompts to improve response quality. Built with Next.js 15, it supports Gemini, Groq, OpenAI, and Ollama, and includes prompt versioning, diff visualization, templates, analytics, and OAuth login.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages