How zain-ahma12/kitabghar works
KitabGhar is a FastAPI REST API for a book-lending service. Clients call book and member endpoints to browse and manage the catalogue, register members, and borrow or return books; route handlers use domain models and database sessions to validate and persist changes. The API also exposes liveness and a customized Swagger UI. The README documents SQLite, endpoint capabilities, and the request flow; source excerpts show route and domain interactions. Unsampled implementation details are not inferred.
Main entry points: main.py FastAPI App · book_routes.py Book Endpoints · users_routes.py User Endpoints · database.py Session and Tables
Components 12
API Surface
- FastAPI App
main.py - Book Endpoints
routes/book_routes.py - User Endpoints
routes/users_routes.py - Health Check
main.py
Lending Domain
- Book State and Lending
models/books.py - Member Records
models/users.py
Persistence and Access
- API Key Check
auth.py - Session and Tables
database.py - SQLite Store
API Docs
- Custom Swagger UI
custom_docs_ui/docs_ui.py
Other components
- API Client
- Uvicorn Server
Connections 18
- API Client → Uvicorn Server: sends requests
README.md - Uvicorn Server → FastAPI App: serves app
README.md - FastAPI App → Book Endpoints: registers router
main.py - FastAPI App → User Endpoints: registers router
main.py - API Client → Health Check: requests liveness
README.md - FastAPI App → Health Check: routes health
main.py - Book Endpoints → Book State and Lending: calls lending rules
routes/book_routes.py - User Endpoints → Member Records: converts member data
routes/users_routes.py - Book Endpoints → Session and Tables: requests sessions
routes/book_routes.py - User Endpoints → Session and Tables: requests sessions
routes/users_routes.py - Book Endpoints → API Key Check: checks protected routes
routes/book_routes.py - User Endpoints → API Key Check: checks protected routes
routes/users_routes.py - Book State and Lending → Member Records: links borrower
models/books.py - Member Records → Book State and Lending: relates borrowed books
models/users.py - FastAPI App → Session and Tables: creates tables
main.py - Session and Tables → SQLite Store: stores records
README.md - FastAPI App → Custom Swagger UI: configures docs
main.py - API Client → Custom Swagger UI: views API docs
README.md