Type something to search...

Book Catalog & Booking API

Summary

A book catalogue is easy. The lending rules are where this kind of system gets interesting, and where the small ones usually fall over.

This is a FastAPI backend for a library: a catalogue you can search, and a booking engine that enforces the rules rather than trusting the user to follow them.


How it works

Anyone can search by title or author. Once signed in, you can filter by genre, year, and availability, and hold up to three books for seven days.

Admins manage the catalogue and mark books returned by hand, which puts the stock back so the availability numbers stay honest without anyone recounting the shelf.

JWT handles auth, Pydantic handles validation, PostgreSQL stores the data.

Booking API docs in Swagger UI

Proof the book-limit and duration rule is enforced server-side


Tech

Python, FastAPI, PostgreSQL, SQLAlchemy, JWT, Pydantic, uv.

PostgreSQL over SQLite because lending rules need real transactions. uv because setting up the project should be one command, not a README page.


What I would change

There is no frontend, so you drive everything from the API docs and the tests. That kept the scope honest. It also means a librarian could not use it as it stands, which is worth being clear about.


Source

The code is public: https://github.com/rasyidev/booking-book