# editm07/academo-track architecture

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

- Interactive diagram: https://gitdiagram.com/editm07/academo-track
- Repository: https://github.com/editm07/academo-track

## Overview

##### Project type and purpose
- This is a Single-Page Application (SPA) built with Vite, TypeScript, React, Tailwind CSS and the shadcn-ui component library.
- It uses Supabase as a Backend-as-a-Service (BaaS) for authentication, database and migrations.
- From the pages (Attendance, Grades, Reports, Students, Subjects, Dashboard, Auth) it appears to be a school-management dashboard.

##### File structure
- Top-level:
- config files for Vite, Tailwind, TypeScript, ESLint
- supabase/ (config.toml + SQL migrations)
- public/ (static assets, robots.txt)
- src/:
- App.tsx + main.tsx entrypoints
- pages/ (route components)
- components/ (AppSidebar, ProtectedRoute, plus a full shadcn-ui UI library under components/ui/)
- hooks/ (custom React hooks like use-mobile, use-toast)
- integrations/supabase (client setup, type definitions)
- lib/utils.ts (shared helpers)
- No custom backend code—Supabase handles auth, DB and migrations.

##### README for additional insights
- Confirms stack: Vite, TS, React, shadcn-ui, Tailwind.
- Deployment managed by Lovable (a platform which automatically builds & publishes the Vite app).
- Supabase migrations live in the repo, so infra is versioned alongside the frontend.

