{"id":31952353,"url":"https://github.com/tarushbatra/inventory-api","last_synced_at":"2026-04-05T23:02:18.258Z","repository":{"id":317710727,"uuid":"1068513017","full_name":"TarushBatra/inventory-api","owner":"TarushBatra","description":"Inventory Management System API built with Node.js, Express, and MongoDB. Includes CRUD operations, stock management, and Jest tests.","archived":false,"fork":false,"pushed_at":"2025-10-02T14:28:37.000Z","size":70,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-23T16:35:35.611Z","etag":null,"topics":["express","jest","mongodb","nodejs","rest-api"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TarushBatra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-02T13:52:41.000Z","updated_at":"2025-10-02T14:28:41.000Z","dependencies_parsed_at":"2025-10-02T16:22:14.163Z","dependency_job_id":"8ebfab1b-b8cc-4adb-b554-98b1f143ef4c","html_url":"https://github.com/TarushBatra/inventory-api","commit_stats":null,"previous_names":["tarushbatra/inventory-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TarushBatra/inventory-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TarushBatra%2Finventory-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TarushBatra%2Finventory-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TarushBatra%2Finventory-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TarushBatra%2Finventory-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TarushBatra","download_url":"https://codeload.github.com/TarushBatra/inventory-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TarushBatra%2Finventory-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31452901,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"ssl_error","status_checked_at":"2026-04-05T21:22:51.943Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["express","jest","mongodb","nodejs","rest-api"],"created_at":"2025-10-14T13:13:40.615Z","updated_at":"2026-04-05T23:02:18.240Z","avatar_url":"https://github.com/TarushBatra.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📦 Inventory Management API\n\n[![Node.js](https://img.shields.io/badge/Node.js-18.x-green.svg)](https://nodejs.org/)\n[![Express](https://img.shields.io/badge/Express-4.x-lightgrey.svg)](https://expressjs.com/)\n[![MongoDB](https://img.shields.io/badge/MongoDB-6.x-brightgreen.svg)](https://www.mongodb.com/)\n[![Jest](https://img.shields.io/badge/Tests-Passing-brightgreen.svg)](https://jestjs.io/)\n\nA simple **Inventory Management System API** built with **Node.js, Express, and MongoDB**.  \nIt allows you to manage products, update stock, enforce business rules (no negative stock), and check for low stock thresholds.  \n\n---\n\n## 🚀 Features\n- Product CRUD (Create, Read, Update, Delete)\n- Stock management (increase / decrease stock with validation)\n- Low stock check\n- Prevent stock from going below zero\n- Jest + Supertest for testing\n- Postman Collection included for quick testing\n\n---\n\n## 📂 Project Structure\ninventory-api/\n├── src/\n│ ├── config/ # Database connection\n│ ├── controllers/ # Request handlers\n│ ├── models/ # Mongoose models\n│ ├── routes/ # API routes\n│ ├── services/ # Business logic\n│ ├── utils/ # Error handling\n│ ├── app.js # Express app\n│ └── server.js # Server entrypoint\n├── tests/ # Jest + Supertest test cases\n├── .gitignore\n├── package.json\n├── README.md\n└── Inventory API.postman_collection.json\n\n---\n\n## ⚙️ Setup \u0026 Installation\n\n### 1. Clone the repo\n``bash\ngit clone https://github.com/TarushBatra/inventory-api.git\ncd inventory-api\n2. Install dependencies\nnpm install\n3. Setup environment variables\n\nCreate a .env file in root:\nPORT=5000\nMONGO_URI=mongodb://localhost:27017/inventoryDB\n4. Start development server\nnpm run dev\nServer runs at 👉 http://localhost:5000\n\n📡 API Endpoints\nProducts\nMethod\tEndpoint\tDescription\nGET\t/api/products\tGet all products\nGET\t/api/products/:id\tGet product by ID\nPOST\t/api/products\tCreate a new product\nPUT\t/api/products/:id\tUpdate product details\nDELETE\t/api/products/:id\tDelete product\nPATCH\t/api/products/:id/increase\tIncrease stock\nPATCH\t/api/products/:id/decrease\tDecrease stock\nGET\t/api/products/low-stock\tGet low stock products\n🧪 Running Tests\n\nRun Jest + Supertest tests:\nnpm test\n\n✅ Tests include:\n\nCreate product\n\nIncrease stock\n\nDecrease stock\n\nPrevent negative stock\n\nLow stock check\n\n📬 Postman Collection\n\nFile: Inventory API.postman_collection.json\n\nTo use:\n\nOpen Postman\n\nGo to Collections → Import\n\nSelect this file\n\nRun sample requests for all endpoints\n\n👨‍💻 Tech Stack\n\nNode.js\n\nExpress.js\n\nMongoDB + Mongoose\n\nJest + Supertest\n\n📌 License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarushbatra%2Finventory-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftarushbatra%2Finventory-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarushbatra%2Finventory-api/lists"}