How meschac38700/fastapi_getstarted works
This is a FastAPI starter application whose core user-facing flow is HTTP requests through registered app routers, then authentication/authorization and domain handlers, with SQLModel persistence. Major capabilities include user and token authentication, groups and permissions, hero CRUD, and chat rooms/messages with WebSocket broadcasting. The README also describes extensible per-app structure. Edges reflect only README statements and shown source/index references; router registration and several subsystem details are unsampled, so uncertain wiring is left out.
Main entry points: oauth2.py Token and session auth · main.py FastAPI app · user.py User accounts · models Permission models
Components 23
Application runtime
- FastAPI app
src/main.py - App discovery
src/core/services/files/apps.py - Runtime settings
src/settings/app.py
Identity and access
- Token and session auth
src/apps/authentication/dependencies/oauth2.py - Authentication routes
src/apps/authentication/routers.py - JWT tokens
src/apps/authentication/models/token.py - User accounts
src/apps/user/models/user.py - User endpoints
src/apps/user/routers/users.py - Role checks
src/apps/user/dependencies/roles.py - Groups and permissions
src/apps/authorization/routers/groups.py - Permission models
src/apps/authorization/models
Product domains
- Hero endpoints
src/apps/hero/routers.py - Hero model
src/apps/hero/models/hero.py - Chat room endpoints
src/apps/chat/routers/room.py - Chat models
src/apps/chat/models/orm.py - WebSocket manager
src/apps/chat/services/manager.py - Chat WebSocket
src/apps/chat/web.py
Persistence and services
- DB session
src/core/db/dependencies/session.py - Query manager
src/core/db/query/manager.py - Relational database
- Broadcast broker
- Celery service
src/core/services/celery/main.py
Other components
- API client
Connections 28
- API client → FastAPI app: sends requests
src/main.py - FastAPI app → App discovery: discovers apps
src/main.py - FastAPI app → Runtime settings: configures runtime
src/main.py - FastAPI app → Celery service: attaches service
src/main.py - Token and session auth → JWT tokens: looks up token
src/apps/authentication/dependencies/oauth2.py - Token and session auth → User accounts: resolves user
src/apps/authentication/dependencies/oauth2.py - Authentication routes → Token and session auth: uses dependencies
src/apps/authentication/routers.py - Authentication routes → JWT tokens: uses token model
src/apps/authentication/routers.py - User endpoints → Token and session auth: uses authentication
src/apps/user/routers/users.py - User endpoints → Permission models: uses permissions
src/apps/user/routers/users.py - User endpoints → User accounts: reads and writes
src/apps/user/routers/users.py - User accounts → Permission models: relates access data
src/apps/user/models/user.py - Groups and permissions → Permission models: uses models
src/apps/authorization/routers/groups.py - Groups and permissions → Role checks: uses role checks
src/apps/authorization/routers/groups.py - Hero endpoints → Permission models: checks permissions
src/apps/hero/routers.py - Hero endpoints → Hero model: reads and writes
src/apps/hero/routers.py - Chat room endpoints → Token and session auth: authenticates requests
src/apps/chat/routers/room.py - Chat room endpoints → Chat models: uses room models
src/apps/chat/routers/room.py - Chat room endpoints → Role checks: checks roles
src/apps/chat/routers/room.py - Chat WebSocket → WebSocket manager: starts WebSocket handling
src/apps/chat/web.py - WebSocket manager → Chat models: persists messages
src/apps/chat/services/manager.py - WebSocket manager → Broadcast broker: publishes and subscribes
src/apps/chat/services/manager.py - Chat models → User accounts: relates chat users
src/apps/chat/models/orm.py - DB session → Runtime settings: reads configuration
src/core/db/dependencies/session.py - Query manager → DB session: uses session dependency
src/core/db/query/manager.py - DB session → Relational database: opens database access
- Celery service → Runtime settings: reads broker settings
src/core/services/celery/main.py - Celery service → App discovery: discovers task apps
src/core/services/celery/main.py