Skip to content

RaKa8904/SmartCrew

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

34 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

✈️ SmartCrew

Aviation Operations Center β€” AI-Powered Crew Scheduling


An advanced, AI-powered full-stack aviation crew scheduling system β€” automating crew assignment, conflict detection, duty compliance, and flight operations management for airlines. Built as a Final Year T.E. AI & DS Project.


πŸ“Έ Preview

Interactive Scheduler Admin Analytics Live Flight Board
Drag-and-drop assignment board Scatter plots, delays, and CSV export FIDS airport-style departure board
Flight Management Crew Portal Notifications
Boarding-pass style cards Shift Bids, Swaps, and Leave Requests Real-time WebSocket + SMTP Email

✨ Features

πŸ›‘οΈ Role-Based Access Control

Three distinct portals with protected routes and JWT authentication:

Role Access
Admin Full control β€” crew, flights, rules, reports, analytics, system insights
Scheduler Auto-generate schedules, drag-and-drop assignments, resolve conflicts
Crew Personal schedule, shift bidding, peer swaps, availability management

πŸ€– AI Scheduling Engine & System Rules

Multi-factor crew scoring algorithm enforcing dynamic system rules:

  • Respects Min Rest Period between flights
  • Enforces Max Weekly Duty Hours cap per crew member
  • Checks Crew Availability and Leave Requests
  • Matches Qualification Type to flight constraints
  • Detects and prevents Overlap Conflicts automatically.

🧩 Interactive Drag-and-Drop Scheduler

A specialized visual workspace for Schedulers:

  • Filter available crew memebers by date.
  • Drag-and-drop crew from the Available Pool directly onto upcoming Flight Cards.
  • Triggers instant recalculation and assignment validation.

🌍 Real-World Flight Data Integration (Hybrid Engine)

The system is capable of ingesting live tracking data rather than relying completely on simulations:

  • Live FIDS Sync: Instant integration with the Aviationstack API to ingest real-world, live domestic flights (e.g., DEL to BOM).
  • Fallback Simulation: Automatically generates realistic high-volume routing models if an API key is absent.
  • Auto-Staffing Pipeline: Wipes old dummy flights, pulls 60+ new tracking flights, and instantly fires the AI Scoring Engine to evaluate 80+ mock crew members and auto-staff every single real flight according to compliance rules.

πŸ“ˆ Advanced Analytics & Admin Dashboard

Actionable operational intelligence:

  • Fleet Delays (7-Day Forecast): Rolling line chart tracking dispatch reliability.
  • Crew Fatigue Hotspots: Scatter plot cross-referencing Scheduled Duty Hours vs Alert/Notification count to prevent burnout.
  • Crew Utilization: Workload percentage ranking charts.
  • Data Export: Instant raw CSV workload exports.

πŸ›« Live Flight Board (FIDS) & Real-Time Comms

Real-time operations synchronized across all active clients:

  • WebSockets: Live updates to FIDS boards and Crew Portals via Socket.io.
  • SMTP Email Notifications: Securely sends alert emails for manual scheduling changes directly to Crew member inboxes.
  • Flip-text animation on status changes.

πŸ‘₯ Comprehensive Crew Self-Service Portal

Empowers crew members with direct schedule control:

  • Shift Swabbing: Request shift trades with qualified peers. Includes multi-stage approval workflow.
  • Flight Bidding: Place bids on unassigned priority flights.
  • Leave Management: Submit and track leave request statuses.

πŸš€ Tech Stack

Layer Technology
Frontend React 19 + Vite 7 + Tailwind CSS v4
UI Interactive @dnd-kit/core (Drag & Drop), Recharts (Analytics)
Fonts/Icons Inter, Space Mono, Lucide React, Framer Motion
Backend Node.js 22 + Express 5
Real-Time Socket.io (WebSockets), Nodemailer (SMTP)
Database PostgreSQL 16 + Prisma ORM 5
Auth JWT (jsonwebtoken) + bcryptjs

πŸ“ Project Structure

