How aswind-s-varman/booking-api works
booking-api provides authenticated resource scheduling through both a JSON API and a server-rendered interface. Users register or log in, discover resources and slots, then create, list, or cancel bookings; administrators manage resources. Booking conflicts are resolved atomically by a partial unique database index, while cancellation preserves booking history. The graph separates API routes, browser UI, identity, and persistence. Relationships are limited to the supplied excerpts and README; unsampled migration and template details are not inferred.
Main entry points: database.py Session and engine · bookings.py Booking routes · web.py UI routes · main.py FastAPI app
Components 16
Application entry
- FastAPI app
src/booking_api/main.py
JSON API
- Authentication routes
src/booking_api/routers/auth.py - Resource routes
src/booking_api/routers/resources.py - Booking routes
src/booking_api/routers/bookings.py - Request and response schemas
src/booking_api/schemas.py
Browser interface
- UI routes
src/booking_api/web.py - Slot generation
src/booking_api/availability.py - Jinja templates
src/booking_api/templates
Identity and access
- Password and tokens
src/booking_api/security.py - User and admin access
src/booking_api/dependencies.py
Persistence
- User resource bookings
src/booking_api/models.py - Session and engine
src/booking_api/database.py - Runtime settings
src/booking_api/config.py - SQL database
Other components
- API client
- Browser user
Connections 31
- API client → FastAPI app: sends requests
src/booking_api/main.py - Browser user → FastAPI app: opens UI
src/booking_api/main.py - FastAPI app → Authentication routes: registers
src/booking_api/main.py - FastAPI app → Resource routes: registers
src/booking_api/main.py - FastAPI app → Booking routes: registers
src/booking_api/main.py - FastAPI app → UI routes: registers
src/booking_api/main.py - Authentication routes → Request and response schemas: validates and returns
src/booking_api/routers/auth.py - Resource routes → Request and response schemas: validates and returns
src/booking_api/routers/resources.py - Booking routes → Request and response schemas: validates and returns
src/booking_api/routers/bookings.py - Authentication routes → Password and tokens: hashes and issues tokens
src/booking_api/routers/auth.py - Authentication routes → Session and engine: gets session
src/booking_api/routers/auth.py - Authentication routes → User resource bookings: queries users
src/booking_api/routers/auth.py - Resource routes → User and admin access: requires admin or user
src/booking_api/routers/resources.py - Resource routes → Session and engine: gets session
src/booking_api/routers/resources.py - Resource routes → User resource bookings: reads and changes resources
src/booking_api/routers/resources.py - Booking routes → User and admin access: requires user
src/booking_api/routers/bookings.py - Booking routes → Session and engine: gets session
src/booking_api/routers/bookings.py - Booking routes → User resource bookings: reads and changes bookings
src/booking_api/routers/bookings.py - UI routes → Slot generation: generates slots
src/booking_api/web.py - UI routes → Jinja templates: renders pages
src/booking_api/web.py - UI routes → Password and tokens: checks cookie tokens
src/booking_api/web.py - UI routes → Session and engine: gets session
src/booking_api/web.py - UI routes → User resource bookings: reads and changes records
src/booking_api/web.py - User and admin access → Password and tokens: decodes tokens
src/booking_api/dependencies.py - User and admin access → Session and engine: gets session
src/booking_api/dependencies.py - User and admin access → User resource bookings: loads user
src/booking_api/dependencies.py - Session and engine → Runtime settings: reads settings
src/booking_api/database.py - User resource bookings → Session and engine: uses declarative base
src/booking_api/models.py - Session and engine → SQL database: queries and commits
- Password and tokens → Runtime settings: reads token settings
src/booking_api/security.py - Booking routes → SQL database: relies on unique slot constraint
README.md