# axelrizo/supahoot architecture

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

- Interactive diagram: https://gitdiagram.com/axelrizo/supahoot
- Repository: https://github.com/axelrizo/supahoot

## Overview

Based on your file tree and README, this project is a Vue 3 application bootstrapped via Vite—it’s essentially a frontend web application template that’s organized around a quiz or game (“supahoot”) theme. The project separates the UI (Vue components, router, providers) from the underlying business logic (quiz modules, services, utilities) and includes a testing suite with Vitest.

##### Project Type & Purpose
- The README confirms that this is a Vue 3 project using Vite, emphasizing development and build tools (hot-reload, lint, type-check, tests).
- The file structure, particularly under “src/lib/supahoot-web” and “src/lib/supahoot”, shows that it’s built around a quiz or interactive game system. The supahoot-web part handles the UI layer (views, router, providers for notifications and players) while supahoot contains quiz logic, domain models (e.g., quiz, question, player, answer), and services (avatar generation, quiz handling via Supabase).

##### Analyzing the File Structure
- Top-level files and configuration: Files like package.json, vite.config.ts, and various tsconfig files indicate the use of TypeScript, Vue 3, and Vite.
- Directories:
- /public: Likely holds static assets.
- /src/assets: Contains styling (main.css).
- /src/lib/supahoot-web: Contains the primary application UI components – App.vue (the root Vue component), main.ts (entry point), router configuration, providers (for notifications and player data), and various views for Admin and Player functionalities.
- /src/lib/supahoot: Contains domain-specific logic for quizzes and services. This includes modules related to quizzes (questions, answers, lobbies) and associated services (like avatar generation using Dicebear, and quiz services possibly interfacing with Supabase).
- /src/test: Contains support components and utilities for testing.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% UI Layer
    subgraph "Frontend (UI Layer)"
        UI_Main["main.ts"]:::ui
        UI_App["App.vue"]:::ui
        UI_Router["Router"]:::ui
        UI_Providers["Providers"]:::ui
        UI_Views["Views"]:::ui
    end

    %% Domain/Business Layer
    subgraph "Domain/Business Layer"
        Domain["Business Logic"]:::domain
        Domain_QuizModels["Quiz Domain Models"]:::domain
        Domain_Avatar["Avatar Services"]:::domain
        Domain_QuizServices["Quiz Services"]:::domain
        Domain_Utils["Utility Functions"]:::utils
    end

    %% External Systems & Testing/Configuration
    subgraph "External & Testing"
        Supabase["Supabase"]:::external
        TestingSuite["Testing Suite"]:::testing
        VitestConfig["Vitest Config"]:::config
        VitestTS["Vitest TS Config"]:::config
    end

    %% Connections within UI Layer
    UI_Main -->|"bootstraps"| UI_App
    UI_App -->|"loads"| UI_Router
    UI_App -->|"initProviders"| UI_Providers
    UI_Router -->|"navigates"| UI_Views
    UI_Views -->|"triggers"| UI_Providers

    %% UI to Domain interactions
    UI_Providers -->|"calls"| Domain_QuizServices

    %% Domain Layer composition
    Domain -->|"includes"| Domain_QuizModels
    Domain -->|"includes"| Domain_Avatar
    Domain -->|"includes"| Domain_QuizServices
    Domain -->|"includes"| Domain_Utils

    %% Domain Services interactions
    Domain_QuizServices -->|"integrates"| Supabase
    Domain_QuizServices -->|"uses"| Domain_Utils

    %% Testing and Configuration interactions
    TestingSuite -->|"tests"| UI_App
    TestingSuite -->|"tests"| Domain_QuizServices
    VitestConfig -->|"configures"| TestingSuite

    %% Click Events for UI Components
    click UI_Main "https://github.com/axelrizo/supahoot/blob/master/src/lib/supahoot-web/main.ts"
    click UI_App "https://github.com/axelrizo/supahoot/blob/master/src/lib/supahoot-web/App.vue"
    click UI_Router "https://github.com/axelrizo/supahoot/blob/master/src/lib/supahoot-web/router/index.ts"
    click UI_Providers "https://github.com/axelrizo/supahoot/tree/master/src/lib/supahoot-web/providers"
    click UI_Views "https://github.com/axelrizo/supahoot/tree/master/src/lib/supahoot-web/views"

    %% Click Events for Domain Components
    click Domain "https://github.com/axelrizo/supahoot/tree/master/src/lib/supahoot"
    click Domain_QuizModels "https://github.com/axelrizo/supahoot/tree/master/src/lib/supahoot/quizzes"
    click Domain_Avatar "https://github.com/axelrizo/supahoot/blob/master/src/lib/supahoot/services/avatar-services/dicebear-avatar.service.ts"
    click Domain_QuizServices "https://github.com/axelrizo/supahoot/blob/master/src/lib/supahoot/services/quiz-services/supabase-quiz.service.ts"
    click Domain_Utils "https://github.com/axelrizo/supahoot/blob/master/src/lib/supahoot/utils/file.utils.ts"

    %% Click Events for Testing/Configuration Components
    click TestingSuite "https://github.com/axelrizo/supahoot/tree/master/src/test"
    click VitestConfig "https://github.com/axelrizo/supahoot/blob/master/vitest.config.ts"
    click VitestTS "https://github.com/axelrizo/supahoot/blob/master/tsconfig.vitest.json"

    %% Class Definitions for Styling
    classDef ui fill:#AED6F1,stroke:#3498DB,stroke-width:2px;
    classDef domain fill:#ABEBC6,stroke:#27AE60,stroke-width:2px;
    classDef utils fill:#F9E79F,stroke:#F1C40F,stroke-width:2px;
    classDef external fill:#F5B7B1,stroke:#E74C3C,stroke-width:2px;
    classDef testing fill:#D2B4DE,stroke:#8E44AD,stroke-width:2px;
    classDef config fill:#D6EAF8,stroke:#2980B9,stroke-width:2px;
```
