How danamushiva-cloud/prompt-generator-backend works
This is a FastAPI backend for generating optimized prompts from a user's idea and category, with JWT authentication and per-user history and favorites. The main workflow is signup or login, then an authenticated request to generate a prompt; the API calls a Modal-hosted inference service, saves the result, and returns it. Users can later retrieve history and toggle or list favorites. The README also documents six prompt categories and the fine-tuned Qwen model. Edges reflect the sampled route and helper code or explicit README statements; the inference implementation itself is external and not present in this repository.
Main entry points: main.py FastAPI routes · database.py Session and engine · auth.py JWT authentication · models.py User and history models
Components 8
API workflows
- FastAPI routes
main.py - Request schemas
schemas.py
Identity
- JWT authentication
auth.py
Persistence
- User and history models
models.py - Session and engine
database.py - SQLite database
Prompt inference
- Modal inference endpoint
Other components
- Client user
Connections 10
- Client user → FastAPI routes: calls endpoints
README.md - FastAPI routes → Request schemas: validates and shapes
main.py - FastAPI routes → JWT authentication: authenticates requests
main.py - FastAPI routes → User and history models: queries and saves
main.py - FastAPI routes → Session and engine: obtains sessions
main.py - JWT authentication → Session and engine: obtains sessions
auth.py - JWT authentication → User and history models: looks up users
auth.py - User and history models → Session and engine: uses ORM base
models.py - Session and engine → SQLite database: connects to
database.py - FastAPI routes → Modal inference endpoint: sends idea and category
main.py