# krutika9021/dyslexia architecture

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

- Interactive diagram: https://gitdiagram.com/krutika9021/dyslexia
- Repository: https://github.com/krutika9021/dyslexia

## Overview

##### Project type and purpose
- This is a single-page full-stack educational game application built with React (TypeScript) that uses Supabase for authentication and as its primary backend. The app provides different game modules (letter sequencing, reading comprehension, word recognition) and dashboards for users and admins.

##### File structure
- Top-level:
- public/ & index.html – static assets and HTML entrypoint
- src/ – application source code
– components/ – UI broken down by domain (auth, dashboard, games, admin) and generic UI primitives
– pages/ – route targets (Index, NotFound)
– hooks/ – shared hooks (useAuth, useMobile, useToast)
– integrations/supabase/ – supabase client and types
– lib/utils.ts – helper functions
– main.tsx + App.tsx – application bootstrap and root component
– supabase/ – db config and migrations
- config files – tailwind.config.ts, vite.config.ts, tsconfig*.json, eslint.config.js

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% User Roles
    subgraph "Users"
        direction TB
        Student["Student"]:::user
        Admin["Admin"]:::user
    end

    %% React SPA Layer
    subgraph "React SPA" 
        direction TB
        App["App.tsx"]:::frontend
        IndexPage["Index.tsx"]:::frontend
        NotFoundPage["NotFound.tsx"]:::frontend
        subgraph "Auth Components"
            direction TB
            AuthPage["AuthPage.tsx"]:::frontend
            LoginForm["LoginForm.tsx"]:::frontend
            RegisterForm["RegisterForm.tsx"]:::frontend
        end
        subgraph "Dashboard Components"
            direction TB
            GameDashboard["GameDashboard.tsx"]:::frontend
            AdminDashboard["AdminDashboard.tsx"]:::frontend
        end
        subgraph "Game Modules"
            direction TB
            LetterSeq["LetterSequencingGame.tsx"]:::frontend
            ReadingComp["ReadingComprehensionGame.tsx"]:::frontend
            WordRecog["WordRecognitionGame.tsx"]:::frontend
        end
        subgraph "UI Primitives"
            direction TB
            UIPrims["src/components/ui/"]:::frontend
        end
        subgraph "Hooks & Utils"
            direction TB
            UseAuth["useAuth.tsx"]:::frontend
            UseMobile["use-mobile.tsx"]:::frontend
            UseToast["use-toast.ts"]:::frontend
            Utils["utils.ts"]:::frontend
        end
        subgraph "Routing & Entry"
            direction TB
            HTML["index.html"]:::frontend
            MainTSX["main.tsx"]:::frontend
        end
        subgraph "Integration Layer"
            direction TB
            SupabaseClient["client.ts"]:::integration
            SupabaseTypes["types.ts"]:::integration
        end
    end

    %% Supabase Backend
    subgraph "Supabase Backend" 
        direction TB
        AuthService["Auth Service"]:::integration
        DB[(PostgreSQL DB)]:::db
        subgraph "Migrations"
            direction TB
            Config["config.toml"]:::integration
            Mig1["20250609191012-...sql"]:::integration
            Mig2["20250610192748-...sql"]:::integration
        end
    end

    %% CI/CD & Hosting
    subgraph "Infrastructure"
        direction TB
        CICD["CI/CD Pipeline"]:::infra
        Build["Vite Build"]:::infra
        Hosting["Hosting/CDN"]:::infra
    end

    %% Connections
    Student -->|"uses"| App
    Admin -->|"uses"| App
    HTML -->|loads| MainTSX
    MainTSX -->|renders| App
    App -->|routes| IndexPage
    App -->|routes| NotFoundPage
    IndexPage -->|navigates to| AuthPage
    IndexPage -->|navigates to| GameDashboard
    IndexPage -->|navigates to| AdminDashboard
    AuthPage -->|contains| LoginForm
    AuthPage -->|contains| RegisterForm
    GameDashboard -->|launches| LetterSeq
    GameDashboard -->|launches| ReadingComp
    GameDashboard -->|launches| WordRecog
    App -->|uses| UIPrims
    App -->|uses| UseAuth
    App -->|uses| UseMobile
    App -->|uses| UseToast
    App -->|uses| Utils
    App -->|calls| SupabaseClient
    SupabaseClient -->|RPC/HTTP| AuthService
    SupabaseClient -->|RPC/HTTP| DB
    Config -->|manages| DB
    Mig1 -->|applies| DB
    Mig2 -->|applies| DB
    CICD -->|triggers| Build
    Build -->|deploys| Hosting

    %% Click Events
    click HTML "https://github.com/krutika9021/dyslexia/blob/main/public/index.html"
    click MainTSX "https://github.com/krutika9021/dyslexia/blob/main/src/main.tsx"
    click App "https://github.com/krutika9021/dyslexia/blob/main/src/App.tsx"
    click AuthPage "https://github.com/krutika9021/dyslexia/blob/main/src/components/auth/AuthPage.tsx"
    click LoginForm "https://github.com/krutika9021/dyslexia/blob/main/src/components/auth/LoginForm.tsx"
    click RegisterForm "https://github.com/krutika9021/dyslexia/blob/main/src/components/auth/RegisterForm.tsx"
    click GameDashboard "https://github.com/krutika9021/dyslexia/blob/main/src/components/dashboard/GameDashboard.tsx"
    click AdminDashboard "https://github.com/krutika9021/dyslexia/blob/main/src/components/admin/AdminDashboard.tsx"
    click LetterSeq "https://github.com/krutika9021/dyslexia/blob/main/src/components/games/LetterSequencingGame.tsx"
    click ReadingComp "https://github.com/krutika9021/dyslexia/blob/main/src/components/games/ReadingComprehensionGame.tsx"
    click WordRecog "https://github.com/krutika9021/dyslexia/blob/main/src/components/games/WordRecognitionGame.tsx"
    click UIPrims "https://github.com/krutika9021/dyslexia/tree/main/src/components/ui/"
    click IndexPage "https://github.com/krutika9021/dyslexia/blob/main/src/pages/Index.tsx"
    click NotFoundPage "https://github.com/krutika9021/dyslexia/blob/main/src/pages/NotFound.tsx"
    click UseAuth "https://github.com/krutika9021/dyslexia/blob/main/src/hooks/useAuth.tsx"
    click UseMobile "https://github.com/krutika9021/dyslexia/blob/main/src/hooks/use-mobile.tsx"
    click UseToast "https://github.com/krutika9021/dyslexia/blob/main/src/hooks/use-toast.ts"
    click SupabaseClient "https://github.com/krutika9021/dyslexia/blob/main/src/integrations/supabase/client.ts"
    click SupabaseTypes "https://github.com/krutika9021/dyslexia/blob/main/src/integrations/supabase/types.ts"
    click Utils "https://github.com/krutika9021/dyslexia/blob/main/src/lib/utils.ts"
    click Config "https://github.com/krutika9021/dyslexia/blob/main/src/supabase/config.toml"
    click Mig1 "https://github.com/krutika9021/dyslexia/blob/main/src/supabase/migrations/20250609191012-a276fc29-0975-414f-a407-814b17babf4a.sql"
    click Mig2 "https://github.com/krutika9021/dyslexia/blob/main/src/supabase/migrations/20250610192748-775ad34e-d2e4-4f62-98e3-42517d9d4bbc.sql"
    click CICD "https://github.com/krutika9021/dyslexia/blob/main/vite.config.ts"
    click CICD "https://github.com/krutika9021/dyslexia/blob/main/tailwind.config.ts"
    click CICD "https://github.com/krutika9021/dyslexia/blob/main/postcss.config.js"
    click CICD "https://github.com/krutika9021/dyslexia/blob/main/tsconfig.json"
    click CICD "https://github.com/krutika9021/dyslexia/blob/main/tsconfig.app.json"
    click CICD "https://github.com/krutika9021/dyslexia/blob/main/tsconfig.node.json"
    click CICD "https://github.com/krutika9021/dyslexia/blob/main/eslint.config.js"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#333,stroke-width:1px
    classDef integration fill:#D2F8D2,stroke:#333,stroke-width:1px
    classDef infra fill:#E0E0E0,stroke:#333,stroke-width:1px
    classDef db fill:#FFF0B3,stroke:#333,stroke-width:1px
    classDef user fill:#FDE2E4,stroke:#333,stroke-width:1px
```
