A real-time Aircraft on Ground (AOG) prevention system that monitors Auxiliary Power Unit (APU) health across your fleet. Built with Next.js, FastAPI, and Firebase Authentication.
AOG Zero helps airlines prevent unplanned aircraft groundings by:
- Real-time APU health monitoring with predictive analytics
- Fleet-wide dashboard showing aircraft health status
- Priority-based alerts (Critical, Urgent, Warning, Monitor, Healthy)
- Historical flight tracking with maintenance insights
- Secure authentication via Google OAuth (WorkOS AuthKit)
ai-hackathon/
├── frontend/ # Next.js 15 + TypeScript
│ ├── app/
│ │ ├── page.tsx # Landing page (redirects to /login or /dashboard)
│ │ ├── login/ # Authentication page
│ │ ├── dashboard/ # Protected dashboard (aircraft fleet overview)
│ │ │ ├── page.tsx # Server component with auth guard
│ │ │ └── DashboardClient.tsx # Client component with fleet data
│ │ └── aircraft/[id]/ # Individual aircraft detail view
│ ├── components/
│ │ ├── AuthProvider.tsx # Firebase auth context
│ │ ├── Navbar.tsx # Navigation with user menu
│ │ └── AircraftCard.tsx # Aircraft status card component
│ ├── public/
│ │ └── media/ # Static assets (logos, icons)
│ └── .env.local # Frontend environment variables
│
├── backend/ # FastAPI + PostgreSQL
│ ├── main.py # API server entry point
│ ├── database.py # PostgreSQL connection & models
│ ├── models.py # Pydantic schemas
│ ├── scripts/
│ │ ├── reset_database.py # Clears database tables
│ │ └── seed_database.py # Populates with sample data
│ ├── seed_apu_data.py # Seeds APU health metrics
│ └── requirements.txt # Python dependencies
│
└── README.md
- Node.js 18+ and npm/pnpm/yarn
- Python 3.10+
- PostgreSQL 14+ (local or cloud instance)
- Firebase project (for authentication)
- WorkOS account (optional, for AuthKit)
git clone <repository-url>
cd ai-hackathoncd backend
# Create virtual environment
python -m venv venv
# Activate virtual environment
# Windows:
venv\Scripts\activate
# macOS/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Initialize database
python scripts/reset_database.py --yes
python scripts/seed_database.py --yes
python seed_apu_data.py
# Start backend server
uvicorn main:app --reload --reload-dir .Backend runs at http://localhost:8000
cd frontend
# Install dependencies
npm install
# or
pnpm install
# or
yarn install
# Configure environment variables
# Create .env.local file with:
NEXT_PUBLIC_API_URL=http://localhost:8000
NEXT_PUBLIC_FIREBASE_API_KEY=your_firebase_api_key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_firebase_project_id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_project.appspot.com
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=123456789
NEXT_PUBLIC_FIREBASE_APP_ID=1:123456789:web:abcdef
# Start development server
npm run dev
# or
pnpm dev
# or
yarn devFrontend runs at http://localhost:3000
- Go to Firebase Console
- Create a new project (or use existing)
- Enable Authentication → Google Sign-In
- Copy your Firebase config values to
.env.local - Add
http://localhost:3000to authorized domains
| Method | Endpoint | Description |
|---|---|---|
| GET | /aircrafts |
List all aircraft with health status |
| GET | /aircrafts/{id} |
Get specific aircraft details |
| GET | /aircrafts/{id}/flights |
Get flight history for aircraft |
| GET | /health |
API health check |
- Fleet Overview: Real-time health status for all aircraft
- Filtering: View by health category (Critical, Urgent, Warning, etc.)
- Sorting: By urgency, health score, or tail number
- Fleet Summary: Total aircraft count and health distribution
- APU Health Metrics: Temperature, pressure, vibration, oil levels
- Flight History: Last 10 flights with timestamps
- Predictive Alerts: AI-powered maintenance recommendations
- Real-time Updates: Auto-refresh every 30 seconds
- Google OAuth: Secure sign-in with Google accounts
- Protected Routes: Server-side auth guards on sensitive pages
- Session Management: Persistent auth state with Firebase
Frontend:
- Next.js 15 (App Router)
- TypeScript
- Firebase Authentication
- React Hooks
- CSS-in-JS (inline styles)
Backend:
- FastAPI
- PostgreSQL
- SQLAlchemy
- Pydantic
- Uvicorn
- Frontend uses Server Components for auth checks (no flicker on protected routes)
- Backend uses async/await for non-blocking database queries
- Database seeding includes realistic APU metrics and flight data
- CORS enabled for
localhost:3000during development
Port already in use:
# Windows
netstat -aon | findstr :3000
taskkill /PID <PID> /F
# macOS/Linux
lsof -ti:3000 | xargs kill -9Database connection error:
- Verify PostgreSQL is running
- Check
DATABASE_URLin.env - Ensure database exists:
createdb aog_zero
Firebase auth not working:
- Verify all Firebase config values in
.env.local - Check authorized domains in Firebase Console
- Clear browser cookies and try again
Anav Parvish Trishal Shaneel Yash Shivam Rohan Danvil


