How littleapple0228/guava works
This is a FastAPI submission-review platform for authors and editors. Users register or log in to obtain a bearer token; authors create and submit drafts, and editors review submissions by approving or returning them to editing. The application serves a static frontend and initializes the database and default accounts at startup. The excerpts show route registration, authorization dependencies, and database operations; they do not show frontend API calls, so no frontend-to-API relationship is asserted.
Main entry points: main.py FastAPI application · database.py Database session and engine · auth.py Authentication and roles · users.py Account endpoints
Components 10
Application
- FastAPI application
main.py - Static frontend
static/index.html
Identity
- Account endpoints
routers/users.py - Authentication and roles
auth.py
Submission Workflow
- Author submissions
routers/author.py - Editor review
routers/editor.py
Domain and Persistence
- User and submission models
models.py - Database session and engine
database.py - PostgreSQL database
Other components
- Web user
Connections 18
- Web user → FastAPI application: uses
- FastAPI application → Static frontend: serves
main.py - FastAPI application → Account endpoints: registers routes
main.py - FastAPI application → Author submissions: registers routes
main.py - FastAPI application → Editor review: registers routes
main.py - Account endpoints → Authentication and roles: creates tokens
routers/users.py - Authentication and roles → Database session and engine: loads session
auth.py - Account endpoints → Database session and engine: queries and writes
routers/users.py - Author submissions → Authentication and roles: requires author
routers/author.py - Editor review → Authentication and roles: requires editor
routers/editor.py - Author submissions → Database session and engine: reads and writes
routers/author.py - Editor review → Database session and engine: reads and writes
routers/editor.py - Account endpoints → User and submission models: uses schemas
routers/users.py - Author submissions → User and submission models: uses submission models
routers/author.py - Editor review → User and submission models: uses submission models
routers/editor.py - Authentication and roles → User and submission models: loads user model
auth.py - FastAPI application → Database session and engine: initializes schema
main.py - Database session and engine → PostgreSQL database: connects to
database.py