Welcome to the Inventory Sales Manager project! ๐ This is a backend system designed to manage inventory and sales for a small shop. It features a comprehensive API for handling items, sales transactions, and inventory updates.
To get started with this project, follow these steps:
git clone https://github.com/olanikegloria/inventory-sales-manager.git
cd inventory-sales-manager
Install the required npm packages:
npm install
Make sure you have MongoDB installed and running on your machine. Create a database named inventory-sales
to match the connection string in the src/config/database.ts
file.
Compile TypeScript files:
npx tsc
Start the server:
node dist/server.js
Or, for development with live reload:
npx ts-node src/server.ts
-
Add New Item
POST /api/items
- Body:
{ "name": "Item Name", "price": 10.99, "quantity": 100 }
-
Get All Items
GET /api/items
-
Create Bill
POST /api/bills
- Body:
{ "items": [ { "itemId": "ITEM_ID_1", "quantity": 2 }, { "itemId": "ITEM_ID_2", "quantity": 1 } ] }
-
Get All Bills
GET /api/bills
-
Get Bill Details
GET /api/bills/:id
- Add and Manage Inventory Items ๐ฆ
- Create and Manage Sales Bills ๐งพ
- Automatic Inventory Updates on Sales ๐
- Comprehensive Error Handling ๐ซ
My favorite part of the project is adding input validation with Joi. It ensures that all incoming data is correctly validated, making the application more reliable and robust. Joi's schema validation helped maintain data integrity and improved overall data quality. ๐
Check out the video demo of me testing the api routes in postman Watch Demo ๐ฅ
For detailed documentation, refer to the code comments and the README
file provided here.
Feel free to contribute to the project by opening issues or submitting pull requests.
Thank you for checking out the Inventory Sales Manager! If you have any questions or feedback, please reach out. Happy coding! ๐ป๐