There are 2 ways to start the api server
First --
- install node and pnpm and mongoDB on your machine
- cd to the directory
- run pnpm install
- copy contents from example.env to .env file with your variables
- in cli write pnpm run start:dev
Second --
- have docker installed on your machine
- cd into the project DIR
- run commands docker compose up -d
GET /library --> Gives the list of all the books in the library and if pages and count passed paginates the response
POST /library --> Creates book by taking necessarily 2 inputs title and author
PATCH /library/:bookID --> takes body and bookId and updates if a book exists with that ID
DELETE /library/:bookID --> takes body and bookId and deletes if a book exsists with that ID
GET /library/:bookID --> Gives the book with that ID if exists
- API for listing all the books and bottleneck hence provided a paginated API
- Title in a library(single) can be same hence made it unique
- Summaries can be optional hence not needed but set to default as NA
- Author is a needed field
- Dockerized the app to make it easy for setup
The deployment is done on render using the docker containers and it is using a mongoDB cluster from mongoDB atlas
DEPLOYMENT IS CI/CD Based hence no extra steps needed just push commmit and it will automatically deploy on render
As the github repository is connected with Render