##### Main components & interactions
a. Components:
1. Developer Environment (IDE, Git CLI)
2. Source Code Repository (GitHub or Lovable’s Git)
3. CI/CD / Build & Deploy (Lovable Platform)
4. Static Hosting CDN (Lovable’s hosting or equivalent)
5. Browser / Client Device
6. React SPA (bundles loaded into browser)
– Presentation Layer: shadcn-ui + Tailwind CSS
– Routing Layer: React Router or ProtectedRoute
– View Layer: pages/* components
– Shared Components & Hooks: src/components, src/hooks
7. Supabase BaaS:
– Auth service
– Postgres database
– Migrations (from supabase/migrations)
– API endpoints (REST / Realtime / GraphQL)
b. Data flows & relationships:
- Developer → commits → Repo
- Repo → triggers → Lovable CI/CD → builds → publishes static assets to CDN
- Browser → GET index.html & JS/CSS bundles from CDN
- React SPA → internal routing → renders pages & UI components
- React SPA → Supabase client → Auth API (login, tokens)
- React SPA → Supabase client → Database queries (CRUD for attendance, grades, etc.)
- Supabase → responses → React SPA
c. Architectural patterns / design principles:
– SPA architecture with client-side routing
– Component-based design (shadcn-ui library + custom UI components)
– Hooks for cross-cutting concerns (mobile detection, toast notifications)
– BaaS integration (no custom backend code)
– Versioned database migrations alongside front-end code
d. Key technologies / frameworks:
– Vite (build & dev server)
– React + React Router
– TypeScript
– Tailwind CSS + shadcn-ui
– Supabase (Auth, Postgres, Migrations)
– Lovable platform (CI/CD, hosting)

##### Essential architectural elements
- Pipeline from code→deploy to runtime.
- That all backend interactions go through Supabase’s client SDK.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Development Pipeline
    subgraph "Development Pipeline"
        direction TB
        Dev["Developer Environment (IDE, Git CLI)"]:::dev
        Repo["Source Code Repository"]:::repo
        CICD["CI/CD Build & Deploy (Lovable)"]:::pipeline
        Hosting["Static Hosting CDN"]:::host
    end

    Dev -->|commits| Repo
    Repo -->|triggers| CICD
    CICD -->|publishes assets| Hosting

    %% Client Runtime
    subgraph "Client Runtime"
        direction TB
        Browser["Browser / Client Device"]:::client
        SPA["React SPA"]:::frontend

        subgraph "React SPA Internal Layers"
            direction TB
            Presentation["Presentation Layer\n(Tailwind CSS & shadcn-ui)"]:::frontend
            Routing["Routing Layer\n(ProtectedRoute & React Router)"]:::frontend
            Views["View Layer (Pages)"]:::frontend
            Shared["Shared Components & Hooks"]:::frontend
            Utils["Utility Library"]:::frontend
            SupabaseClient["Supabase Client SDK"]:::frontend
        end

        Browser -->|GET assets| Hosting
        Browser --> SPA
        SPA --> Presentation
        SPA --> Routing
        SPA --> Views
        SPA --> Shared
        SPA --> Utils
        SPA --> SupabaseClient
    end

    %% Supabase BaaS
    subgraph "Supabase BaaS" 
        direction TB
        Auth["Supabase Auth Service"]:::cloud
        DB["Postgres Database"]:::db
        Migrations["Migrations (supabase/migrations)"]:::cloud
    end

    SupabaseClient -->|HTTPS| Auth
    SupabaseClient -->|CRUD queries| DB
    Migrations --> DB

    Auth -->|tokens| SPA
    DB -->|responses| SPA

    %% Click Events
    click Dev "https://github.com/editm07/academo-track/tree/main/n/a"
    click Repo "https://github.com/editm07/academo-track/tree/main/n/a"
    click CICD "https://github.com/editm07/academo-track/tree/main/n/a"
    click Hosting "https://github.com/editm07/academo-track/tree/main/public/"
    click SPA "https://github.com/editm07/academo-track/blob/main/src/App.tsx"
    click Presentation "https://github.com/editm07/academo-track/blob/main/tailwind.config.ts"
    click Presentation "https://github.com/editm07/academo-track/blob/main/postcss.config.js"
    click Presentation "https://github.com/editm07/academo-track/blob/main/src/index.css"
    click Presentation "https://github.com/editm07/academo-track/tree/main/src/components/ui/"
    click Routing "https://github.com/editm07/academo-track/blob/main/src/components/ProtectedRoute.tsx"
    click Routing "https://github.com/editm07/academo-track/blob/main/src/App.tsx"
    click Views "https://github.com/editm07/academo-track/blob/main/src/pages/Dashboard.tsx"
    click Views "https://github.com/editm07/academo-track/blob/main/src/pages/Attendance.tsx"
    click Views "https://github.com/editm07/academo-track/blob/main/src/pages/Grades.tsx"
    click Views "https://github.com/editm07/academo-track/blob/main/src/pages/Reports.tsx"
    click Views "https://github.com/editm07/academo-track/blob/main/src/pages/Students.tsx"
    click Views "https://github.com/editm07/academo-track/blob/main/src/pages/Subjects.tsx"
    click Views "https://github.com/editm07/academo-track/blob/main/src/pages/Auth.tsx"
    click Views "https://github.com/editm07/academo-track/blob/main/src/pages/Index.tsx"
    click Views "https://github.com/editm07/academo-track/blob/main/src/pages/NotFound.tsx"
    click Shared "https://github.com/editm07/academo-track/blob/main/src/components/AppSidebar.tsx"
    click Shared "https://github.com/editm07/academo-track/blob/main/src/hooks/use-mobile.tsx"
    click Shared "https://github.com/editm07/academo-track/blob/main/src/hooks/use-toast.ts"
    click SupabaseClient "https://github.com/editm07/academo-track/blob/main/src/integrations/supabase/client.ts"
    click SupabaseClient "https://github.com/editm07/academo-track/blob/main/src/integrations/supabase/types.ts"
    click Migrations "https://github.com/editm07/academo-track/blob/main/supabase/migrations/20251014210402_15b6d7c8-91c0-4ce7-afc8-73608beed985.sql"
    click Migrations "https://github.com/editm07/academo-track/blob/main/supabase/config.toml"
    click Repo "https://github.com/editm07/academo-track/blob/main/README.md"
    click Repo "https://github.com/editm07/academo-track/blob/main/.gitignore"
    click Repo "https://github.com/editm07/academo-track/blob/main/vite.config.ts"
    click Repo "https://github.com/editm07/academo-track/blob/main/tsconfig.json"
    click Repo "https://github.com/editm07/academo-track/blob/main/tsconfig.app.json"
    click Repo "https://github.com/editm07/academo-track/blob/main/tsconfig.node.json"
    click Repo "https://github.com/editm07/academo-track/blob/main/eslint.config.js"
    click Repo "https://github.com/editm07/academo-track/blob/main/package.json"
    click Repo "https://github.com/editm07/academo-track/blob/main/package-lock.json"
    click Repo "https://github.com/editm07/academo-track/blob/main/bun.lockb"
    click Utils "https://github.com/editm07/academo-track/blob/main/src/lib/utils.ts"

    %% Styles
    classDef dev fill:#f9f,stroke:#333,stroke-width:1px
    classDef repo fill:#ccf,stroke:#333,stroke-width:1px
    classDef pipeline fill:#fcf,stroke:#333,stroke-width:1px
    classDef host fill:#ccc,stroke:#333,stroke-width:1px
    classDef client fill:#eef,stroke:#333,stroke-width:1px
    classDef frontend fill:#bbf,stroke:#333,stroke-width:1px
    classDef cloud fill:#dba,stroke:#333,stroke-width:1px
    classDef db fill:#bdf,stroke:#333,stroke-width:1px
```
