Advanced bookstore api with multiple features
- Biome: A powerful and flexible linter and formatter for TypeScript.
- OpenAPI: A standard for building APIs with a focus on design and documentation.
- Socket.io: A library for building real-time applications with WebSockets.
The following features are available in the API based on the user role:
Admin:
- CRUD operations on books
- CRUD operations on users
User:
- View books
- Advanced search for books
- Review books
- Rate books
- Add interests
- Report reviews
- View reviews
- Update their profile
- Delete their profile
The following diagram shows the relationship between the entities in the database:

- Node.js
- Docker Engine (For developement)
- Yarn
-
Install all the project dependency using Yarn:
$ yarn
-
Run the application from command prompt:
$ yarn dev
- If you want to monitor the API, you can query(PromQL) the logged data by heading over to prometheus dashboard to check the performance of the API as well as database queries and modifications. Examples are given below:
rate(fetch_database_duration_seconds_sum[2m]) / rate(fetch_database_duration_seconds_count[2m])
histogram_quantile(0.99, rate(fetch_database_duration_seconds_bucket[2m]))
fetch_requests_total
The files to check the index names can be found within the metrics explorer or can be found here
- There is a deployed version of the documentation (recommended) which can be located here. There is a swagger documentation located at here as well when running the code. But the best documentation you will get is by importing the postman collection which I will link here
© MIT License