SmartCrew/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ prisma/
β”‚   β”‚   β”œβ”€β”€ schema.prisma          # DB schemas (User, Crew, Flight, Schedule, Rule, Bids...)
β”‚   β”‚   └── seed.js                # Fully boots dummy data for 25+ flights & 15+ crew
β”‚   └── src/
β”‚       β”œβ”€β”€ algorithms/
β”‚       β”‚   └── scheduling.js      # Core scoring algorithm
β”‚       β”œβ”€β”€ controllers/           # Business logic endpoints
β”‚       β”œβ”€β”€ middleware/            # Auth and Roles
β”‚       β”œβ”€β”€ routes/                # Express routing multiplexer
β”‚       β”œβ”€β”€ services/
β”‚       β”‚   β”œβ”€β”€ emailService.js        # Nodemailer SMTP logic
β”‚       β”‚   β”œβ”€β”€ socketService.js       # Live event broadcaster
β”‚       β”‚   β”œβ”€β”€ reportingService.js    # Prisma Aggregation (Fatigue/Delays)
β”‚       β”‚   β”œβ”€β”€ schedulingService.js   # Constraints validation
β”‚       β”‚   └── flightSyncService.js   # Live Aviationstack Tracking Sync
β”‚       └── index.js               # Node.js Server Boot
β”‚
└── frontend/
    └── src/
        β”œβ”€β”€ components/
        β”‚   └── Layout.jsx          # Radar HUD Wrapper
        β”œβ”€β”€ context/
        β”‚   β”œβ”€β”€ AuthContext.jsx     # JWT Sync State
        β”‚   └── RulesContext.jsx    # Live Dynamic Rules State
        β”œβ”€β”€ pages/
        β”‚   β”œβ”€β”€ AdminDashboard.jsx  # Analytics & System Rules
        β”‚   β”œβ”€β”€ SchedulerDashboard.jsx  # Drag-and-Drop Assignment
        β”‚   β”œβ”€β”€ CrewDashboard.jsx   # Duty tracking & Shift Bidding
        β”‚   β”œβ”€β”€ LiveFlightBoard.jsx # FIDS board
        β”‚   └── ...                 # Swaps, Users, Conflicts
        └── index.css               # Futuristic aviation theme definitions

βš™οΈ Setup & Installation

Prerequisites

  • Node.js v18+
  • PostgreSQL v14+

1. Clone the repo

git clone https://github.com/RaKa8904/SmartCrew.git
cd SmartCrew

2. Configure the Backend

cd backend
npm install

Create a .env file in the backend/ directory:

DATABASE_URL="postgresql://postgres:YOUR_PASSWORD@localhost:5432/crew_scheduling?schema=public"
JWT_SECRET="your_secure_jwt_secret_here"
PORT=5000

# Optional: For Email Notifications
SMTP_HOST=smtp.gmail.com
SMTP_USER=your_email@gmail.com
SMTP_PASS=your_app_password

# Optional: For Live Real-World Flight Data Sync
AVIATIONSTACK_API_KEY=your_api_key_here

3. Run Database Migrations & Seed

# Apply all generic migrations
npx prisma migrate dev

# Seed with rich mock flight data, schedules, and test accounts
npx prisma db seed

4. Start the Application

Backend:

npm run dev
# Server starts on http://localhost:5000

Frontend:

cd ../frontend
npm install
npm run dev
# App available at http://localhost:5173

πŸ‘€ Demo Accounts

The login page includes a Quick Access panel β€” just click a role card to auto-fill credentials.

Role Email Password
🟑 Admin admin@airline.com password123
πŸ”΅ Scheduler scheduler@airline.com password123
🟣 Pilot pilot1@airline.com password123
🟒 Cabin Crew cabin1@airline.com password123

πŸ“„ License

This project is licensed under the MIT License β€” see LICENSE for details.


Built with ❀️ for T.E. AI & DS

SmartCrew Β· Aviation Operations Center Β· 2025–2026

Releases

No releases published

Packages

 
 
 

Contributors

Languages