AI-powered prompt generator backend for developers. Built with FastAPI for speed, clean architecture, and easy deployment.
- AI Prompt Generation: Generate frontend, backend, and database prompts based on tech stack selections
- Multiple AI Providers: Support for OpenAI, Anthropic (Claude), and Google Gemini
- Flexible Database: Support for SQLite (default), PostgreSQL, and MongoDB
- Rate Limiting: Built-in rate limiting (50 requests/day for free users)
- Clean Architecture: Modular, scalable, production-ready codebase
- Auto Documentation: Automatic API documentation with FastAPI
/backend
/src
/routes
/controllers
/services
/templates
/models
/db
/middlewares
/utils
/config
main.py
requirements.txt
env.example
-
Clone the repository
cd backend -
Create virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Configure environment
cp env.example .env # Edit .env with your API keys and configuration -
Initialize database
python -m alembic upgrade head
-
Run the server
uvicorn main:app --reload --host 0.0.0.0 --port 8000
See env.example for all configuration options. Key variables:
DATABASE_TYPE: sqlite, postgresql, or mongodbDATABASE_URL: Database connection stringOPENAI_API_KEY: OpenAI API keyANTHROPIC_API_KEY: Anthropic API keyGOOGLE_API_KEY: Google Gemini API keyDEFAULT_AI_PROVIDER: openai, anthropic, or geminiRATE_LIMIT_PER_DAY: Rate limit per user (default: 50)
Generate AI prompts based on tech stack selections.
Request Body:
{
"frontend": "React",
"backend": "FastAPI",
"database": "PostgreSQL",
"requirements": "Build a task management app with user authentication"
}Response:
{
"success": true,
"data": {
"frontendPrompt": "...",
"backendPrompt": "...",
"databasePrompt": "..."
},
"timestamp": "2024-01-15T10:30:00Z"
}Get available tech stack options.
Response:
{
"frontend": ["React", "Vue.js", "Angular", "Next.js", "Svelte"],
"backend": ["FastAPI", "Express.js", "NestJS", "Django", "Flask"],
"database": ["PostgreSQL", "MongoDB", "MySQL", "SQLite", "Redis"]
}Save generated prompt to database.
Get saved prompts for a user.
Once the server is running, visit:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
See DEPLOYMENT.md for detailed deployment instructions for:
- Render
- Railway
- Vercel Serverless
MIT