A professional AI prompt management platform built with Next.js 14 and Firebase. Organize, optimize, and manage your AI prompts with enterprise-grade features including version control, AI-powered optimization, and comprehensive user management.
- Features
- Tech Stack
- Quick Start
- Project Structure
- Configuration
- API Documentation
- 🚀 Deploy to Vercel ⭐
- Development
- Contributing
- Prompt Management: Full CRUD operations for AI prompts with rich text editing
- Version Control: Track changes with semantic versioning (major.minor.patch)
- Tag System: Organize prompts with custom tags and categories
- Search & Filter: Advanced search with tag filtering and sorting options
- AI Optimization: Enhance prompts using Zhipu AI for structure, clarity, and effectiveness
- Secure Authentication: Username/password authentication with bcrypt hashing
- User Profiles: Comprehensive user settings and profile management
- Data Export: Export all user data in JSON format
- Account Management: Complete account lifecycle management
- Modern UI: Clean, responsive design with Tailwind CSS and Radix UI
- Dashboard Analytics: Visual statistics and usage insights
- Real-time Updates: Instant feedback with optimistic updates
- Error Handling: Comprehensive error boundaries and user-friendly messages
- Loading States: Skeleton loading and progress indicators
- Enterprise Architecture: Scalable Next.js 14 App Router architecture
- Type Safety: Full TypeScript coverage with Zod validation
- Database: Firebase Firestore with optimized queries and indexing
- Form Handling: React Hook Form with real-time validation
- Security: JWT-based sessions with NextAuth.js
- Framework: Next.js 14 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS + Radix UI Components
- State Management: TanStack Query (React Query)
- Forms: React Hook Form + Zod validation
- Icons: Lucide React
- Notifications: Sonner Toast
- Runtime: Node.js with Next.js API Routes
- Database: Firebase Firestore
- Authentication: NextAuth.js
- AI Integration: Zhipu AI API
- Validation: Zod schemas
- Security: bcryptjs password hashing
- Package Manager: npm
- Linting: ESLint + Next.js Config
- Type Checking: TypeScript
- CSS Processing: PostCSS + Autoprefixer
- Build Tool: Next.js built-in bundler
- Node.js 18.x or later
- npm or yarn package manager
- Firebase project with Firestore enabled
- Zhipu AI API key (optional, for AI optimization)
- Clone the repository
git clone https://github.com/your-username/prompt-tools.git
cd prompt-tools- Install dependencies
npm install
- Environment Configuration
Create a
.env.localfile in the root directory:
# NextAuth Configuration NEXTAUTH_URL=http://localhost:3000 NEXTAUTH_SECRET=your-nextauth-secret-key # Firebase Configuration FIREBASE_PROJECT_ID=your-project-id FIREBASE_CLIENT_EMAIL=your-service-account-email FIREBASE_PRIVATE_KEY="your-private-key" # AI Optimization (Optional) ZHIPU_AI_KEY=your-zhipu-ai-api-key
- Firebase Setup
- Create a Firebase project at Firebase Console
- Enable Firestore Database
- Generate a service account key
- Deploy Firestore indexes:
firebase deploy --only firestore:indexes
- Run the development server
npm run dev
- Open your browser Navigate to http://localhost:3000
prompt-tools/
├── app/ # Next.js App Router
│ ├── api/ # API routes
│ │ ├── auth/ # Authentication endpoints
│ │ ├── prompts/ # Prompt CRUD operations
│ │ ├── user/ # User management
│ │ └── ai/ # AI optimization
│ ├── auth/ # Authentication pages
│ ├── dashboard/ # Main application pages
│ └── globals.css # Global styles
├── components/ # React components
│ ├── ui/ # Reusable UI components
│ ├── layout/ # Layout components
│ └── prompts/ # Prompt-specific components
├── lib/ # Utility libraries
│ ├── firebase.ts # Firebase configuration
│ ├── auth.ts # NextAuth configuration
│ └── utils.ts # Helper functions
├── hooks/ # Custom React hooks
└── firestore.indexes.json # Firestore index configuration
- Firestore Security Rules
rules_version = '2'; service cloud.firestore { match /databases/{database}/documents { match /users/{userId} { allow read, write: if request.auth != null && request.auth.uid == userId; } match /prompts/{promptId} { allow read, write: if request.auth != null && resource.data.userId == request.auth.uid; } match /versions/{versionId} { allow read, write: if request.auth != null; } } }
- Firestore Indexes
The project includes a
firestore.indexes.jsonfile with optimized composite indexes. Deploy with:
firebase deploy --only firestore:indexes
| Variable | Description | Required |
|---|---|---|
NEXTAUTH_URL |
Application URL | Yes |
NEXTAUTH_SECRET |
NextAuth encryption secret | Yes |
FIREBASE_PROJECT_ID |
Firebase project ID | Yes |
FIREBASE_CLIENT_EMAIL |
Service account email | Yes |
FIREBASE_PRIVATE_KEY |
Service account private key | Yes |
ZHIPU_AI_KEY |
Zhipu AI API key | No |
POST /api/auth/register- User registrationPOST /api/auth/[...nextauth]- NextAuth endpoints
GET /api/prompts- List user prompts with paginationPOST /api/prompts- Create new promptGET /api/prompts/[id]- Get prompt detailsPUT /api/prompts/[id]- Update promptDELETE /api/prompts/[id]- Delete prompt
POST /api/ai/optimize- Optimize prompt using AI
GET /api/user/stats- User statisticsPUT /api/user/profile- Update user profilePUT /api/user/password- Change passwordGET /api/user/export- Export user dataDELETE /api/user/delete- Delete user account
Click the button below to deploy directly to Vercel:
-
Fork or Clone Repository
git clone https://github.com/your-username/prompt-tools.git cd prompt-tools -
Connect to Vercel
- Go to Vercel Dashboard
- Click "New Project"
- Import your GitHub repository
- Select "prompt-tools" project
-
Configure Environment Variables In Vercel dashboard, go to Settings → Environment Variables and add:
NEXTAUTH_URL=https://your-app-name.vercel.app NEXTAUTH_SECRET=your-nextauth-secret-key FIREBASE_PROJECT_ID=your-firebase-project-id FIREBASE_CLIENT_EMAIL=your-service-account-email FIREBASE_PRIVATE_KEY="your-private-key-with-newlines" ZHIPU_AI_KEY=your-zhipu-ai-api-key
-
Deploy
- Click "Deploy" button
- Vercel will automatically build and deploy your application
- Your app will be available at
https://your-app-name.vercel.app
- Build Settings: Vercel automatically detects Next.js projects
- Node.js Version: Uses Node.js 18.x by default (compatible)
- Build Command:
npm run build(automatically detected) - Output Directory:
.next(automatically detected) - Install Command:
npm install(automatically detected)
For FIREBASE_PRIVATE_KEY, make sure to:
- Keep the quotes around the entire key
- Preserve the
\nnewline characters - Example format:
"-----BEGIN PRIVATE KEY-----\nMIIE...\n-----END PRIVATE KEY-----\n"
- Go to your project settings in Vercel
- Navigate to "Domains" section
- Add your custom domain
- Update
NEXTAUTH_URLto your custom domain - Configure DNS records as instructed by Vercel
The application can be deployed to any Node.js hosting platform:
- Netlify
- Railway
- DigitalOcean App Platform
- AWS Amplify
# Production build npm run build # Start production server npm run start # Type checking npm run typecheck # Linting npm run lint
- TypeScript: Full type safety with strict mode
- ESLint: Code linting with Next.js recommended rules
- Prettier: Code formatting (configure as needed)
- Husky: Git hooks for pre-commit validation (optional)
- Unit tests with Jest and React Testing Library
- E2E tests with Playwright
- API tests with Supertest
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
- Follow TypeScript best practices
- Write meaningful commit messages
- Add proper error handling
- Update documentation as needed
- Test your changes thoroughly
This project is licensed under the MIT License - see the LICENSE file for details.
- Next.js - The React framework for production
- Firebase - Backend-as-a-Service platform
- Radix UI - Low-level UI primitives
- Tailwind CSS - Utility-first CSS framework
- Zhipu AI - AI-powered prompt optimization
- Documentation: Check this README and code comments
- Issues: Report bugs via GitHub Issues
- Discussions: Join community discussions in GitHub Discussions
Built with ❤️ by the Prompt Tools Team