Skip to content

Sreejith-nair511/APEX-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

APEX AI — Formula 1 Intelligence Platform

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.


Overview

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.

Tech Stack

Frontend

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

Backend

Technology Purpose
Python 3.x Runtime
FastAPI High-performance ASGI web framework
Uvicorn ASGI server with hot-reload
Pydantic v2 Data validation and serialization

Features

Dashboard

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.

Telemetry

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.

AI Race Engineer

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.

Predictions

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.

Intelligence Reports

A filterable archive of detailed technical, strategic, and race reports. Each report includes full article content, author attribution, estimated read time, and tag taxonomy.

Settings

User preferences panel for theme, telemetry refresh rate, and unit system configuration.


Project Structure

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

API Reference

The backend runs on http://localhost:8000. Full interactive documentation is auto-generated at /docs (Swagger UI) and /redoc (ReDoc).

Core Endpoints

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

Getting Started

Prerequisites

  • Node.js 18 or later
  • Python 3.10 or later
  • npm or pnpm

1. Clone the Repository

git clone https://github.com/Sreejith-nair511/APEX-AI.git
cd APEX-AI

2. Start the Backend

cd 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 8000

The API will be available at http://localhost:8000. The Swagger UI documentation will be available at http://localhost:8000/docs.

3. Start the Frontend

Open a second terminal:

cd frontend/apex-ai

# Install dependencies
npm install

# Start the development server
npm run dev

The application will be available at http://localhost:3000.

4. Production Build (Frontend)

cd frontend/apex-ai
npm run build

Design System

The 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

Development Notes

  • 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 with useQuery calls to http://localhost:8000/api/....
  • The fix.py file 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.

License

MIT

About

APEX AI is an advanced Formula 1 Intelligence Platform designed to bring together telemetry analytics, AI-powered race engineering, predictive modeling, automated race reporting, and conversational data exploration into a single unified experience.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors