A complete, production-grade maintenance management system similar to Odoo modules, built with modern web technologies.
- Equipment Management: Complete asset registry with warranty tracking, ownership, and location management
- Maintenance Teams: Team-based access control with role management
- Maintenance Requests: Full workflow management (New → In Progress → Repaired/Scrap)
- Kanban Board: Drag-and-drop interface for request management
- Calendar View: Preventive maintenance scheduling
- Smart Buttons: Quick access to related maintenance requests from equipment details
- Automation: Cron jobs for overdue detection and reminders
- JWT-based authentication with automatic token refresh
- Role-based access control (User, Technician, Manager)
- PostgreSQL with strict referential integrity
- RESTful API with Swagger documentation
- Audit trail for all operations
- Transaction safety for critical workflows
- Runtime: Node.js + Express
- Database: PostgreSQL 14+ (Compatible with Render)
- Authentication: JWT (jsonwebtoken, bcryptjs)
- Validation: express-validator
- Cron Jobs: node-cron
- Documentation: Swagger/OpenAPI
- Framework: Next.js 14 (React 18)
- Styling: Tailwind CSS
- Drag & Drop: @dnd-kit
- Calendar: FullCalendar
- State Management: Zustand
- HTTP Client: Axios
- Notifications: react-hot-toast
Before you begin, ensure you have the following/available:
- Node.js 18+ (Download)
- PostgreSQL Database (Local or Remote, e.g., Render)
git clone <repository-url>
cd GearGuardNavigate to the backend directory:
cd backend
npm installCreate a .env file (copy from .env.example or use the template below):
# Copy example file
cp .env.example .envDatabase Configuration: You can use a local database OR a remote Render database.
- Option A (Render): Set
DATABASE_URLto your Render connection string.DATABASE_URL=postgres://user:password@hostname.render.com/dbname_sslmode=require
- Option B (Local): Set individual DB params (
DB_HOST,DB_USER, etc.).
We have a script to automatically set up the schema and load dummy data, regardless of where your database is hosted.
Run this command in the backend folder:
npm run db:initThis will wipe the existing database schema and re-create it with sample data (5 users, 10 equipment, etc.).
Navigate to the frontend directory:
cd ../frontend
npm installCreate a .env.local file pointing to your backend:
# .env.local
NEXT_PUBLIC_API_URL=http://localhost:5000You need to run both backend and frontend in separate terminals.
cd backend
npm run dev- API: http://localhost:5000
- API Documentation: http://localhost:5000/api-docs
- Health Check: http://localhost:5000/health
cd frontend
npm run dev- Access App: http://localhost:3000
Use these accounts to log in and test the system:
| Role | Password | |
|---|---|---|
| Manager | manager@gearguard.com |
password123 |
| Technician | tech1@gearguard.com |
password123 |
| User | user1@gearguard.com |
password123 |
Manager has full access. Technicians can only see their team's requests. Users can only see their own requests.
Once the backend is running, access the interactive API documentation at: http://localhost:5000/api-docs
- Can create maintenance requests
- Can view their own requests
- All User permissions
- Can view team's requests
- Can update requests for their team
- Can change request status
- Can assign themselves to requests
- All Technician permissions
- Can create/edit equipment
- Can create/manage teams
- Can add/remove team members
- Can view all requests across teams
- Can delete requests
New → In Progress → Repaired
↳ Scrap
- New: Request created.
- In Progress: Technician assigned (Required).
- Repaired: Work finished, duration logged.
- Scrap: Equipment permanently broken. Marks equipment as Unusable.
- Overdue Detection: Runs hourly. Marks requests past scheduled date as Overdue.
- Preventive Reminders: Daily at 8 AM.
- Warranty Checks: Daily at 9 AM.
GearGuard/
├── database/ # SQL Schema and Seed files
├── backend/ # Node.js/Express API
│ ├── src/controllers # Business Logic
│ ├── src/routes # API Endpoints
│ └── scripts/ # DB Init Scripts
└── frontend/ # Next.js App
├── src/pages # Routes (Login, Dashboard, etc.)
└── src/components # React Components
Database Connection Error?
- Check your
.envDATABASE_URL. - Ensure your IP is allowed if using a managed cloud database.
- Ensure local Postgres service is running.
Frontend "Network Error"?
- Ensure backend is running on port 5000.
- Check
frontend/.env.localNEXT_PUBLIC_API_URL.
Login Failed?
- Run
npm run db:initinbackendagain to reset passwords/users.
Academic Project - GearGuard Maintenance Management System