Welcome to Garment Management System, a comprehensive full-stack web application designed for managing garment production orders, deliveries, employee management, and inventory. This project showcases a complete business management system built with React (Frontend), Node.js + Express (Backend), and MongoDB (Database), featuring secure admin authentication, real-time updates, and professional email notifications.
- Order Management: Customers submit garment orders with custom specifications, materials, quantities, and artwork uploads. Admins can view, update, and manage all orders with pricing calculations and invoice generation.
- Delivery Tracking: Track deliveries with driver assignment, scheduled dates, and status updates (Pending, In Progress, Delivered, Cancelled). Send automated tracking emails to customers.
- Employee Management: Register and manage employees with roles and contact information. Assign drivers to deliveries.
- Salary Management: Record employee salary payments, track payment dates and amounts, mark payments as paid/unpaid, and calculate total expenses.
- Inventory Management: Add and track inventory items with stock levels, threshold alerts, pricing, and total value calculations.
- Financial Dashboard: Real-time statistics with monthly income, salary expenses, profit/loss analysis, and pending deliveries count using Server-Sent Events (SSE).
- Secure Authentication: JWT-based admin login with protected routes and role-based access control.
- Email Notifications: Order confirmations and delivery tracking emails with professional HTML templates via Gmail/Nodemailer.
- Invoice & Report Generation: Download invoices as PDFs and export order data as CSV reports.
- Responsive Design: Mobile and desktop optimized interface with Tailwind CSS.
- Node.js: Version 14.x or later (download from nodejs.org)
- npm: Included with Node.js
- MongoDB: Local instance or MongoDB Atlas cloud cluster
- Gmail Account: For email notifications (with 2FA and App Password enabled)
- Web Browser: A modern browser like Chrome, Firefox, or Edge
-
Clone the Repository:
git clone https://github.com/ridmii/gms.git cd gms -
Backend Setup:
cd backend npm install -
Frontend Setup:
cd frontend npm install -
Configure Environment Variables: Create a
.envfile in thebackend/directory:# Server Configuration PORT=5000 # Database Configuration MONGO_URI=mongodb://localhost:27017/gms # JWT Configuration JWT_SECRET=your_jwt_secret_key_here # Email Configuration (Gmail with App Password) EMAIL_USER=your_gmail@gmail.com EMAIL_PASS=your_app_password_here # Admin Credentials (default bcrypt hashed password) ADMIN_EMAIL=admin@dimalsha.com ADMIN_PASSWORD=$2b$10$z4ADspMJ1eBzmRF34Wc38.TXLwYTpd9w67LfrSZaGOHNMGy0zCMsW
Gmail Setup for Email Notifications:
- Go to https://myaccount.google.com/security
- Enable 2-factor authentication
- Generate an App Password at https://myaccount.google.com/apppasswords
- Copy the 16-character app password and paste it in
.envasEMAIL_PASS - Use your Gmail address (with or without @gmail.com) as
EMAIL_USER
-
Ensure MongoDB is Running:
- Local MongoDB: Run
mongodin your terminal - MongoDB Atlas: Ensure your cluster is active and update
MONGO_URIwith your connection string
- Local MongoDB: Run
Start Backend (from backend/ directory):
npm startBackend API runs on http://localhost:5000
Start Frontend (from frontend/ directory, in a new terminal):
npm run devFrontend application runs on http://localhost:5173
Open http://localhost:5173 in your browser to view the application. Start by logging in with the admin credentials or creating a new customer order.
Frontend Build:
npm run buildGenerates optimized production build in dist/ directory.
- Customer Order Page: Visit the root URL (/) to place a new garment order. Fill in customer details, select material and quantity, optionally upload artwork, and submit.
- Admin Login: Navigate to
/admin/loginand sign in with admin credentials. Default:admin@dimalsha.com(password in .env). - Admin Dashboard: View real-time statistics including monthly income, salary expenses, pending deliveries, and total orders. Statistics update automatically when data changes.
- Order Management: View all customer orders, update order status and pricing, view detailed order information, generate invoices, and send order confirmation emails.
- Delivery Management: Create deliveries from orders, assign drivers, set scheduled dates, update delivery status, and send tracking emails to customers.
- Employee Management: Register new employees and manage employee information for driver assignment.
- Salary Management: Record employee salaries, track payment dates, mark payments as paid/unpaid, and view total salary expenses.
- Inventory Management: Add inventory items, manage stock levels with threshold alerts, add/remove quantities, and track inventory value.
- Reporting: Generate CSV reports for all orders and download invoices as PDF files.
- Email Notifications: When configured, customers receive order confirmation and delivery tracking emails with professional HTML templates.
gms/
βββ backend/
β βββ models/
β β βββ Order.js # Order schema with pricing details
β β βββ Delivery.js # Delivery tracking schema
β β βββ Employee.js # Employee information schema
β β βββ Salary.js # Salary records schema
β β βββ Inventory.js # Inventory items schema
β β βββ Driver.js # Driver schema
β βββ routes/
β β βββ orderRoutes.js # Order CRUD and email operations
β β βββ deliveryRoutes.js # Delivery management and tracking
β β βββ employeeRoutes.js # Employee management
β βββ uploads/ # User-uploaded artwork and files
β βββ temp/ # Temporary PDF files
β βββ public/ # Static files
β βββ server.js # Main Express server
β βββ package.json # Backend dependencies
β βββ seed.js # Database initialization script
β βββ .env # Environment variables (create locally)
β
βββ frontend/
β βββ src/
β β βββ components/ # Reusable React components
β β β βββ AdminDashboard.jsx # Admin statistics dashboard
β β β βββ AdminLogin.jsx # Admin authentication
β β β βββ AdminSidebar.jsx # Admin navigation sidebar
β β β βββ CustomerLogin.jsx # Customer login
β β β βββ CustomerRegister.jsx # Customer registration
β β β βββ DeliveryManagement.jsx # Delivery tracking interface
β β β βββ Employee.jsx # Employee roster
β β β βββ Finance.jsx # Salary management
β β β βββ Inventory.jsx # Stock management
β β β βββ OrderDashboard.jsx # Admin order view
β β β βββ OrderForm.jsx # Customer order form
β β β βββ PastOrders.jsx # Customer order history
β β β βββ ReportGenerating.jsx # Report generation
β β β βββ ProtectedRoute.jsx # Admin route protection
β β βββ pages/
β β β βββ OrderPage.jsx # Public order page
β β βββ styles/ # CSS files
β β βββ assets/ # Images and media
β β βββ App.jsx # Main app component with routing
β β βββ main.jsx # React entry point
β β βββ index.css # Global styles
β βββ public/ # Static assets
β βββ package.json # Frontend dependencies
β βββ vite.config.js # Vite build configuration
β βββ tailwind.config.js # Tailwind CSS theming
β βββ postcss.config.js # PostCSS configuration
β
βββ README.md # This file
Backend:
- Node.js & Express.js: Server framework and API routing
- MongoDB & Mongoose: Database and ODM
- JWT: Secure admin authentication
- bcryptjs: Password hashing
- Nodemailer: Email notifications
- Multer: File upload handling
- PDFKit: Invoice generation
- fast-csv: CSV report generation
- CORS: Cross-origin request handling
- Server-Sent Events: Real-time dashboard updates
Frontend:
- React 19: Dynamic UI components
- Vite: Fast development and production builds
- React Router DOM: Client-side navigation
- Tailwind CSS: Utility-first responsive styling
- Axios: HTTP client for API requests
- Framer Motion: Smooth animations and transitions
- Lucide React & React Icons: Icon libraries
- react-csv & file-saver: File export utilities
- React Confetti: Visual effects
- Frontend Data: Uses mock/static data for some features in development mode
- Email Service: Requires Gmail SMTP configuration; falls back to mock service if not configured
- File Upload Limits: Maximum 10MB per file; supports JPEG, PNG, PDF, AI, EPS formats
- Mock Delivery Initialization: Default delivery data is seeded on first run
- Password Reset: No built-in password reset feature; admin must update .env manually
This project was created as a comprehensive business management system for Dimalsha Fashions. While primarily designed for internal use, feedback and suggestions are welcome! If you encounter issues or have ideas for improvements, please open an issue on the GitHub repository or contact the development team. Thank you for using GMS!
This project is proprietary software for Dimalsha Fashions. All rights reserved. Unauthorized copying, modification, or distribution is prohibited.
- Grateful to the open-source communities of React, Node.js, Express, MongoDB, and Tailwind CSS for their powerful tools
- Thanks to Nodemailer for email integration and PDFKit for document generation
- Special thanks to Framer Motion for beautiful animations and Vite for fast development experience
For questions, feedback, or support inquiries:
π§ Email: heyridmi@gmail.com
Or open an issue at GitHub repository
- Scope: Full-stack garment production management system with admin dashboard, customer portal, and real-time updates
- Testing:
- Start backend:
npm start(from backend/) - Start frontend:
npm run dev(from frontend/) - Access at http://localhost:5173
- Login with admin credentials or create customer orders
- Test delivery tracking, salary management, and inventory features
- Start backend:
- Key Components:
- Review
src/components/AdminDashboard.jsxfor dashboard statistics - Check
src/components/OrderForm.jsxfor customer order flow - Inspect
src/components/DeliveryManagement.jsxfor tracking functionality - See
backend/server.jsfor API structure and email configuration
- Review
- Code Quality: All endpoints include error handling, validation, and comprehensive logging for easy debugging
- Improvements: Future enhancements could include payment gateway integration (Stripe), SMS notifications, advanced analytics, and mobile app version
Last Updated: December 2025
Version: 1.0.0
Status: Production Ready