UM
umerzafar4598/hmc_inventory_mangement
A Full Stack Inventory Management System specifically for a mobile & accessories shop, with role-based access, sales tracking, analytics, and stock control.
H-M-C Inventory Management System
A full-stack Inventory Management & POS System built using the PERN Stack (PostgreSQL, Express, React, Node.js).
Designed specifically for a mobile & accessories shop, with role-based access, sales tracking, analytics, and stock control.
Features
- ✅ Complete CRUD operations for products and variants
- ✅ Search and filtering by categories and brands
- ✅ Role-based access control (Superadmin, Admin, Staff)
- ✅ Accurate profit calculations and analytics (Superadmin only)
- ✅ Complete inventory tracking and logs
- ✅ Email verification and password reset
- ✅ Session-based authentication with Passport.js
- ✅ Dark/Light theme toggle
- ✅ Responsive design with animations
- ✅ Black and Gold color scheme
🖥️ Screenshots
Tech Stack
Backend
- Node.js + Express.js
- PostgreSQL
- Passport.js (Session Authentication)
- ES Modules
- MVC Architecture
- Express Validator
- Nodemailer
Frontend
- ReactJS
- Vite
- Redux Toolkit
- TanStack Query
- Axios
- React Router DOM
- Tailwind CSS
- Animate.css + AOS
- React Hot Toast
- SweetAlert2
- Lucide React Icons
- Recharts
Setup Instructions
Prerequisites
- Node.js (v18 or higher)
- PostgreSQL (v12 or higher)
- npm or yarn
Database Setup
- Create a PostgreSQL database:
CREATE DATABASE hmc_inventory;- Run the schema:
psql -U postgres -d hmc_inventory -f database/schema.sqlBackend Setup
- Navigate to backend directory:
cd backend- Install dependencies:
npm install- Create
.envfile :
PORT=5000
NODE_ENV=development
DB_HOST=localhost
DB_PORT=5432
DB_NAME=hmc_inventory
DB_USER=postgres
DB_PASSWORD=your_password
SESSION_SECRET=your_secret_session_key
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USER=your_email@gmail.com
EMAIL_PASS=your_app_password
EMAIL_FROM=noreply@hmcinventory.com
FRONTEND_URL=http://localhost:5173- Start the server:
npm run devFrontend Setup
- Navigate to frontend directory:
cd frontend- Install dependencies:
npm install- Start the development server:
npm run devUser Roles
- Superadmin: Full access including analytics, user management, and all features
- Admin: Can manage products, sales, categories, brands, and view basic reports
- Staff: Can view products and create sales
API Endpoints
Authentication
POST /api/auth/register- Register new userPOST /api/auth/login- LoginPOST /api/auth/logout- LogoutGET /api/auth/me- Get current userGET /api/auth/verify-email- Verify emailPOST /api/auth/forgot-password- Request password resetPOST /api/auth/reset-password- Reset password
Products
GET /api/products- Get all products (with filters)GET /api/products/:id- Get product by IDPOST /api/products- Create product (Admin only)PUT /api/products/:id- Update product (Admin only)DELETE /api/products/:id- Delete product (Admin only)POST /api/products/:id/variants- Create variant (Admin only)PUT /api/products/variants/:id- Update variant (Admin only)DELETE /api/products/variants/:id- Delete variant (Admin only)POST /api/products/variants/:id/adjust-stock- Adjust stock (Admin only)
Sales
GET /api/sales- Get all salesGET /api/sales/:id- Get sale by IDPOST /api/sales- Create sale
Analytics (Superadmin only)
GET /api/analytics/daily- Daily statisticsGET /api/analytics/monthly- Monthly statisticsGET /api/analytics/inventory-value- Total inventory valueGET /api/analytics/revenue- Revenue by date rangeGET /api/analytics/top-selling- Top selling productsGET /api/analytics/low-stock- Low stock itemsGET /api/analytics/profit-by-month- Profit by month
License
ISC
Author
Umer Zafar
On this page
Languages
JavaScript95.6%PLpgSQL3.7%CSS0.4%HTML0.2%
Contributors
Created January 28, 2026
Updated January 28, 2026





