A FastAPI backend application for managing library books, borrow records, and member queues.
- Book management (CRUD operations)
- Borrow and return workflow
- Member queue system for unavailable books
- Search, sort, and pagination
- Pydantic validation
pip install -r requirements.txtuvicorn main:app --reloadAPI documentation available at: http://127.0.0.1:8000/docs
| Method | Endpoint | Description |
|---|---|---|
| GET | / | Welcome message |
| GET | /books | List all books |
| GET | /books/{id} | Get book by ID |
| GET | /books/summary | Books summary with genre breakdown |
| GET | /books/filter | Filter books by genre, author, availability |
| GET | /books/search | Search books by keyword |
| GET | /books/sort | Sort books by title, author, or genre |
| GET | /books/page | Paginate books |
| GET | /books/browse | Combined search + sort + pagination |
| POST | /books | Add a new book |
| PUT | /books/{id} | Update book details |
| DELETE | /books/{id} | Delete a book |
| GET | /borrow-records | List all borrow records |
| GET | /borrow-records/search | Search borrow records by member |
| GET | /borrow-records/page | Paginate borrow records |
| POST | /borrow | Borrow a book |
| POST | /return/{book_id} | Return a book |
| GET | /queue | View the waiting queue |
| POST | /queue/add | Add member to queue |
fastapi-library-system/
├── main.py
├── requirements.txt
├── README.md
└── screenshots/