Promptea is an intelligent AI-powered prompt engineering platform that elevates your simple prompts into comprehensive, production-ready instructions. Built with patterns from GitHub's awesome copilot prompts repository, Promptea applies industry best practices to transform basic ideas into structured, actionable prompts that get results.
Writing effective prompts for AI coding assistants is an art. Most developers start with basic requests like "create a REST API" or "add authentication" β but these lack the context, structure, and specificity needed for production-quality results.
Promptea automatically enhances your prompts with:
- π― Role Definition - Establishes expertise level and domain knowledge
- βοΈ Configuration Variables - Adds customizable parameters with sensible defaults
- π Clear Objectives - Defines specific, measurable outcomes
- π Structured Output - Specifies formats, file paths, and code patterns
- β Best Practices - Integrates industry standards and quality gates
- π§ Advanced Patterns - Applies chain-of-thought, few-shot, and template-driven approaches
Transform simple requests into detailed, production-ready instructions in seconds using GPT-4-powered analysis and enhancement.
Built-in NextAuth.js v5 authentication with secure session management, protecting your prompt history and API usage.
- Rate limiting on all critical endpoints (brute force protection)
- Input validation with Zod schemas
- CORS protection with environment-based whitelisting
- SQL injection prevention via Prisma ORM
- bcrypt password hashing with configurable rounds
Modern interface built with shadcn/ui and Tailwind CSS, featuring dark mode support and smooth animations.
Instant prompt enhancement with streaming responses and copy-to-clipboard functionality.
Built on proven patterns from GitHub's copilot prompts repository, ensuring your enhanced prompts follow best practices.
- Next.js 15 - React framework with App Router for optimal performance
- TypeScript 5 - Type-safe development with strict mode
- Tailwind CSS 4 - Utility-first styling with custom design system
- OpenRouter - Unified API gateway for GPT-4, Claude, and 200+ AI models
- shadcn/ui - High-quality, accessible React components
- Lucide Icons - Beautiful, consistent iconography
- Framer Motion - Smooth animations and transitions
- React Hook Form - Performant form validation with Zod
- Prisma - Type-safe ORM for database operations
- NextAuth.js v5 - Complete authentication solution
- Socket.IO - Real-time bidirectional communication
- SQLite - Lightweight database (PostgreSQL-ready for production)
- Custom rate limiting (100 API / 20 AI / 5 auth requests per window)
- Automatic memory cleanup and optimization
- Environment-based CORS protection
- Production-ready security headers
- Node.js 18+ and npm
- OpenRouter API key (Get one free)
# Clone the repository
git clone https://github.com/yourusername/promptea.git
cd promptea
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env
<<<<<<< HEAD
# Edit .env with your configuration (see comments in .env.example)
=======
# Edit .env and add your OPENROUTER_API_KEY
>>>>>>> 16412f8 (modified readme.md)
# Initialize database
npm run db:push
# Start development server
npm run devOpen http://localhost:3001 and start enhancing prompts! π
# Build for production
npm run build
# Start production server
npm start<<<<<<< HEAD Open http://localhost:3001 to see your application running.
16412f8 (modified readme.md)
See .env.example for comprehensive documentation. Key variables:
# Database
DATABASE_URL="file:./db/custom.db"
# Authentication (NextAuth.js v5)
NEXTAUTH_URL=http://localhost:3001
AUTH_SECRET="your-secret-here" # Generate: openssl rand -base64 32
# AI Provider (OpenRouter)
OPENROUTER_API_KEY="sk-or-v1-xxxxx"
# Security
ALLOWED_ORIGINS=http://localhost:3001,http://localhost:3000
BCRYPT_ROUNDS=10promptea/
βββ src/
β βββ app/ # Next.js App Router
β β βββ api/ # API routes
β β β βββ auth/ # Authentication endpoints
β β β βββ enhance-prompt/ # Prompt enhancement endpoint
β β βββ login/ # Login page
β β βββ page.tsx # Home page
β βββ components/
β β βββ ui/ # shadcn/ui components
β βββ lib/
β β βββ db.ts # Prisma client
β β βββ rate-limit.ts # Rate limiting utilities
β β βββ password.ts # Password hashing
β β βββ validations/ # Zod schemas
β βββ types/ # TypeScript definitions
βββ prisma/
β βββ schema.prisma # Database schema
βββ server.ts # Custom Next.js server with Socket.IO
βββ auth.ts # NextAuth.js configuration
Enhance a basic prompt into a production-ready instruction.
Rate Limit: 20 requests per hour per IP
Request:
{
"prompt": "create a REST API"
}Response:
{
"enhancedPrompt": "You are an expert backend developer specializing in RESTful API design..."
}Register a new user account.
Rate Limit: 5 attempts per 15 minutes per IP
Request:
{
"email": "user@example.com",
"password": "SecurePass123!",
"name": "John Doe"
}model User {
id String @id @default(cuid())
email String @unique
password String
name String?
image String?
emailVerified DateTime?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}This application includes production-ready security features:
- NextAuth.js v5 - Industry-standard authentication
- Secure password hashing - bcrypt with configurable rounds
- Protected API routes - Authentication middleware on sensitive endpoints
- Session management - Secure JWT-based sessions
Built-in rate limiting to prevent abuse and protect against attacks:
- API Endpoints: 100 requests per 15 minutes per IP
- AI Operations: 20 requests per hour per IP (strict limit for expensive operations)
- Authentication: 5 attempts per 15 minutes per IP (prevents brute force attacks)
Rate limits return standard headers:
X-RateLimit-Limit- Maximum requests allowedX-RateLimit-Remaining- Requests remaining in current windowX-RateLimit-Reset- Timestamp when the limit resetsRetry-After- Seconds to wait before retrying (429 responses)
Testing Rate Limits:
# Run the test suite
node test-rate-limit.js- Input validation - Zod schemas on all API endpoints
- CORS protection - Environment-based origin whitelist
- SQL injection prevention - Parameterized queries via Prisma
- Environment variables - Sensitive data in
.env(never committed)
Security Best Practices:
- Generate strong secrets:
openssl rand -base64 32 - Rotate API keys and secrets regularly
- Use HTTPS in production
- Keep dependencies updated
- Review and update CORS origins for production
Promptea is built with security as a top priority:
- NextAuth.js v5 with JWT strategy
- Secure password hashing with bcrypt (10 rounds)
- Protected API routes with middleware
- Session management with automatic expiration
- API Endpoints: 100 requests per 15 minutes
- AI Operations: 20 requests per hour (strict)
- Authentication: 5 attempts per 15 minutes (brute force protection)
- Standard rate limit headers (X-RateLimit-*)
- Automatic cleanup to prevent memory leaks
- Zod schemas on all API endpoints
- SQL injection prevention via Prisma ORM
- XSS protection with proper sanitization
- CORS with environment-based origin whitelisting
- Environment variables for all secrets
- No sensitive data in responses
- Secure HTTP headers
- HTTPS enforced in production
# Run rate limiting tests
node test-rate-limit.js
# Run authentication tests
node test-auth.js- Click the deploy button above
- Set environment variables in Vercel dashboard
- Deploy!
# Update these for production
NEXTAUTH_URL=https://yourdomain.com
ALLOWED_ORIGINS=https://yourdomain.com,https://www.yourdomain.com
DATABASE_URL=postgresql://user:password@host:5432/promptea
NODE_ENV=productionFor production with PostgreSQL:
# Update DATABASE_URL in .env
# Run migrations
npm run db:migrate
# Generate Prisma Client
npm run db:generateCopyright Β© 2025 Raoof A. All Rights Reserved.
This software and associated documentation files (the "Software") are proprietary and confidential. Unauthorized copying, modification, distribution, or use of this Software, via any medium, is strictly prohibited without explicit written permission from the copyright holder.
All rights reserved. No license is granted.
- π Issues: GitHub Issues
- π¬ Discussions: GitHub Discussions
- π Docs: Full Documentation