Gear-Guard is a comprehensive equipment management system with downtime cost calculation and human impact assessment. The application helps organizations track equipment, manage maintenance requests, and understand the financial and human impact of equipment downtime.
- Equipment Management: Track all equipment with detailed information
- Maintenance Requests: Create, assign, and track maintenance requests
- Downtime Cost Calculation: Calculate financial impact of equipment downtime
- Human Impact Assessment: Evaluate the human impact of equipment issues
- Safety Monitoring: Track and monitor safety risks
- Offline-First: Continue working even without internet connectivity
- Real-time Sync: Automatic synchronization when connectivity is restored
- Risk Assessment: Evaluate equipment risk levels and prioritize maintenance
- Monte Carlo Simulation: Probabilistic uncertainty modeling for downtime cost calculations
- Predictive Analytics: TensorFlow.js-powered forecasting of equipment failures
- WebAuthn Security: Biometric validation and immutable audit trails
- Advanced Visualizations: D3.js-powered human impact narratives
- CRDT Synchronization: Conflict-free offline operations
- Operational Transformation: Real-time collaborative editing
- Node.js with Express
- PostgreSQL database
- JWT authentication
- Custom offline sync system
- React with Vite
- React Router for navigation
- IndexedDB for offline storage
- Custom hooks for offline/sync functionality
gear-guard/
├── backend/ # Node.js + Express Backend
│ ├── src/
│ │ ├── config/
│ │ │ ├── database.js # DB connection config
│ │ │ └── env.js # Environment variables
│ │ ├── controllers/
│ │ │ ├── equipmentController.js
│ │ │ ├── requestController.js
│ │ │ ├── technicianController.js
│ │ │ └── impactController.js # Downtime cost calculator
│ │ ├── models/
│ │ │ ├── Equipment.js
│ │ │ ├── MaintenanceRequest.js
│ │ │ ├── Technician.js
│ │ │ ├── Department.js
│ │ │ └── ImpactLog.js # Downtime cost logs
│ │ ├── routes/
│ │ │ ├── equipmentRoutes.js
│ │ │ ├── requestRoutes.js
│ │ │ ├── technicianRoutes.js
│ │ │ ├── impactRoutes.js
│ │ │ ├── authRoutes.js
│ │ │ ├── offlineRoutes.js
│ │ │ ├── aiRoutes.js
│ │ │ ├── simulationRoutes.js
│ │ │ └── securityRoutes.js
│ │ ├── middleware/
│ │ │ ├── auth.js # Authentication
│ │ │ ├── offlineSync.js # Offline sync handling
│ │ │ └── errorHandler.js
│ │ ├── services/
│ │ │ ├── offlineService.js # Offline-first logic
│ │ │ ├── impactCalculator.js # Human impact & cost calc
│ │ │ ├── syncService.js # Data synchronization
│ │ │ ├── safetyService.js # Safety lockdown logic
│ │ │ ├── ai/ # AI and predictive services
│ │ │ │ └── equipmentPredictor.js
│ │ │ ├── simulation/ # Monte Carlo simulation
│ │ │ │ └── simulationService.js
│ │ │ └── security/ # Security and audit services
│ │ │ └── securityService.js
│ │ ├── utils/
│ │ │ ├── databaseSync.js # Conflict resolution
│ │ │ ├── costCalculator.js # Downtime cost formulas
│ │ │ └── validators.js
│ │ └── app.js # Express app setup
│ ├── migrations/ # Database migrations
│ │ ├── 001_create_equipment.sql
│ │ ├── 002_create_requests.sql
│ │ ├── 003_create_technicians.sql
│ │ ├── 004_create_impact_logs.sql
│ │ └── 005_seed_data.sql
│ ├── docker/
│ │ └── docker-compose.yml # PostgreSQL + Adminer
│ ├── package.json
│ ├── .env.example
│ └── server.js
├── frontend/ # React Frontend
│ ├── public/
│ │ ├── index.html
│ │ ├── manifest.json
│ │ ├── service-worker.js
│ │ └── icons/
│ ├── src/
│ │ ├── components/
│ │ │ ├── dashboard/
│ │ │ │ ├── HumanImpactDashboard.jsx
│ │ │ │ ├── CostCalculator.jsx # NEW: Cost calculator UI
│ │ │ │ └── SafetyMonitor.jsx
│ │ │ ├── equipment/
│ │ │ │ ├── EquipmentList.jsx
│ │ │ │ ├── EquipmentForm.jsx
│ │ │ │ └── EquipmentDetail.jsx
│ │ │ ├── requests/
│ │ │ │ ├── MaintenanceKanban.jsx
│ │ │ │ ├── RequestForm.jsx
│ │ │ │ ├── RequestDetail.jsx
│ │ │ │ └── CalendarView.jsx
│ │ │ ├── technicians/
│ │ │ │ ├── TechnicianList.jsx
│ │ │ │ └── SkillMatrix.jsx
│ │ │ ├── visualization/ # NEW: Advanced visualizations
│ │ │ │ ├── HumanImpactVisualizer.js
│ │ │ │ └── AdvancedVisualization.jsx
│ │ │ ├── simulation/ # NEW: Monte Carlo simulation
│ │ │ │ └── monteCarloSimulator.js
│ │ │ ├── prediction/ # NEW: Predictive analytics
│ │ │ │ └── equipmentPredictor.js
│ │ │ ├── security/ # NEW: Security services
│ │ │ │ └── securityService.js
│ │ │ ├── common/
│ │ │ │ ├── OfflineStatus.jsx
│ │ │ │ ├── SyncIndicator.jsx
│ │ │ │ └── LoadingSpinner.jsx
│ │ │ └── layout/
│ │ │ ├── Header.jsx
│ │ │ ├── Sidebar.jsx
│ │ │ └── Footer.jsx
│ │ ├── pages/
│ │ │ ├── Dashboard.jsx
│ │ │ ├── EquipmentPage.jsx
│ │ │ ├── RequestsPage.jsx
│ │ │ ├── CalendarPage.jsx
│ │ │ ├── ReportsPage.jsx # Cost analysis reports
│ │ │ └── SettingsPage.jsx
│ │ ├── services/
│ │ │ ├── api.js # API calls
│ │ │ ├── offlineStorage.js # IndexedDB/LocalStorage
│ │ │ └── syncManager.js # Frontend sync logic
│ │ ├── hooks/
│ │ │ ├── useOffline.js # Custom hook for offline
│ │ │ ├── useSync.js # Sync status hook
│ │ │ └── useImpact.js # Impact calculations hook
│ │ ├── utils/
│ │ │ ├── impactCalculator.js
│ │ │ ├── costCalculator.js # Frontend cost calculations
│ │ │ ├── formatters.js
│ │ │ └── constants.js
│ │ ├── styles/
│ │ │ ├── main.css
│ │ │ ├── components.css
│ │ │ ├── dashboard.css
│ │ │ └── responsive.css
│ │ ├── App.jsx
│ │ ├── index.jsx
│ │ └── routes.jsx
│ ├── package.json
│ └── vite.config.js # Using Vite for faster builds
├── database/ # Database schemas & scripts
│ ├── schema.sql # Complete PostgreSQL schema with audit logs
│ ├── triggers.sql # Database triggers
│ ├── functions.sql # Stored procedures
│ └── sample_data.sql # Sample data for demo
├── docs/
│ ├── API_DOCS.md
│ ├── DATABASE_SCHEMA.md
│ ├── OFFLINE_SYNC.md
│ ├── COST_CALCULATION.md # NEW: Cost calculator docs
│ ├── SECURITY_AUDIT.md # NEW: Security and audit documentation
│ └── ADVANCED_VISUALIZATION.md # NEW: Advanced visualization docs
├── docker-compose.yml # Main docker compose
├── .gitignore
├── README.md
└── package.json # Root package.json for scripts
- Node.js (v16 or higher)
- PostgreSQL
- Docker (optional, for database setup)
- Navigate to the backend directory:
cd gear-guard/backend - Install dependencies:
npm install - Create a
.envfile based on.env.example - Set up the database:
- Option 1: Use Docker:
docker-compose up -d - Option 2: Set up PostgreSQL manually and run migrations
- Option 1: Use Docker:
- Run migrations:
npm run migrate - Start the server:
npm run dev
- Navigate to the frontend directory:
cd gear-guard/frontend - Install dependencies:
npm install - Start the development server:
npm run dev
- From the project root, run:
docker-compose up -d - The application will be available at
http://localhost:3000
See API_DOCS.md for detailed API documentation.
See DATABASE_SCHEMA.md for the complete database schema.
See OFFLINE_SYNC.md for details about the offline-first approach.
See COST_CALCULATION.md for information about the downtime cost calculation system.
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request