PromptForge is a modern prompt management application built for AI development. It provides a robust platform for creating, testing, and managing prompts with advanced features for collaboration and version control.
- π Prompt version control
- π§ͺ Interactive prompt testing environment
- π Performance metrics and analytics
- π€ Team collaboration support
- π API key management
- π Dark/light mode theming
- π± Responsive design
- Create and edit prompts with rich text support
- Import prompts from JSON, CSV, or TXT files
- Variable detection and management
- Test prompts with different models and parameters
- Track metrics including response time, token usage, and success rate
- Team-based prompt sharing
- Role-based access control
- Version history tracking
- Collaborative editing features
- JWT-based authentication
- Secure API key rotation
- Password hashing with bcrypt
- Protected routes with middleware
- Secure database access
Before you begin, ensure you have the following installed:
- Node.js 18.x or higher (we recommend using nvm for Node.js version management)
- PostgreSQL 14.x or higher
- Bun package manager
- Git
-
Clone the Repository
git clone https://github.com/mgunnin/promptforge.git cd vl-promptforge
-
Install Dependencies
bun i
-
Set Up PostgreSQL Database
-
Create a new PostgreSQL database:
createdb promptforge
-
Or using psql:
psql CREATE DATABASE promptforge;
-
-
Configure Environment Variables
cp .env.example .env.local
Update
.env.local
with your configuration:# Database Configuration DATABASE_URL="postgresql://username:password@localhost:5432/promptforge" # Authentication NEXTAUTH_SECRET="your-generated-secret" # Generate using: openssl rand -base64 32 NEXTAUTH_URL="http://localhost:3000" # API Keys OPENAI_API_KEY="your-openai-api-key" ANTHROPIC_API_KEY="your-anthropic-api-key" # Optional GOOGLE_API_KEY="your-google-api-key" # Optional # Optional Configuration NODE_ENV="development"
-
Initialize Database Schema
bun prisma generate # Generate Prisma client bun prisma db push # Push schema to database
-
Run Development Server
bun dev
The application will be available at http://localhost:3000
-
Run Tests
bun test # Run unit tests bun test:e2e # Run end-to-end tests
src/
βββ app/ # Next.js 14 app directory
β βββ api/ # API routes
β βββ auth/ # Authentication pages
β βββ prompts/ # Prompt management pages
β βββ test/ # Prompt testing environment
βββ components/ # Reusable UI components
β βββ ui/ # Base UI components
β βββ [feature]/ # Feature-specific components
βββ contexts/ # React contexts
βββ hooks/ # Custom React hooks
βββ lib/ # Utility functions and services
β βββ services/ # Core service classes
β βββ utils/ # Helper functions
βββ prisma/ # Database schema and migrations
βββ types/ # TypeScript type definitions
βββ middleware.ts # Next.js middleware
- Handles interactions with LLM providers (OpenAI, Anthropic, etc.)
- Manages API key rotation and rate limiting
- Implements retry logic and error handling
- Manages user authentication and session handling
- Implements role-based access control
- Handles API key management and validation
- Core prompt CRUD operations
- Version control management
- Analytics and metrics tracking
- User management and preferences
- Team collaboration features
- Activity tracking
We welcome contributions! Here's how you can help:
-
Fork the repository
-
Create a feature branch:
git checkout -b feature/amazing-feature
-
Make your changes
-
Run tests and linting:
bun test bun lint
-
Commit your changes:
git commit -m 'Add some amazing feature'
-
Push to your fork:
git push origin feature/amazing-feature
-
Open a Pull Request
- Follow the existing code style and conventions
- Write meaningful commit messages
- Add tests for new features
- Update documentation as needed
- Keep pull requests focused and atomic
- Use TypeScript for all new code
- Follow the Airbnb JavaScript Style Guide
- Use Prettier for code formatting
- Write self-documenting code with clear variable/function names
- Write unit tests for utility functions and services
- Add integration tests for API endpoints
- Include UI tests for critical user flows
- Maintain test coverage above 80%
- Update README.md for significant changes
- Add JSDoc comments for new functions and types
- Include inline comments for complex logic
- Update API documentation when endpoints change
- Update the README.md with details of changes if needed
- Update the package.json version if needed
- Add a description of your changes in the PR
- Link any related issues
- Request review from maintainers
- Ensure CI checks pass
-
Database Connection Issues
# Check database status pg_isready -h localhost -p 5432 # Verify connection string psql "your-connection-string"
-
Prisma Issues
# Reset database bun prisma migrate reset # Regenerate client bun prisma generate
-
Build Errors
# Clear Next.js cache rm -rf .next # Reinstall dependencies rm -rf node_modules bun i
- Open an issue for bugs
- Join our Discord community for support
- Check existing issues and discussions
- Review documentation in the
/docs
directory
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Next.js
- UI components from shadcn/ui
- Database ORM by Prisma
- Authentication by NextAuth.js
- Styling with Tailwind CSS