# khushmeeet/f1-scoreboard architecture

> Architecture diagram of the GitHub repository khushmeeet/f1-scoreboard, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/khushmeeet/f1-scoreboard
- Repository: https://github.com/khushmeeet/f1-scoreboard

## Overview

Project Type: Web Application (Formula 1 Scoreboard)

Key Components to Include in the System Design:

##### Frontend Layer
- Templates directory containing HTML files
- Static assets (CSS files)
- Tailwind CSS integration (based on tailwind.config.js)

##### Backend Layer (Python-based)
- FastAPI/Flask application (indicated by the templates structure and Procfile)
- Main application logic (main.py)
- Data models (models.py)
- Utility functions (utils.py)
- Custom filters (filters.py)

##### External Services Integration
- HTTP Client (httpx_client.py) for Formula 1 data API interactions
- Likely connecting to Formula 1's official API or similar racing data provider

##### Deployment Infrastructure
- Docker container (indicated by .dockerignore)
- Fly.io deployment (indicated by fly.toml)
- Heroku compatibility (indicated by Procfile)

##### Connection Flows
- Backend → External F1 Data API
- Backend → Deployment Infrastructure

##### Detailed Component Breakdown

Frontend Layer:
- Templates (HTML)
- Base Template
- Constructors View
- Drivers View
- Race Results View
- Schedule View
- Single Entity Views
- Static Assets
- CSS Files
- Tailwind CSS

Backend Layer:
- Application Core
- Main Application
- Data Models
- HTTP Client
- Utility Functions

##### Infrastructure Details
- Containerization boundary
- Deployment targets (Fly.io/Heroku)
- Dependency management (Pipfile)

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        Templates["Templates"]
        BaseTemplate["Base Template"]:::template
        ConstructorsView["Constructors View"]:::template
        DriversView["Drivers View"]:::template
        RaceResultsView["Race Results View"]:::template
        ScheduleView["Schedule View"]:::template
        SingleViews["Single Entity Views"]:::template
        SectionHeader["Section Header"]:::template
        
        StaticAssets["Static Assets"]
        CSS["CSS Files"]:::static
        TailwindCSS["Tailwind Config"]:::static
        
        Templates --> BaseTemplate
        Templates --> ConstructorsView
        Templates --> DriversView
        Templates --> RaceResultsView
        Templates --> ScheduleView
        Templates --> SingleViews
        Templates --> SectionHeader
        
        StaticAssets --> CSS
        StaticAssets --> TailwindCSS
    end
    
    subgraph Backend
        MainApp["Main Application"]:::backend
        DataModels["Data Models"]:::backend
        HTTPClient["HTTP Client"]:::backend
        Utils["Utility Functions"]:::backend
        Filters["Custom Filters"]:::backend
        
        MainApp --> DataModels
        MainApp --> HTTPClient
        MainApp --> Utils
        MainApp --> Filters
    end
    
    subgraph ExternalServices
        F1API["Formula 1 Data API"]:::external
    end
    
    subgraph Infrastructure
        Docker["Docker Container"]:::infra
        FlyIO["Fly.io Deployment"]:::infra
        Heroku["Heroku Platform"]:::infra
        Dependencies["Dependencies"]:::infra
        
        Docker --> FlyIO
        Docker --> Heroku
        Dependencies --> Docker
    end
    
    Templates --> MainApp
    HTTPClient --> F1API
    MainApp --> Docker
    
    %% Click Events
    click MainApp "https://github.com/khushmeeet/f1-scoreboard/blob/main/main.py"
    click DataModels "https://github.com/khushmeeet/f1-scoreboard/blob/main/models.py"
    click HTTPClient "https://github.com/khushmeeet/f1-scoreboard/blob/main/httpx_client.py"
    click Utils "https://github.com/khushmeeet/f1-scoreboard/blob/main/utils.py"
    click Filters "https://github.com/khushmeeet/f1-scoreboard/blob/main/filters.py"
    click BaseTemplate "https://github.com/khushmeeet/f1-scoreboard/blob/main/templates/base.html"
    click ConstructorsView "https://github.com/khushmeeet/f1-scoreboard/blob/main/templates/constructors.html"
    click DriversView "https://github.com/khushmeeet/f1-scoreboard/blob/main/templates/drivers.html"
    click RaceResultsView "https://github.com/khushmeeet/f1-scoreboard/blob/main/templates/race-results.html"
    click ScheduleView "https://github.com/khushmeeet/f1-scoreboard/blob/main/templates/schedule.html"
    click SingleViews "https://github.com/khushmeeet/f1-scoreboard/blob/main/templates/single-constructor.html"
    click SectionHeader "https://github.com/khushmeeet/f1-scoreboard/blob/main/templates/section-header.html"
    click CSS "https://github.com/khushmeeet/f1-scoreboard/blob/main/static/main.css"
    click TailwindCSS "https://github.com/khushmeeet/f1-scoreboard/blob/main/tailwind.config.js"
    click Docker "https://github.com/khushmeeet/f1-scoreboard/blob/main/.dockerignore"
    click FlyIO "https://github.com/khushmeeet/f1-scoreboard/blob/main/fly.toml"
    click Heroku "https://github.com/khushmeeet/f1-scoreboard/tree/main/Procfile"
    click Dependencies "https://github.com/khushmeeet/f1-scoreboard/tree/main/Pipfile"
    
    %% Styles
    classDef template fill:#2563eb,color:white
    classDef static fill:#4b5563,color:white
    classDef backend fill:#059669,color:white
    classDef external fill:#ea580c,color:white
    classDef infra fill:#6b7280,color:white
    
    %% Legend
    subgraph Legend
        L1["Frontend Component"]:::template
        L2["Static Asset"]:::static
        L3["Backend Component"]:::backend
        L4["External Service"]:::external
        L5["Infrastructure"]:::infra
    end
```
