A comprehensive Maintenance Management System built with a React frontend and Node.js/MySQL backend. This application allows for managing equipment, maintenance teams, and repair requests with role-based access control (RBAC).
- Frontend: React, Vite, TailwindCSS, React Router, Axios
- Backend: Node.js, Express, MySQL2, JWT Authentication
- Database: MySQL
- Node.js: v14+ (v18+ recommended)
- MySQL: 8.0+
- Ensure MySQL is running.
- Login to your MySQL instance:
mysql -u root -p
- Create the database:
CREATE DATABASE maintenance_system;
- Exit the MySQL shell.
- Navigate to the
backenddirectory:cd backend - Install dependencies:
npm install
- Create a
.envfile in thebackenddirectory with your database credentials:DB_HOST=localhost DB_USER=root DB_PASSWORD=your_password DB_NAME=maintenance_system PORT=5000 JWT_SECRET=your_jwt_secret_key
- Initialize the database schema:
node init_schema.js
- Start the backend server:
The server should run on
npm start # or for development with auto-reload: npx nodemon app.jshttp://localhost:5000.
- Open a new terminal and navigate to the
frontenddirectory:cd frontend - Install dependencies:
npm install
- Start the development server:
The application should be accessible at
npm run dev
http://localhost:5173.
- Role-Based Access Control: Distinct views and permissions for Managers, Technicians, and Employees.
- Dashboard: Interactive statistics and graphs for managers.
- Equipment Management: Create, track, and manage equipment details.
- Maintenance Requests: Submit and track repair tickets with priority levels.
- Team Management: Organize technicians into specialized teams.
- Fault Reporting: Easy-to-use modal for reporting equipment issues.
If you encounter issues during setup:
- Database Connection: Verify credentials in
backend/.env. - Schema Errors: Ensure
init_schema.jsran successfully. You can inspect tables usingmysqlcommand line or a GUI tool like Workbench/Beekeeper. - CORS Issues: The backend is configured to allow requests from the frontend, but ensure no browser extensions or network policies are blocking
localhost.
ISC
