Skip to content

Harshid001/smartfactoryAIsystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿญ SmartFactory AI โ€” Industrial Management System

Hackathon Project โ€” AI-Powered Smart Manufacturing Management System with Machine & Workforce Optimization

SmartFactory Dashboard


๐Ÿš€ Overview

SmartFactory AI is a full-stack industrial management platform that provides real-time monitoring, predictive analytics, and AI-driven optimization for manufacturing facilities.

โœจ Key Features

Module Description
๐Ÿ–ฅ๏ธ Machine Health Monitoring Real-time temperature, vibration, runtime tracking
๐Ÿ”ฎ Predictive Maintenance AI-powered failure prediction scoring
๐Ÿ“Š Production Tracking Daily targets vs actual with efficiency analytics
๐Ÿ“ฆ Inventory Automation Automated low-stock alerts and stock management
๐Ÿ”” Smart Alert System Multi-category alert system with severity levels
๐Ÿ“ˆ Analytics Dashboard Factory-wide KPIs and performance charts
๐Ÿ‘ฅ Worker Management Profiles, performance, skill-based assignment
๐Ÿ›ก๏ธ Safety Monitoring Incident tracking and compliance dashboard
๐Ÿ“„ Report Generation CSV/PDF export for all modules
๐Ÿ” Role-Based Auth Admin / Manager / Worker access control

๐Ÿ—๏ธ Project Structure

smartfactory/
โ”œโ”€โ”€ frontend/                 # React + Vite + Tailwind CSS
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ common/
โ”‚   โ”‚   โ”‚       โ””โ”€โ”€ Layout.jsx        # Sidebar + Header
โ”‚   โ”‚   โ”œโ”€โ”€ context/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ AuthContext.jsx       # JWT Auth state
โ”‚   โ”‚   โ”œโ”€โ”€ data/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ dummyData.js          # Complete sample data
โ”‚   โ”‚   โ”œโ”€โ”€ pages/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ LoginPage.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ DashboardPage.jsx     # Command Center
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ MachinesPage.jsx      # Machine Health
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ MaintenancePage.jsx   # Predictive Maint.
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ProductionPage.jsx    # Production Tracking
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ InventoryPage.jsx     # Inventory Automation
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ WorkersPage.jsx       # Workforce Mgmt
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ AlertsPage.jsx        # Smart Alerts
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ AnalyticsPage.jsx     # Analytics Dashboard
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ReportsPage.jsx       # Report Generation
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ SafetyPage.jsx        # Safety Monitoring
โ”‚   โ”‚   โ”œโ”€โ”€ App.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ main.jsx
โ”‚   โ”‚   โ””โ”€โ”€ index.css
|   |__public
       |___ _redirects
|   |__ netlify.toml
โ”‚   โ”œโ”€โ”€ index.html
โ”‚   โ”œโ”€โ”€ vite.config.js
โ”‚   โ”œโ”€โ”€ tailwind.config.js
โ”‚   โ””โ”€โ”€ package.json
โ”‚
โ”œโ”€โ”€ backend/                  # Node.js + Express.js + MongoDB
โ”‚   โ”œโ”€โ”€ controllers/
โ”‚   โ”‚   โ””โ”€โ”€ authController.js
โ”‚   โ”œโ”€โ”€ middleware/
โ”‚   โ”‚   โ””โ”€โ”€ auth.js           # JWT protection + role authorization
โ”‚   โ”œโ”€โ”€ models/
โ”‚   โ”‚   โ”œโ”€โ”€ Machine.js        # Machine schema
โ”‚   โ”‚   โ”œโ”€โ”€ Worker.js         # Worker schema
โ”‚   โ”‚   โ”œโ”€โ”€ User.js           # User/auth schema
โ”‚   โ”‚   โ””โ”€โ”€ index.js          # Inventory, Production, Alert, Safety
โ”‚   โ”œโ”€โ”€ routes/
โ”‚   โ”‚   โ”œโ”€โ”€ authRoutes.js
โ”‚   โ”‚   โ”œโ”€โ”€ machineRoutes.js
โ”‚   โ”‚   โ”œโ”€โ”€ workerRoutes.js
โ”‚   โ”‚   โ”œโ”€โ”€ inventoryRoutes.js
โ”‚   โ”‚   โ”œโ”€โ”€ productionRoutes.js
โ”‚   โ”‚   โ”œโ”€โ”€ alertRoutes.js
โ”‚   โ”‚   โ”œโ”€โ”€ analyticsRoutes.js
โ”‚   โ”‚   โ”œโ”€โ”€ maintenanceRoutes.js
โ”‚   โ”‚   โ””โ”€โ”€ safetyRoutes.js
โ”‚   โ”œโ”€โ”€ utils/
โ”‚   โ””โ”€โ”€ seed.js           # Database seeder
โ”‚   โ”œโ”€โ”€ server.js
โ”‚   โ”œโ”€โ”€ .env.example
โ”‚   โ””โ”€โ”€ package.json
โ”‚
โ””โ”€โ”€ README.md

