A full-stack MERN inventory management system with real-time analytics, barcode generation, and advanced export capabilities.
- Real-time bar charts showing stock trends
- Filter by time period (7/14/30/60/90 days)
- Filter by product category
- Key metrics: Total products, Low stock alerts, Stock IN/OUT
- Complete CRUD operations
- Bulk update/delete with selection
- Low stock alerts with configurable thresholds
- Product variants support
- Search and filter by category, supplier, status
- π₯ CSV import with validation and preview
- π Excel export with professional styling
- π PDF export with summary statistics
- π Stock movement reports (30-day history)
- Code128 barcode generation
- QR code generation with product details
- Bulk barcode generation
- Display and download capabilities
- Role-based access control (Admin/Staff)
- Admins can create other admins and staff
- Staff can only manage products and inventory
- Secure JWT authentication
- React 19.2.0
- Vite 7.3.1
- React Router 6.28.1
- Tailwind CSS 4.1.18
- Recharts 2.12.7 (charts)
- Axios 1.7.9 (API client)
- html5-qrcode 2.3.8 (QR scanning)
- Node.js v22.20.0
- Express 4.19.2
- MongoDB + Mongoose 8.6.3
- JWT Authentication
- ExcelJS 4.4.0 (Excel exports)
- PDFKit 0.15.0 (PDF exports)
- bwip-js 4.5.1 (Barcode generation)
- Multer 1.4.5 (File uploads)
- Node.js v22.20.0 or higher
- MongoDB (local or Atlas)
- npm or yarn
Create these env files before running the app:
PORT=5000
MONGO_URI=mongodb://localhost:27017/inventory_db
JWT_SECRET=your_jwt_secret_key_change_this_in_production
JWT_EXPIRES=30d
NODE_ENV=developmentVITE_API_URL=http://localhost:5000/apicd "Inventory Management-1"cd backend
npm installCreate backend/.env:
PORT=5000
MONGO_URI=mongodb://localhost:27017/inventory_db
JWT_SECRET=your_jwt_secret_key_change_this_in_production
JWT_EXPIRES=30d
NODE_ENV=developmentSeed admin user:
npm run seed:admin(Optional) Seed sample data:
npm run seed:sampleStart backend:
npm run devcd ../frontend
npm installCreate frontend/.env:
VITE_API_URL=http://localhost:5000/apiStart frontend:
npm run dev- Frontend: http://localhost:5174
- Backend API: http://localhost:5000/api
- Email: admin@test.com
- Password: admin123
.
βββ backend/
β βββ .env # Backend environment variables
β βββ src/
β β βββ config/ # Configuration files
β β βββ controllers/ # Request handlers
β β βββ middleware/ # Auth, error handling
β β βββ models/ # Mongoose schemas
β β βββ routes/ # API routes
β β βββ utils/ # Helper functions, seeders
β β βββ app.js # Express app setup
β β βββ server.js # Entry point
β βββ package.json
β
βββ frontend/
βββ .env # Frontend environment variables
βββ src/
β βββ api/ # API client functions
β βββ components/ # Reusable components
β βββ context/ # React context (auth)
β βββ hooks/ # Custom hooks
β βββ pages/ # Page components
β βββ utils/ # Utility functions
β βββ App.jsx # Main app component
β βββ main.jsx # Entry point
βββ package.json
- Full system access
- Can manage users (create/edit/delete)
- Can create other admins
- Can manage products and inventory
- Can view all analytics and reports
- Limited access
- Can view and edit products
- Can manage inventory (stock IN/OUT)
- Cannot manage users
- Can view analytics and reports
See backend/README.md for complete API documentation.
- Primary: #2563EB (Blue)
- Primary Strong: #1D4ED8 (Dark Blue)
- Background: #F8FAFC (Light Gray)
- Surface: White
- Text: #0F172A (Dark)
npm run dev # Start with nodemon
npm start # Production mode
npm run seed:admin # Seed admin user
npm run seed:sample # Seed sample datanpm run dev # Development server
npm run build # Production build