Book Shop API is a backend application built with TypeScript, Express.js, and MongoDB. It provides a RESTful API to manage books and customer orders. Features include CRUD operations for books, order processing, and revenue calculation.
- CRUD Operations for Books: Create, Read, Update, and Delete book records.
- Order Management: Place orders for books and manage inventory.
- Revenue Calculation: Calculate total revenue from orders using MongoDB aggregation.
- Input Validation: Ensures data integrity with Mongoose schema validation.
- Error Handling: Centralized error handling for better debugging.
- TypeScript: Strongly typed programming for scalability.
- Express.js: Web framework for Node.js.
- MongoDB: NoSQL database for storing data.
- Mongoose: Object Data Modeling (ODM) library for MongoDB.
- dotenv: Manage environment variables.
git clone https://github.com/Sakhawat71/book-shop-backend.git
cd book-shop-api
npm install
npm run start
live link : live link
- Create Book:
POST /api/products
- Get All Books:
GET /api/products
- Get Book by ID:
GET /api/products/:id
- Update Book:
PUT /api/products/:id
- Delete Book:
DELETE /api/products/:id
- Create Order:
POST /api/orders
- Get Total Revenue:
GET /api/orders/revenue