โšก Quick Start

Prerequisites

  • Node.js 18+
  • MongoDB (local or Atlas)
  • npm or yarn

1. Clone & Setup

git clone <your-repo-url>
cd smartfactory

2. Frontend Setup

cd frontend
npm install
npm run dev

Frontend will run at http://localhost:5173

3. Backend Setup

cd backend
npm install
cp .env.example .env
# Edit .env with your MongoDB URI
npm run dev

API will run at http://localhost:5000

4. Seed Database (Optional)

cd backend
npm run seed

๐Ÿ” Demo Login Credentials

Role Email Password
Admin admin@factory.com admin123
Manager manager@factory.com manager123
Worker worker@factory.com worker123

๐Ÿ”Œ API Endpoints

Authentication

POST   /api/auth/register      Register new user
POST   /api/auth/login         Login
GET    /api/auth/me            Get current user

Machines

GET    /api/machines           All machines (filterable)
GET    /api/machines/:id       Machine by ID
POST   /api/machines           Create machine
PUT    /api/machines/:id       Update machine
PUT    /api/machines/:id/sensors  Update sensor data
DELETE /api/machines/:id       Deactivate machine

Workers

GET    /api/workers            All workers
GET    /api/workers/:id        Worker by ID
POST   /api/workers            Create worker
PUT    /api/workers/:id        Update worker

Inventory

GET    /api/inventory          All inventory
GET    /api/inventory/low-stock   Low stock items
POST   /api/inventory          Add item
PUT    /api/inventory/:id      Update item

Analytics

GET    /api/analytics/overview   Factory overview stats

Predictive Maintenance

GET    /api/maintenance/predict  AI failure risk predictions

๐Ÿค– AI Predictive Maintenance Algorithm

The failure risk score is calculated using weighted factors:

Risk Score = Temperature Weight (40 pts max)
           + Vibration Weight (30 pts max)
           + Maintenance Overdue Weight (25 pts max)
           + Efficiency Weight (15 pts max)
  • HIGH RISK (โ‰ฅ70): Immediate maintenance required
  • MEDIUM RISK (40-69): Schedule within 30 days
  • LOW RISK (<40): Normal monitoring

๐ŸŽจ Tech Stack

Layer Technology
Frontend React 18, Vite, Tailwind CSS
Charts Recharts
Icons Lucide React
Routing React Router v6
Auth JWT (simulated in frontend)
Backend Node.js, Express.js
Database MongoDB + Mongoose
Fonts Orbitron, Rajdhani, Share Tech Mono

๐Ÿ“Š Database Schema

Machine

{
  "machineId": "M001",
  "name": "CNC Lathe Alpha",
  "type": "CNC Lathe",
  "department": "Machining",
  "location": "Bay A1",
  "status": "operational | warning | critical | offline",
  "sensors": { "temperature": 68, "vibration": 0.3, "runtime": 1420 },
  "efficiency": 94,
  "assignedWorker": "ObjectId",
  "maintenance": { "lastDate": "2026-02-10", "nextDate": "2026-04-10" }
}

Worker

{
  "workerId": "W001",
  "name": "Arjun Sharma",
  "department": "Machining",
  "role": "Senior Operator",
  "skills": ["CNC", "Milling", "QC"],
  "shift": "Morning",
  "status": "active",
  "performance": { "score": 92, "completedTasks": 48 },
  "safetyScore": 98,
  "assignedMachine": "ObjectId"
}

๐Ÿ† Hackathon Highlights

  • โœ… 10 complete modules covering all requirements
  • โœ… Full-stack MERN with proper MVC architecture
  • โœ… AI Predictive Engine with multi-factor risk scoring
  • โœ… Professional dark theme โ€” Industrial grade UI
  • โœ… Role-based access โ€” Admin, Manager, Worker
  • โœ… Real-time charts โ€” Area, Bar, Radar, Pie charts
  • โœ… Export functionality โ€” CSV report downloads
  • โœ… Responsive design โ€” Works on all screen sizes
  • โœ… Worker-Machine Correlation Analysis
  • โœ… Safety incident tracking with compliance checklist

๐Ÿ‘จโ€๐Ÿ’ป Developer

SmartFactory AI โ€” Built for hackathon showcase Technology: MERN Stack + AI Analytics


"Industry 4.0 โ€” where intelligence meets manufacturing"

About

SmartFactory AI is a full-stack MERN (MongoDB, Express, React, Node.js) web application designed for intelligent manufacturing facility management. Originally built as a hackathon project, it provides real-time monitoring, predictive analytics, and AI-driven optimization for industrial operations.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors