A comprehensive Enterprise Resource Planning (ERP) system designed for KMJ Optical, featuring customer management, order processing, billing, inventory tracking, and delivery management.
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ React SPA │────▶│ Express API │────▶│ MongoDB │
│ (Vite) │ │ (TypeScript)│ │ + Redis │
└──────────────┘ └──────────────┘ └──────────────┘
│ │
│ ┌─────┴─────┐
│ │ WhatsApp │
▼ │ Webhook │
Warehouse App └───────────┘
- React 18.2 - UI library
- TypeScript - Type-safe development
- Vite 4.5 - Fast build tool and dev server
- React Router 6 - Client-side routing
- Tailwind CSS 3 - Utility-first CSS framework
- PostCSS & Autoprefixer - CSS processing
- Node.js & Express - Server framework
- TypeScript - Type-safe backend code
- MongoDB - Database
- JWT - Authentication
- Nodemon - Development auto-reload
├── client/ # React frontend (TypeScript + Vite)
│ ├── src/
│ │ ├── pages/ # Page components
│ │ ├── api.ts # API integration
│ │ ├── App.tsx # Main app component
│ │ └── main.tsx # Entry point
│ ├── package.json
│ └── vite.config.ts
├── server/ # Node.js backend
│ ├── src/
│ │ ├── routes/ # API endpoints
│ │ ├── models/ # Database models
│ │ ├── middleware/ # Auth, audit middleware
│ │ ├── migrations/ # Database migrations
│ │ ├── app.ts # Express app setup
│ │ └── index.ts # Server entry point
│ ├── package.json
│ └── tsconfig.json
├── warehouse/ # Warehouse App
└── package.json # Root package.json
- Customer Management - Add, edit, and manage customer information
- Order Management - Create and track orders
- Billing System - Generate and manage bills
- Inventory Management - Track stock levels
- Delivery Tracking - Monitor order deliveries
- Payment Processing - Manage payment records
- User Authentication - Secure login and registration
- Audit Trail - Track system activities
- Multi-branch Support - Manage multiple store locations
- Reporting - Generate business reports and analytics
- Node.js 16+ and npm
- MongoDB instance running
- Clone and setup (installs all dependencies):
git clone <repo-url>
cd 123
npm install- Setup individual apps (if you prefer manual setup over
npm installat root):
Frontend:
cd client
npm installBackend:
cd server
npm installWarehouse App:
cd warehouse
npm installBackend (.env file in server/):
MONGO_URI=mongodb://localhost:27017/kmj-erp
JWT_SECRET=your-secret-key
PORT=4000
Frontend (.env file in client/):
VITE_API_URL=http://localhost:4000/api
Warehouse App (.env file in warehouse/):
VITE_API_URL=http://localhost:4000
Option 1: Run all services together
npm run devOption 2: Run services individually
Terminal 1 - Backend:
cd server
npm run devTerminal 2 - Frontend:
cd client
npm run devTerminal 3 - Warehouse App:
cd warehouse
npm run devThe application will be available at:
- Frontend: http://localhost:5173
- Backend API: http://localhost:4000
- Warehouse App: http://localhost:5174
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production build
npm run dev- Start development server with auto-reloadnpm run build- Build TypeScriptnpm start- Start production server
npm run dev- Start development server (port 5174)npm run build- Build for productionnpm run preview- Preview production build
API documentation is available at /api/docs (OpenAPI/Swagger)
See server/docs/openapi.yaml for the OpenAPI specification.
- All frontend code is TypeScript (.tsx)
- Use React Router for navigation
- Follow Tailwind CSS for styling
- Backend uses Express with TypeScript
- Database models are in
server/src/models/
- ✅ Frontend standardized on TypeScript (removed JSX/old templates)
- ✅ Unified Vite configuration
- ✅ Streamlined dependency versions
- ✅ Clean build pipeline
- ✅ Multi-branch support added
- ✅ Warehouse management module
See CONTRIBUTING.md for guidelines.
Private Project
For issues and questions, please open an issue on the repository.