APEX AI is a production-grade Formula 1 Intelligence Platform built for engineers, analysts, and enthusiasts who demand deep telemetry insights, AI-driven race predictions, and real-time strategic analysis. The platform draws design inspiration from Mercedes AMG Petronas, F1 TV, and Bloomberg Terminal, bringing a professional analytics aesthetic to the world of motorsport data.
The platform consists of two independently deployable services:
- Frontend — A Next.js application featuring a dark-themed, telemetry-focused dashboard with real-time data visualizations, an AI race engineer chatbot, prediction models, and intelligence reports.
- Backend — A Python FastAPI service that exposes a structured REST API serving driver data, lap telemetry, race predictions, strategic insights, and a chat inference endpoint.
| Technology | Purpose |
|---|---|
| Next.js 16 (App Router) | React framework with server-side rendering |
| TypeScript | End-to-end type safety |
| Tailwind CSS v4 | Utility-first styling |
| shadcn/ui | Accessible, composable UI components |
| Framer Motion | Smooth animations and transitions |
| Recharts | Data visualization and charting |
| TanStack Query | Server state management and caching |
| Zustand | Global client state management |
| Lucide React | Icon library |
| Technology | Purpose |
|---|---|
| Python 3.x | Runtime |
| FastAPI | High-performance ASGI web framework |
| Uvicorn | ASGI server with hot-reload |
| Pydantic v2 | Data validation and serialization |
Real-time race overview with driver championship standings, live race position history charted lap-by-lap, team constructor standings, and AI-generated strategic insights panel.
Head-to-head driver telemetry comparison across a full lap. Charts include speed trace, throttle application, brake pressure, and gear selection, all synchronized by lap distance. Includes sector-by-sector time analysis and tyre compound degradation visualization.
An interactive chat interface backed by the backend inference endpoint. Ask questions about sector performance, tyre strategy, undercut windows, or driver comparisons and receive structured, telemetry-aware responses.
AI-generated race outcome probabilities. Includes win probability rankings, podium prediction display, and a stacked outcome distribution chart showing each driver's probability of finishing in the top three positions.
A filterable archive of detailed technical, strategic, and race reports. Each report includes full article content, author attribution, estimated read time, and tag taxonomy.
User preferences panel for theme, telemetry refresh rate, and unit system configuration.
APEX-AI/
├── frontend/
│ └── apex-ai/
│ ├── app/
│ │ ├── (platform)/
│ │ │ ├── dashboard/ page.tsx
│ │ │ ├── telemetry/ page.tsx
│ │ │ ├── ai-engineer/ page.tsx
│ │ │ ├── predictions/ page.tsx
│ │ │ ├── reports/ page.tsx
│ │ │ ├── chatbot/ page.tsx
│ │ │ └── settings/ page.tsx
│ │ ├── globals.css
│ │ └── layout.tsx
│ ├── components/
│ │ ├── charts/ Recharts dashboard components
│ │ ├── layout/ Sidebar and navbar
│ │ ├── predictions/ Podium, outcome charts, rankings
│ │ ├── reports/ Report card components
│ │ ├── telemetry/ Telemetry chart suite
│ │ └── ui/ Shared component primitives
│ ├── lib/
│ │ ├── mock-data.ts Frontend static mock data
│ │ └── store.ts Zustand global state
│ └── types/
│ └── index.ts TypeScript type definitions
│
└── backend/
├── main.py FastAPI application entry point
├── models.py Pydantic models
├── mock_data.py Python mock data and logic
├── requirements.txt Python dependencies
└── routers/
├── drivers.py /api/drivers endpoints
├── telemetry.py /api/telemetry endpoints
├── predictions.py /api/predictions endpoints
├── reports.py /api/reports endpoints
└── chat.py /api/chat endpoint
The backend runs on http://localhost:8000. Full interactive documentation is auto-generated at /docs (Swagger UI) and /redoc (ReDoc).
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/dashboard |
Consolidated dashboard payload |
| GET | /api/drivers |
All 20 drivers |
| GET | /api/drivers/standings |
Championship order |
| GET | /api/drivers/{id} |
Single driver by ID |
| GET | /api/telemetry/live |
Lap telemetry (supports driver1 and driver2 query params) |
| GET | /api/telemetry/sectors |
Sector analysis table |
| GET | /api/telemetry/tyres |
Tyre degradation data |
| GET | /api/telemetry/pitstops |
Pit stop records |
| GET | /api/telemetry/positions |
Lap-by-lap race positions |
| GET | /api/predictions/race |
Win/podium/DNF probabilities |
| GET | /api/predictions/race/podium |
Predicted top 3 |
| GET | /api/predictions/insights |
Active AI strategic alerts |
| GET | /api/reports |
All reports (filterable by category, featured) |
| GET | /api/reports/{id} |
Single report |
| POST | /api/chat |
Chat inference (body: {"message": "..."}) |
| GET | /api/chat/suggestions |
Pre-built prompt suggestions |
| GET | /api/health |
Backend health and race status |
- Node.js 18 or later
- Python 3.10 or later
- npm or pnpm
git clone https://github.com/Sreejith-nair511/APEX-AI.git
cd APEX-AIcd backend
# Create and activate virtual environment
python -m venv venv
.\venv\Scripts\activate # Windows
source venv/bin/activate # macOS / Linux
# Install dependencies
pip install -r requirements.txt
# Start the server
uvicorn main:app --reload --port 8000The API will be available at http://localhost:8000.
The Swagger UI documentation will be available at http://localhost:8000/docs.
Open a second terminal:
cd frontend/apex-ai
# Install dependencies
npm install
# Start the development server
npm run devThe application will be available at http://localhost:3000.
cd frontend/apex-ai
npm run buildThe platform uses a custom dark design system built on Oklch color tokens defined in globals.css.
- Primary accent: Red (
#DC2626) used for live indicators, CTAs, and critical alerts - Typography: Inter (Google Fonts)
- Theme: Dark by default with glassmorphism used sparingly for depth
- Animations: Framer Motion for page transitions and data reveals
- Chart palette: Team-accurate F1 colors applied consistently across all visualizations
- The frontend currently uses static mock data from
lib/mock-data.ts. The backend exposes equivalent API endpoints, and the frontend can be wired to consume them via TanStack Query by replacing the static imports withuseQuerycalls tohttp://localhost:8000/api/.... - The
fix.pyfile in the frontend directory was a one-time utility script used during development to fix escaped backtick characters. It can be deleted safely. - The backend chat endpoint uses keyword matching for demo purposes. It can be replaced with any LLM provider (OpenAI, Gemini, Anthropic) by updating
mock_data.get_chat_reply.
MIT