How gauti1409/fastapi_project works
This FastAPI social-media API supports user registration and login, JWT-authenticated ORM post operations, and voting, alongside a separate direct-SQL posts API. Its main request path runs from FastAPI router dispatch through route handlers to PostgreSQL, with schemas shaping inputs and outputs. The graph also retains user and authentication flows and the two distinct persistence styles. Evidence is limited to the README (empty) and supplied excerpts; unsampled user routes and several implementation details are represented only where the source index establishes their imports.
Main entry points: database.py Database access · main.py FastAPI app · oauth2.py JWT security · auth.py Login route
Components 16
API runtime
- FastAPI app
app/main.py - Settings
app/config.py
Identity and users
- Login route
app/routers/auth.py - JWT security
app/routers/oauth2.py - ORM user routes
app/routers/users_orm.py - Direct-SQL user routes
app/routers/users.py - Password hashing
app/main_files/utils.py
Posts and votes
- ORM post routes
app/routers/post_orm.py - Direct-SQL posts
app/routers/post.py - Voting routes
app/routers/vote.py - Calculations
app/calculations.py
Persistence and contracts
- Request/response schemas
app/main_files/schemas.py - ORM models
app/main_files/models.py - Database access
app/main_files/database.py - PostgreSQL
Other components
- API client
Connections 36
- API client → FastAPI app: sends requests
app/main.py - FastAPI app → Login route: routes to
app/main.py - FastAPI app → Direct-SQL posts: routes to
app/main.py - FastAPI app → Direct-SQL user routes: routes to
app/main.py - FastAPI app → ORM post routes: routes to
app/main.py - FastAPI app → ORM user routes: routes to
app/main.py - FastAPI app → Voting routes: routes to
app/main.py - FastAPI app → Database access: creates tables
app/main.py - FastAPI app → Settings: loads settings
app/main.py - Database access → Settings: reads credentials
app/main_files/database.py - Database access → PostgreSQL: connects to
app/main_files/database.py - ORM models → Database access: uses Base
app/main_files/models.py - Login route → Database access: gets session
app/routers/auth.py - Login route → ORM models: queries user
app/routers/auth.py - Login route → Password hashing: verifies password
app/routers/auth.py - Login route → JWT security: creates token
app/routers/auth.py - Login route → Request/response schemas: uses schemas
app/routers/auth.py - JWT security → Database access: gets session
app/routers/oauth2.py - JWT security → ORM models: loads user
app/routers/oauth2.py - JWT security → Request/response schemas: validates token data
app/routers/oauth2.py - JWT security → Settings: reads JWT settings
app/routers/oauth2.py - ORM user routes → Password hashing: hashes password
app/routers/users_orm.py - ORM user routes → ORM models: writes user
app/routers/users_orm.py - ORM user routes → Database access: uses session
app/routers/users_orm.py - ORM user routes → Request/response schemas: validates and returns
app/routers/users_orm.py - Direct-SQL user routes → Database access: uses database
app/routers/users.py - ORM post routes → JWT security: requires current user
app/routers/post_orm.py - ORM post routes → Database access: uses session
app/routers/post_orm.py - ORM post routes → ORM models: queries and writes
app/routers/post_orm.py - ORM post routes → Request/response schemas: uses schemas
app/routers/post_orm.py - Direct-SQL posts → Database access: executes SQL
app/routers/post.py - Direct-SQL posts → Request/response schemas: uses schemas
app/routers/post.py - Voting routes → JWT security: requires current user
app/routers/vote.py - Voting routes → Database access: uses session
app/routers/vote.py - Voting routes → ORM models: checks and writes votes
app/routers/vote.py - Voting routes → Request/response schemas: accepts vote schema
app/routers/vote.py