A comprehensive React/Vite frontend with Express backend system for managing AI-powered mining vehicles, featuring real-time communication, task decomposition, and interactive mapping.
- Frontend: https://ai-command-centre.vercel.app
- Backend API: https://ai-command-centre-production.up.railway.app
- Database: MongoDB Atlas (Cloud-hosted)
This project was developed as an interview case study demonstrating:
- Real-time vehicle tracking with interactive map visualization
- AI-powered task decomposition that breaks down complex instructions into manageable steps
- Natural language processing for intuitive command input
- Real-time communication between operators and vehicles
- Task approval workflow with accept/reject functionality
- Modern, responsive UI/UX design
- Full-stack deployment on cloud platforms
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ AI MACHINE COMMAND CENTER โ
โ Vehicle Fleet Management System โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ FRONTEND โ โ BACKEND โโโโโบโ DATABASE โ
โ (React/Vite) โ โ (Node.js/ โ โ (MongoDB โ
โ โ โ Express) โ โ Atlas) โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ Vercel โ โ Railway โ โ Cloud โ
โ (Hosting) โ โ (Hosting) โ โ (Database) โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
- API Routes: REST endpoints for vehicles, POIs, tasks, and chat
- Task Decomposition Engine: AI-powered system that analyzes natural language instructions
- Real-time Communication: Socket.IO for live updates and chat functionality
- Mock Data: Realistic mining operation simulation
- Security: Multi-layered security with Helmet.js, CORS, and rate limiting
- Interactive Map: Leaflet-based mapping with custom vehicle and POI markers
- Vehicle Panel: Detailed vehicle information with real-time stats and chat
- Task Management: Create, approve, and monitor task execution
- Task Visualization: Step-by-step breakdown with progress tracking
- Responsive Design: Optimized for desktop and mobile devices
| Layer | Technology | Purpose |
|---|---|---|
| Frontend | React 19 + Vite 7.0.4 | Modern UI framework with fast build tool |
| Maps | Leaflet 1.9.4 + React-Leaflet 5.0.0 | Interactive mapping solution |
| Real-time | Socket.IO 4.8.1 | Live communication and updates |
| HTTP Client | Axios 1.11.0 | API communication |
| Icons | Lucide React 0.525.0 | Modern icon library |
| Backend | Node.js + Express.js 5.1.0 | RESTful API and real-time server |
| Database | MongoDB + Mongoose 8.16.4 | Flexible document storage |
| Security | Helmet 8.1.0 + CORS 2.8.5 + Rate Limiting | Multi-layered security |
| Deployment | Vercel + Railway + MongoDB Atlas | Cloud hosting with auto-scaling |
- Frontend Hosting: Vercel with global CDN and auto-scaling
- Backend Hosting: Railway with load balancing and dedicated resources
- Database: MongoDB Atlas with automatic scaling and backups
- VITE_BACKEND_URL: Frontend-backend communication
- MONGODB_URI: Database connection string
- CORS_ORIGIN: Cross-origin security settings
- PORT: Server configuration
- Real-time vehicle positions and status indicators
- Points of Interest (POIs) including storage zones, crushers, and loading docks
- Vehicle route visualization for moving vehicles
- Click-to-select vehicle interaction
Automatically breaks down complex instructions like:
- "Load 150 tons of Material A and transport it to the crusher"
- "Clear Zone A by moving all material to Zone B or C"
- "Fill the crusher with a mixture of Material A and Material B"
Into detailed step-by-step plans considering:
- Vehicle capacity limitations
- Multiple trips when needed
- Optimal routing
- Time estimations
- Real-time chat interface with AI responses
- Quick command suggestions
- Message history persistence
- Socket.IO powered real-time updates
- Create: Natural language task input with examples
- Decompose: AI automatically creates step-by-step plan
- Approve/Reject: Operator reviews and approves the plan
- Execute: Step-by-step execution with progress tracking
- Monitor: Real-time status updates and completion tracking
- Helmet.js: Security headers and XSS protection
- CORS Configuration: Controlled cross-origin access with dynamic origin validation
- Rate Limiting: Request throttling (100 requests per 15-minute window)
- Input Validation: Data sanitization and type validation
- Environment Variables: Secure configuration management
- โ Vite build tool for fast development and optimized production builds
- โ React component optimization and memoization
- โ Database indexing for fast queries
- โ CDN delivery for global content distribution
- โ Browser and server-side caching strategies
- โ Stateless backend design for horizontal scaling
- โ Load balancing through Railway
- โ MongoDB Atlas automatic scaling
- โ Microservices-ready modular architecture
- โ Cloud infrastructure with auto-scaling
- Node.js (v18 or higher)
- npm or yarn
For production deployment, see Deployment Setup Guide for configuring required secrets and deployment settings.
git clone <repository-url>
cd ai-machine-command-centercd server
npm installcd ../client
npm installCreate .env files in both client/ and server/ directories:
Server (.env):
MONGODB_URI=your_mongodb_connection_string
CORS_ORIGIN=http://localhost:5173
PORT=3001
Client (.env):
VITE_BACKEND_URL=http://localhost:3001
Backend (Terminal 1):
cd server
npm run devServer will start on http://localhost:3001
Frontend (Terminal 2):
cd client
npm run devApplication will start on http://localhost:5173
- View all vehicles and POIs on the interactive map
- Click on vehicles to see details and select them
- Observe vehicle routes for moving vehicles
- Check the legend for vehicle status indicators
- Click on a vehicle marker on the map
- The right panel will show detailed vehicle information
- View real-time stats: battery, load, position, last update
- Access the chat interface for communication
- Click "Create New Task" in the header
- Enter a natural language instruction (use examples for reference)
- Preview the AI decomposition (optional)
- Assign to a specific vehicle or auto-assign
- Submit the task
- Review the decomposed task steps
- Check estimated duration and complexity
- Click "Approve" to start execution or "Reject" to cancel
- Monitor progress in real-time
- Send messages to vehicles via the chat interface
- Use quick command suggestions for common operations
- Receive AI-powered responses from vehicles
- View message history
Try these natural language commands:
-
Load and Transport:
Load 150 tons of Material A and transport it to the crusher -
Zone Clearing:
Clear Zone A by moving all material to Zone B or C -
Material Mixing:
Fill the crusher with a mixture of Material A and Material B -
Custom Operations:
Load 200 tons of Material B and distribute between Zone B and Zone C
{
id: String,
name: String,
type: String,
status: String,
location: { lat: Number, lng: Number },
currentTask: String,
assignedTasks: [String],
specifications: Object
}{
id: String,
title: String,
description: String,
status: String,
priority: String,
assignedVehicle: String,
location: Object,
steps: [Object],
dueDate: Date
}{
id: String,
name: String,
type: String,
description: String,
location: Object,
materials: [String],
capacity: Number,
currentAmount: Number,
status: String
}The application is fully responsive and optimized for:
- Desktop: Full dual-panel layout with map and vehicle panel
- Tablet: Stacked layout with collapsible sections
- Mobile: Single-column layout with touch-optimized controls
The system simulates a realistic mining operation with:
- Haul Trucks: 100-ton capacity transport vehicles
- Excavators: 50-ton capacity digging equipment
- Loaders: 75-ton capacity loading machinery
- Storage Zones: Material storage areas (Zone A, B, C)
- Crusher: Material processing facility
- Loading Docks: Material pickup locations
- Material A: Primary ore material (2.5 tons/mยณ density)
- Material B: Secondary processing material (1.8 tons/mยณ density)
Input: "Load 80 tons of Material A and transport it to the crusher"
Output:
- Move to Zone A - Material A Storage (10 min)
- Load 80 tons of Material A (15 min)
- Transport to Primary Crusher (12 min)
- Unload 80 tons (10 min)
Input: "Load 150 tons of Material A and transport it to the crusher"
Output:
- Move to Zone A - Material A Storage (10 min)
- Load 100 tons of Material A (1/2 trips) (15 min)
- Transport to Primary Crusher (12 min)
- Unload 100 tons (10 min)
- Move to Zone A - Material A Storage (10 min)
- Load 50 tons of Material A (2/2 trips) (15 min)
- Transport to Primary Crusher (12 min)
- Unload 50 tons (10 min)
The system includes comprehensive error handling:
- Network errors: Automatic retry with user feedback
- Invalid tasks: Clear error messages and suggestions
- Connection loss: Reconnection attempts and status indicators
- Data validation: Input validation with helpful error messages
- โ Full-Stack Development: Complete React + Node.js application
- โ Real-time Features: Socket.IO implementation for live updates
- โ Cloud Deployment: Successfully deployed on Vercel + Railway
- โ Database Integration: MongoDB Atlas with proper schema design
- โ Security Implementation: Multi-layered security approach
- โ Performance Optimization: Fast loading and efficient operations
- โ Responsive Design: Mobile-friendly interface
- โ Production Ready: Live application with real data