A comprehensive full-stack web application for managing equipment maintenance, inventory tracking, and supply requisitions in logistics warehouse environments. Built as a complete university Software Engineering course project.
Logistics Maintenance Management System is a production-ready web application designed to streamline maintenance operations, equipment tracking, and inventory management for logistics and warehouse facilities. It provides real-time dashboards, equipment health monitoring, and automated requisition workflows to minimize downtime and optimize resource allocation.
- Real-time Dashboard: Visual analytics for maintenance status, equipment health, and operational metrics with Recharts visualizations
- Maintenance Management: Create, track, and update maintenance requests with priority levels and technician assignment
- Equipment Tracking: Comprehensive registry of logistics assets with health status monitoring and maintenance scheduling
- Inventory Management: Stock level tracking with automated low-stock alerts and supplier information
- Requisition Workflow: Streamlined supply request submission and admin approval/rejection process
- User Authentication: Secure JWT-based authentication with role-based access control (Admin/Technician)
- User Management: Admin can manage users, update roles, and delete accounts (with self-deletion prevention)
- Responsive Design: Fully responsive interface optimized for desktop use with modern UI components
The system follows a modern 3-tier architecture with comprehensive role-based access control:
Client (React SPA) β Express REST API β SQLite Database (Prisma ORM)
Frontend:
- React 18 with TypeScript for type-safe development
- Vite for fast development and optimized production builds
- Tailwind CSS 4.1.12 with custom design system and theme variables
- Radix UI (40+ components) for accessible, unstyled UI primitives
- Recharts for interactive data visualizations (Pie charts, Bar charts)
- React Router 7 for client-side navigation with protected routes
- Lucide React for beautiful, consistent icons
- React Hook Form for form validation and management
Backend:
- Express.js 5.2.1 REST API server with TypeScript
- Prisma ORM 6.2.1 for type-safe database operations and migrations
- SQLite for portable, file-based database storage (ideal for demos)
- JWT (jsonwebtoken) for stateless authentication with 24-hour tokens
- bcryptjs for secure password hashing
- Zod for runtime validation and type safety
- CORS for cross-origin resource sharing
Development Tools:
- TypeScript 5.0+ across both frontend and backend
- ts-node-dev for hot-reloading backend development
- Prisma Studio for visual database management
- Vite for fast frontend development server
- Node.js 18+ and npm/yarn/pnpm
- Modern web browser (Chrome, Firefox, Edge)
- Git for version control
-
Clone the repository
git clone https://github.com/yourusername/logistics-maintenance-system.git cd logistics-maintenance-system -
Install frontend dependencies
npm install
-
Install backend dependencies
cd server npm install cd ..
-
Set up the database
cd server npx prisma migrate dev --name init npx prisma db seed cd ..
-
Start both development servers
# Terminal 1: Start backend server (port 3001) cd server npm run dev # Terminal 2: Start frontend server (port 5173) cd .. npm run dev
-
Open your browser and navigate to
http://localhost:5173
The seed script creates the following users:
| Role | Password | |
|---|---|---|
| Admin | admin@logistic.com |
admin123 |
| Technician | tech@logistic.com |
tech123 |
# Build frontend
npm run build
# Build backend
cd server
npm run build
cd ..The built frontend files will be in the dist directory, and backend files in server/dist.
βββ src/ # Frontend source code
β βββ app/ # React application
β β βββ components/ # 40+ UI components (Dashboard, Lists, Auth)
β β β βββ figma/ # Image handling components
β β β βββ ui/ # 40+ Radix UI based components
β β βββ context/ # AuthContext for global state management
β β βββ lib/ # API client utilities and helpers
β β βββ routes.ts # Application routing configuration
β βββ styles/ # CSS and theme files (Tailwind, fonts)
β βββ main.tsx # Application entry point
βββ server/ # Backend Express server
β βββ src/ # Server source code
β β βββ lib/ # Prisma client and utilities
β β βββ middleware/ # Authentication and authorization middleware
β β βββ routes/ # 7 API route handlers (auth, equipment, etc.)
β β βββ index.ts # Express server setup and configuration
β βββ prisma/ # Database schema and migrations
β β βββ schema.prisma # Complete database schema with 5 models
β β βββ seed.ts # Seed data script with realistic test data
β βββ package.json # Backend dependencies and scripts
βββ documentation/ # Complete SWE project documentation
β βββ SRS.md # Software Requirements Specification
β βββ ARCHITECTURE.md # System architecture documentation
β βββ ERD.md # Entity Relationship Diagram
β βββ USE_CASES.md # Use case analysis
β βββ API_DOCS.md # Complete API documentation
βββ guidelines/ # Development guidelines
βββ public/ # Static assets
βββ deployment-guide.md # Netlify + Render deployment instructions
βββ netlify.toml # Netlify configuration
βββ vite.config.ts # Vite configuration
βββ postcss.config.mjs # PostCSS configuration
βββ package.json # Frontend dependencies and scripts
βββ README.md # This file
The system implements comprehensive role-based access control with two primary user roles and granular permissions:
Admin:
- Full CRUD access to all modules (equipment, inventory, maintenance, requisitions)
- User management (create, update roles, delete users with self-deletion prevention)
- Requisition approval/rejection authority
- Inventory deletion privileges
- Access to all dashboard analytics and reports
Technician:
- View-only access to equipment and inventory listings
- Create maintenance requests for specific equipment
- Submit supply requisitions with cost estimation
- Update status of their own assigned maintenance tasks
- Cancel their own pending maintenance requests
- View dashboard with relevant metrics
- JWT Authentication: All API routes (except
/api/auth/*) require Bearer token authorization - Password Hashing: bcryptjs with salt rounds for secure password storage
- Token Expiration: JWT tokens expire after 24 hours
- Middleware Protection: Route-level authorization with
authenticateTokenandauthorizeRolemiddleware - Input Validation: Zod schema validation for all API requests
- SQL Injection Prevention: Prisma ORM with parameterized queries
The backend provides a comprehensive RESTful API with 7 route modules. Complete documentation is available in API_DOCS.md.
POST /api/auth/register- User registration with role assignment (max 5 technicians)POST /api/auth/login- JWT token generation with email/passwordGET /api/auth/me- Get current authenticated user profile (protected)
GET /api/maintenance- List all maintenance requests with equipment/user relationshipsPOST /api/maintenance- Create new maintenance request (Technician only)PUT /api/maintenance/:id- Update maintenance status/assignment with role-based permissionsDELETE /api/maintenance/:id- Delete maintenance request (Admin only)GET /api/maintenance/technicians- List available technicians for assignment (Admin only)
GET /api/equipment- List all equipment with status and maintenance historyPOST /api/equipment- Create new equipment record (Admin only)PUT /api/equipment/:id- Update equipment details (Admin only)DELETE /api/equipment/:id- Delete equipment (Admin only)
GET /api/inventory- List all inventory items with stock levelsPOST /api/inventory- Create new inventory item (Admin only)PUT /api/inventory/:id- Update inventory quantity or restockDELETE /api/inventory/:id- Delete inventory item (Admin only)
GET /api/requisitions- List all requisitions with requester informationPOST /api/requisitions- Create new supply requisitionPUT /api/requisitions/:id- Update requisition status (Admin only for approval/rejection)DELETE /api/requisitions/:id- Delete requisition (Admin only)
GET /api/dashboard/stats- Aggregated system statistics for dashboard visualization
GET /api/users- List all users (Admin only)PUT /api/users/:id/role- Update user role (Admin only)DELETE /api/users/:id- Delete user (Admin only, prevents self-deletion)
The application uses a comprehensive design system defined in src/styles/theme.css with:
- Primary Color:
#030213(Dark Blue/Black) for brand identity - Status Colors:
- Operational:
#10b981(Emerald) - Under Maintenance:
#f59e0b(Amber) - Out of Service:
#ef4444(Red) - Pending:
#8b5cf6(Purple) - Approved:
#3b82f6(Blue)
- Operational:
- Neutral Scale:
#f8fafcto#0f172afor backgrounds, text, and borders
- Primary Font: Outfit family (sans-serif) with responsive sizing
- Font Weights: 400 (Regular), 500 (Medium), 600 (Semibold), 700 (Bold), 800 (Extrabold), 900 (Black)
- Scale: Responsive typography with clamp() for fluid sizing
- Spacing Scale: Tailwind's 0.25rem increments (0, 0.25, 0.5, 0.75, 1, 1.5, 2, 2.5, 3, 4, 5, 6, 8, 10, 12, 14, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 72, 80, 96)
- Border Radius: Consistent rounded corners (0.375rem, 0.5rem, 0.75rem, 1rem, 1.5rem, 2rem)
- Shadows: Subtle elevation system with multiple shadow levels
- 40+ Radix UI Components: Unstyled, accessible primitives with custom styling
- Custom Components: Dashboard cards, data tables, forms, navigation sidebar
- Interactive States: Hover, focus, active, and disabled states for all interactive elements
- Animations: Smooth transitions and micro-interactions for better UX
Authentication Flow:
- Register new user with valid credentials
- Login with correct credentials β Receive JWT token
- Access protected routes with valid token
- Attempt to access protected routes without token β 401 Unauthorized
- Attempt to access admin-only routes as technician β 403 Forbidden
CRUD Operations:
- Create maintenance request β Verify persistence in database
- Update maintenance status β Verify status change reflects in UI
- Delete equipment as admin β Verify removal from database
- Attempt to delete as technician β Verify permission denied
Role-Based Access Control:
- Admin can delete users (except themselves)
- Technician can only update their own assigned tasks
- Admin can approve/reject requisitions
- Technician can only view inventory, not delete
- All foreign key constraints are enforced
- Cascade deletion works correctly (equipment deletion removes related maintenance)
- Unique constraints prevent duplicate emails
- Default values are applied correctly (status, timestamps)
- Dashboard stats load in <500ms with realistic dataset
- API responses are optimized with proper indexing
- Frontend components are memoized for better performance
- Images are optimized with fallbacks
The system is designed for deployment using a split architecture: Netlify for the frontend and Render for the backend. This provides optimal performance and reliability on free tiers. Complete deployment instructions are available in deployment-guide.md.
- Create an account at Render.com
- Create a New Web Service and connect your GitHub repository
- Configure Build & Start:
- Root Directory:
server - Build Command:
npm install && npm run prisma:generate && npm run build - Start Command:
npm run start
- Root Directory:
- Add Environment Variables:
DATABASE_URL:file:./dev.db(Note: For production persistence, consider using Supabase PostgreSQL)JWT_SECRET: A secure random string (minimum 32 characters)NODE_ENV:productionPORT:10000(Render's default)
- Sign in to Netlify at Netlify.com
- Add New Site β "Import from Git" and select your repository
- Site Configuration:
- Build Command:
npm run build - Publish Directory:
dist
- Build Command:
- Environment Variables:
VITE_API_URL: Your Render service URL followed by/api(e.g.,https://your-backend.onrender.com/api)
For University Projects/Demos (SQLite):
- SQLite is perfect for submissions and demonstrations
- Database file is included in the repository
- Zero setup required for grading or evaluation
- Data persists across server restarts in local development
For Production Use (Supabase PostgreSQL):
- Create a free project on Supabase.com
- Copy the "Transaction" connection string from Database Settings
- Update
DATABASE_URLin Render environment variables - Change
provider = "sqlite"toprovider = "postgresql"inschema.prisma - Run
npx prisma db pushto sync schema - Run
npx prisma db seedto populate with initial data
- Backend health check returning 200 at
/api/health - Frontend
VITE_API_URLenvironment variable set correctly - Database seeded with initial users (admin@logistic.com / admin123)
- Netlify redirects configured via
netlify.toml - CORS properly configured for production domains
- JWT_SECRET is strong and unique
- Fork the repository and clone it locally
- Create a feature branch:
git checkout -b feature/your-feature - Install dependencies: Run
npm installin root andcd server && npm install - Set up database:
cd server && npx prisma migrate dev && npx prisma db seed - Make your changes following the code style guidelines
- Test your changes: Verify both frontend and backend functionality
- Commit with descriptive messages: Use conventional commit format
- Push to your fork:
git push origin feature/your-feature - Open a Pull Request with detailed description of changes
- TypeScript: Strict mode enabled, explicit return types for functions
- React: Functional components with hooks, proper prop typing
- Tailwind CSS: Use utility classes, avoid custom CSS when possible
- Naming: PascalCase for components, camelCase for variables/functions
- Imports: Group imports (React, third-party, local), alphabetical order
- Error Handling: Try/catch blocks with proper error messages
- Comments: JSDoc for complex functions, inline comments for non-obvious logic
- Database: All changes require Prisma migrations (
npx prisma migrate dev) - API: Follow REST conventions, proper HTTP status codes
- Authentication: All routes (except auth) must be protected
- Validation: Use Zod schemas for all API input validation
- Testing: Manual testing of all user flows required
This project is licensed under the MIT License.
This project includes comprehensive documentation suitable for university Software Engineering courses:
- Software Requirements Specification - IEEE 830 template with functional/non-functional requirements
- System Architecture - 3-tier architecture with component breakdown and diagrams
- Entity Relationship Diagram - Complete database schema with relationships in Mermaid format
- Use Case Analysis - Actor-based use cases with diagrams and descriptions
- API Documentation - Complete REST API reference with endpoints and examples
- Deployment Guide - Step-by-step Netlify + Render deployment instructions
- Project Plan - Original transformation plan from Figma to full-stack application
- Development Guidelines - Code style and best practices
- 5 Data Models: User, Equipment, MaintenanceRequest, Requisition, InventoryItem
- Relationships: Foreign key constraints with cascade deletion
- Seed Data: Realistic test data for demonstration and testing
- Migrations: Prisma migration history for schema evolution
- Authentication: JWT implementation with 24-hour expiration
- Authorization: Role-based access control (Admin/Technician)
- Validation: Input validation with Zod schemas
- Password Security: bcryptjs hashing with salt rounds
For support, please:
- Check the documentation first
- Review existing issues on GitHub
- Create a new issue with detailed information about your problem
- Radix UI - Accessible, unstyled UI primitives (MIT License)
- Recharts - Composable charting library built with React (MIT License)
- Lucide Icons - Beautiful & consistent icon toolkit (ISC License)
- Prisma - Next-generation ORM for TypeScript & Node.js (Apache 2.0)
- Tailwind CSS - Utility-first CSS framework (MIT License)
- React Hook Form - Performant, flexible forms with easy validation (MIT License)
- Zod - TypeScript-first schema validation (MIT License)
- Figma Design System - Original UI design and component structure
- Color Palette - Custom logistics-themed color scheme
- Typography - Outfit font family for modern, readable interface
- Software Engineering Principles - Applied SWE methodologies throughout development
- Database Design - Proper normalization and relationship modeling
- Security Best Practices - JWT authentication, password hashing, input validation
Built as a comprehensive Software Engineering course project
Demonstrating full-stack development, database design, and system architecture