๐Ÿ“ฆ Inventory Sales Manager ๐ŸŽŸ๏ธ๐Ÿ›’

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.

๐Ÿš€ Getting Started

To get started with this project, follow these steps:

1. Clone the Repository

git clone https://github.com/olanikegloria/inventory-sales-manager.git
cd inventory-sales-manager

2. Install Dependencies

Install the required npm packages:

npm install

3. Set Up the Database

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.

4. Run the Application

Compile TypeScript files:

npx tsc

Start the server:

node dist/server.js

Or, for development with live reload:

npx ts-node src/server.ts

๐Ÿ› ๏ธ API Endpoints

๐Ÿงฉ Items

  • Add New Item

    • POST /api/items
    • Body: { "name": "Item Name", "price": 10.99, "quantity": 100 }
  • Get All Items

    • GET /api/items

๐Ÿงพ Bills

  • 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

โœจ Features

  • Add and Manage Inventory Items ๐Ÿ“ฆ
  • Create and Manage Sales Bills ๐Ÿงพ
  • Automatic Inventory Updates on Sales ๐Ÿ”„
  • Comprehensive Error Handling ๐Ÿšซ

๐ŸŽฏ Favorite Feature

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. ๐ŸŒŸ

๐Ÿ“น Video Demo

Check out the video demo of me testing the api routes in postman Watch Demo ๐ŸŽฅ

๐Ÿ“ Documentation

For detailed documentation, refer to the code comments and the README file provided here.

๐Ÿ’ฌ Contributing

Feel free to contribute to the project by opening issues or submitting pull requests.

๐Ÿ–ค Thanks for Visiting!

Thank you for checking out the Inventory Sales Manager! If you have any questions or feedback, please reach out. Happy coding! ๐Ÿ’ป๐Ÿš€