- Typescript
- Node.js
- NestJS
- PostgreSQL
- Prisma
- Docker
- Swagger
-
Clone the Repository
git clone https://github.com/sid-sg/Bookstore.git cd Bookstore -
Create Environment File Create a
.envfile in the root directory and add the following variables:DATABASE_URL="your_database_connection_string" JWT_SECRET="your_jwt_secret"Replace
"your_database_connection_string"and"your_jwt_secret"with your actual database URL and a secure secret key. -
Run with Docker Compose Ensure Docker is installed and running on your system. Then, execute the following command in the project root:
docker-compose up --build
To access the API documentation and interactively test the endpoints, navigate to the following URL in your browser after starting the application:
http://localhost:3000/api
The following endpoints are available:
POST /auth/signup- User sign upPOST /auth/login- User loginGET /books/- Retrieve a list of all booksGET /books/{id}- Retrieve a specific book by its IDGET /books/search- Search for booksGET /books/sort- Sort booksGET /books/filter- Filter booksPOST /books/new- Add a new book (requires authentication).PATCH /books/{id}- Update an existing book by ID (requires authentication)DELETE /books/{id}- Delete a book by ID (requires authentication)
Please refer to the Swagger documentation available at http://localhost:3000/api for sample requests
-
Prisma migrations are already run before building
-
The app listens on port 3000
-
.env file has necessary environment variables and are loaded in the Docker container