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.
- ✅ 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
- Node.js + Express.js
- PostgreSQL
- Passport.js (Session Authentication)
- ES Modules
- MVC Architecture
- Express Validator
- Nodemailer
- ReactJS
- Vite
- Redux Toolkit
- TanStack Query
- Axios
- React Router DOM
- Tailwind CSS
- Animate.css + AOS
- React Hot Toast
- SweetAlert2
- Lucide React Icons
- Recharts
- Node.js (v18 or higher)
- PostgreSQL (v12 or higher)
- npm or yarn
- Create a PostgreSQL database:
CREATE DATABASE hmc_inventory;- Run the schema:
psql -U postgres -d hmc_inventory -f database/schema.sql- 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 dev- Navigate to frontend directory:
cd frontend- Install dependencies:
npm install- Start the development server:
npm run dev- 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
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
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)
GET /api/sales- Get all salesGET /api/sales/:id- Get sale by IDPOST /api/sales- Create sale
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
ISC
Umer Zafar





