Jan 2024/Backend/course

Bookshelf API

Most API bugs are not logic bugs. They are contract bugs. A client sends a request with a missing field, or the server returns an inconsistent error shape, and the integration silently breaks. I built this Bookshelf API to internalize exactly one discipline: every request must be validated before it touches a handler, and every response must follow the same contract regardless of the outcome.
Using Node.js and Hapi.js, I implemented a complete CRUD surface for a book catalog. Create, read, update, and delete operations are all backed by explicit route definitions, strict payload rules for required fields, and query filters for reading state and title search. The identifiers are generated with nanoid to keep the ID logic clean and dependency-free. The biggest takeaway is that Postman artifacts are underrated as a communication tool. By shipping the collection and environment alongside the code, anyone reviewing the API can run the entire test suite in one click. This project reinforced that a backend is not done when the code works. It is done when a stranger can understand and verify it without talking to you.