# suppliedorange/vail architecture

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

- Interactive diagram: https://gitdiagram.com/suppliedorange/vail
- Repository: https://github.com/suppliedorange/vail

## Overview

##### Main Components Identification

a) Frontend Website (React/TypeScript based)
b) Backend Webserver (Node.js/TypeScript)
c) Desktop Application (Python-based pregame checker)

**[Frontend Website] <---> [Backend Webserver] <---> [Pregame Checker App]**

##### Detailed Component Breakdown

For each major component, include these specific elements:

Frontend Website (website/):
- React/TypeScript stack
- Key pages (Dashboard, Download, Login, etc.)
- API operations layer
- Component structure

Backend Webserver (webserver/):
- User management system
- Authentication services
- Pregame match handling
- Account functions
- Error handling

Pregame Checker (pregame_checker/):
- Game monitoring system
- VALORANT integration
- System tray application
- Match data collection

##### Data Flow Representation

- User authentication flow
- Match data transmission
- Game state monitoring
- API communications

##### Important Elements

- Authentication flow
- Game state monitoring pipeline
- Data storage and retrieval paths
- API endpoints and their purposes
- User interaction points

##### Technical Details to Highlight

Technical aspects:
- TypeScript/React frontend stack
- Node.js backend
- Python desktop application
- Database connections (if any)
- External API integrations (VALORANT game API)

##### Specific Implementation Notes

- How the pregame checker monitors VALORANT
- How match data flows from the game to the backend
- How the frontend displays this information
- User authentication and session management
- System tray integration for the desktop app

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend["Frontend (React/TypeScript)"]
        FE_Pages["Frontend Pages - Handles all page routing and views"]
        FE_API["API Operations Layer - Manages all API communications"]
        FE_Comp["Components - Reusable UI elements"]
        
        subgraph Pages["Pages - Individual route components"]
            Dashboard["Dashboard - Main user interface"]
            Download["Download - App distribution page"]
            Login["Login - User authentication"]
            Signup["Signup - New user registration"]
        end
        
        subgraph API_Ops["API Operations - Backend communication handlers"]
            MatchRetrieval["Match Retrieval - Fetches game data"]
            UserVerification["User Verification - Validates credentials"]
            UserRewards["User Rewards - Handles point system"]
        end
        
        subgraph Components["UI Components - Shared elements"]
            Header["Header - Navigation bar"]
            Footer["Footer - Site information"]
            Tutorial["Tutorial - User guidance"]
        end
        
        FE_Pages --> Pages
        FE_API --> API_Ops
        FE_Comp --> Components
    end
    
    subgraph Backend["Backend (Node.js/TypeScript)"]
        User["User Management - Handles user data"]
        Account["Account Functions - User operations"]
        PregameHandler["Pregame Handler - Match processing"]
        ErrorHandler["Error Handler - System-wide error management"]
        
        User --> Account
        PregameHandler --> User
        ErrorHandler -.-> User
        ErrorHandler -.-> Account
        ErrorHandler -.-> PregameHandler
    end
    
    subgraph Desktop_App["Desktop Application (Python)"]
        MainApp["Main Application - Core functionality"]
        GameMonitor["Game Status Monitor - VALORANT state tracking"]
        AppSpec["Application Specification - Build configuration"]
        
        MainApp --> GameMonitor
        MainApp --> AppSpec
    end
    
    subgraph External["External Systems"]
        VAL["VALORANT Game - Main game process"]
    end
    
    FE_API <--> Backend
    Backend <--> Desktop_App
    Desktop_App <--> VAL
    
    click FE_Pages "https://github.com/SuppliedOrange/VAIL/tree/main/website/src/pages/"
    click Dashboard "https://github.com/SuppliedOrange/VAIL/blob/main/website/src/pages/DashboardPage.tsx"
    click Download "https://github.com/SuppliedOrange/VAIL/blob/main/website/src/pages/DownloadPage.tsx"
    click Login "https://github.com/SuppliedOrange/VAIL/blob/main/website/src/pages/LogInPage.tsx"
    click Signup "https://github.com/SuppliedOrange/VAIL/blob/main/website/src/pages/SignUpPage.tsx"
    click FE_API "https://github.com/SuppliedOrange/VAIL/tree/main/website/src/apiOperations/"
    click MatchRetrieval "https://github.com/SuppliedOrange/VAIL/blob/main/website/src/apiOperations/getMatchesForUser.ts"
    click UserVerification "https://github.com/SuppliedOrange/VAIL/blob/main/website/src/apiOperations/verifyLocalCredentials.ts"
    click UserRewards "https://github.com/SuppliedOrange/VAIL/blob/main/website/src/apiOperations/rewardUser.ts"
    click FE_Comp "https://github.com/SuppliedOrange/VAIL/tree/main/website/src/components/"
    click Header "https://github.com/SuppliedOrange/VAIL/blob/main/website/src/components/Header.tsx"
    click Footer "https://github.com/SuppliedOrange/VAIL/blob/main/website/src/components/Footer.tsx"
    click Tutorial "https://github.com/SuppliedOrange/VAIL/blob/main/website/src/components/Tutorial.tsx"
    click User "https://github.com/SuppliedOrange/VAIL/blob/main/webserver/User.ts"
    click Account "https://github.com/SuppliedOrange/VAIL/blob/main/webserver/accountFunctions.ts"
    click PregameHandler "https://github.com/SuppliedOrange/VAIL/blob/main/webserver/PregameMatch.ts"
    click ErrorHandler "https://github.com/SuppliedOrange/VAIL/blob/main/webserver/Errors.ts"
    click MainApp "https://github.com/SuppliedOrange/VAIL/blob/main/pregame_checker/main.py"
    click GameMonitor "https://github.com/SuppliedOrange/VAIL/blob/main/pregame_checker/isGameRunning.py"
    click AppSpec "https://github.com/SuppliedOrange/VAIL/blob/main/pregame_checker/VAIL.spec"
    
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef backend fill:#2ecc71,stroke:#27ae60,color:white
    classDef desktop fill:#e67e22,stroke:#d35400,color:white
    classDef external fill:#95a5a6,stroke:#7f8c8d,color:white
    
    class FE_Pages,FE_API,FE_Comp,Dashboard,Download,Login,Signup,MatchRetrieval,UserVerification,UserRewards,Header,Footer,Tutorial frontend
    class User,Account,PregameHandler,ErrorHandler backend
    class MainApp,GameMonitor,AppSpec desktop
    class VAL external
```
