How tugrulsimsirli/hotel_reservation works
This is a FastAPI hotel-reservation API whose implemented workflow is user signup and login: requests enter through registered routes, authentication services validate or create users, and responses carry user data or tokens. The sampled hotel route only exposes a hello endpoint; the README provides no further feature detail, so no reservation workflow is inferred. The graph includes configuration, persistence, security, response handling, and the global error middleware. Relationships are limited to those shown in the sampled source and SOURCE INDEX.
Main entry points: auth_routes.py Auth routes · main.py FastAPI app · auth_service.py Auth service · base.py DB sessions
Components 14
API entry
- FastAPI app
app/main.py - Auth routes
app/api/routes/v1/auth_routes.py - Hotel route
app/api/routes/v1/hotel_routes.py - Error middleware
app/middlewares/error_handler.py
Identity and responses
- Auth service
app/services/auth_service.py - User schemas
app/schemas/user.py - User response model
app/models/user_model.py - Response models
app/models/generic.py - Password and tokens
app/utils/security.py
Persistence and configuration
- DB sessions
app/db/base.py - User table
app/db/user.py - PostgreSQL
- Settings
app/core/config.py
Other components
- API client
Connections 20
- API client → FastAPI app: sends requests
app/main.py - FastAPI app → Auth routes: registers routes
app/main.py - FastAPI app → Hotel route: registers routes
app/main.py - FastAPI app → Error middleware: installs middleware
app/main.py - FastAPI app → DB sessions: creates tables
app/main.py - Auth routes → Auth service: calls auth
app/api/routes/v1/auth_routes.py - Auth routes → Password and tokens: creates tokens
app/api/routes/v1/auth_routes.py - Auth routes → Password and tokens: decodes refresh
app/api/routes/v1/auth_routes.py - Auth routes → DB sessions: gets session
app/api/routes/v1/auth_routes.py - Auth routes → User schemas: accepts signup data
app/api/routes/v1/auth_routes.py - Auth routes → Response models: returns envelope
app/api/routes/v1/auth_routes.py - Auth service → User table: queries and writes
app/services/auth_service.py - Auth service → Password and tokens: verifies and hashes
app/services/auth_service.py - Auth service → Response models: builds responses
app/services/auth_service.py - Auth service → User response model: validates user
app/services/auth_service.py - User table → DB sessions: extends base
app/db/user.py - DB sessions → Settings: loads database URL
app/db/base.py - DB sessions → PostgreSQL: connects
app/db/base.py - Password and tokens → Settings: loads auth settings
app/utils/security.py - Error middleware → Response models: formats errors
app/middlewares/error_handler.py