# arihantjain04/tidlr architecture

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

- Interactive diagram: https://gitdiagram.com/arihantjain04/tidlr
- Repository: https://github.com/arihantjain04/tidlr

## Overview

##### Project type and purpose
- This is a single-page application (SPA) built with React, Vite, and TypeScript.
- Purpose: A frontend client for “Lovable” that renders course pages, handles authentication, and interacts with Supabase for data and auth services.
- Key indicators:
- Vite/Vite config, React/TSX files, Tailwind + shadcn-ui components.
- Supabase integration folder and config.toml.

##### File structure
Top-level:
- public/ – static assets (HTML template, favicon, robots.txt, sitemap).
- src/ – all application code:
– main.tsx, index.css, App.tsx – entry point and global styles.
– components/ – reusable UI pieces and shadcn-ui primitives.
– pages/ – route targets: Index, Auth, Dashboard, Course, AdminPanel, etc.
– hooks/ – custom React hooks (useAuth, useMobile, useToast).
– integrations/supabase – supabase client and types.
– lib/utils.ts – shared utilities.
- supabase/ – local supabase CLI config & temporary files.
- config files – tsconfig, vite.config.ts, tailwind.config.ts, vercel.json, urls.json.

Architectural patterns:
- Component-based UI layer (React + shadcn-ui).
- Page routing (likely React Router) with ProtectedRoute wrapper.
- Service integration layer for Supabase (client.ts).
- Tailwind CSS for styling.
- Hosted/deployed via Vercel (vercel.json) with CI via Lovable.

##### README for additional insights
- Tech stack: Vite, TypeScript, React, shadcn-ui, Tailwind.
- Deployment: Lovable → Share → Publish, supports custom domains.
- Development: standard npm workflow.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Browser
    subgraph "Client Browser"
        subgraph "Static Assets"
            HTML["index.html"]:::frontend
            PublicAssets["public/"]:::frontend
            HTML---|loads| Main["main.tsx"]:::frontend
        end
        subgraph "React SPA"
            Main-->App["App.tsx"]:::frontend
            subgraph "UI Layer"
                subgraph "Pages"
                    IndexPage["Home"]:::frontend
                    AuthPage["Auth"]:::frontend
                    DashboardPage["Dashboard"]:::frontend
                    CoursePage["Course"]:::frontend
                    AdminPage["AdminPanel"]:::frontend
                    OtherPages["Other Pages"]:::frontend
                end
                subgraph "Components"
                    UIComponents["UI Components"]:::frontend
                    Protected["ProtectedRoute"]:::frontend
                end
                UIPrimitives["UI Primitives"]:::frontend
            end
            subgraph "Routing & State"
                HooksAuth["useAuth"]:::hooks
                HooksMobile["useMobile"]:::hooks
                HooksToast["useToast"]:::hooks
            end
            subgraph "Service Integration"
                SupabaseClient["Supabase Client"]:::service
                SupabaseTypes["Supabase Types"]:::service
                Utils["Utils"]:::service
            end
            subgraph "Global Styles"
                AppCSS["App.css"]:::frontend
                IndexCSS["index.css"]:::frontend
                LoaderCSS["Loader.module.css"]:::frontend
            end
            App-->IndexPage
            App-->AuthPage
            App-->DashboardPage
            App-->CoursePage
            App-->AdminPage
            App-->OtherPages
            App-->UIComponents
            App-->Protected
            App-->UIPrimitives
            App-->HooksAuth
            App-->HooksMobile
            App-->HooksToast
            HooksAuth-->SupabaseClient
            HooksToast-->SupabaseClient
            SupabaseClient-->SupabaseTypes
            SupabaseClient-->Utils
        end
    end

    %% External Services
    subgraph "External Services"
        SupabaseAuth["Auth API"]:::external
        SupabaseDB["PostgreSQL DB"]:::db
        SupabaseStorage["Storage"]:::external
        SupabaseClient-->SupabaseAuth
        SupabaseClient-->SupabaseDB
        SupabaseClient-->SupabaseStorage
    end

    %% Build & Deploy Pipeline
    subgraph "Build & Deploy Pipeline"
        Repo["Git Repo"]:::pipeline
        CI["Lovable CI"]:::pipeline
        Vite["Vite Build"]:::pipeline
        Vercel["Vercel Hosting"]:::pipeline
        CDN["CDN"]:::external
        Repo-->CI-->Vite-->Vercel-->CDN-->HTML
    end

    %% Configuration
    subgraph "Configuration"
        ViteConfig["vite.config.ts"]:::config
        TailwindConfig["tailwind.config.ts"]:::config
        TSConfig["tsconfig.json"]:::config
        TSApp["tsconfig.app.json"]:::config
        TSNode["tsconfig.node.json"]:::config
        SupaConfig["supabase/config.toml"]:::config
        VercelConfig["vercel.json"]:::config
        URLs["urls.json"]:::config
    end

    %% Click Events
    click HTML "https://github.com/arihantjain04/tidlr/blob/main/public/index.html"
    click PublicAssets "https://github.com/arihantjain04/tidlr/tree/main/public"
    click Main "https://github.com/arihantjain04/tidlr/blob/main/src/main.tsx"
    click App "https://github.com/arihantjain04/tidlr/blob/main/src/App.tsx"
    click IndexPage "https://github.com/arihantjain04/tidlr/blob/main/src/pages/Index.tsx"
    click AuthPage "https://github.com/arihantjain04/tidlr/blob/main/src/pages/Auth.tsx"
    click DashboardPage "https://github.com/arihantjain04/tidlr/blob/main/src/pages/Dashboard.tsx"
    click CoursePage "https://github.com/arihantjain04/tidlr/blob/main/src/pages/Course.tsx"
    click AdminPage "https://github.com/arihantjain04/tidlr/blob/main/src/pages/AdminPanel.tsx"
    click OtherPages "https://github.com/arihantjain04/tidlr/tree/main/src/pages"
    click UIComponents "https://github.com/arihantjain04/tidlr/tree/main/src/components"
    click Protected "https://github.com/arihantjain04/tidlr/blob/main/src/components/ProtectedRoute.tsx"
    click UIPrimitives "https://github.com/arihantjain04/tidlr/tree/main/src/components/ui"
    click HooksAuth "https://github.com/arihantjain04/tidlr/blob/main/src/hooks/useAuth.tsx"
    click HooksMobile "https://github.com/arihantjain04/tidlr/blob/main/src/hooks/use-mobile.tsx"
    click HooksToast "https://github.com/arihantjain04/tidlr/blob/main/src/hooks/use-toast.ts"
    click SupabaseClient "https://github.com/arihantjain04/tidlr/blob/main/src/integrations/supabase/client.ts"
    click SupabaseTypes "https://github.com/arihantjain04/tidlr/blob/main/src/integrations/supabase/types.ts"
    click Utils "https://github.com/arihantjain04/tidlr/blob/main/src/lib/utils.ts"
    click AppCSS "https://github.com/arihantjain04/tidlr/blob/main/src/App.css"
    click IndexCSS "https://github.com/arihantjain04/tidlr/blob/main/src/index.css"
    click LoaderCSS "https://github.com/arihantjain04/tidlr/blob/main/src/pages/Loader.module.css"
    click Repo "https://github.com/arihantjain04/tidlr/blob/main/."
    click ViteConfig "https://github.com/arihantjain04/tidlr/blob/main/vite.config.ts"
    click TailwindConfig "https://github.com/arihantjain04/tidlr/blob/main/tailwind.config.ts"
    click TSConfig "https://github.com/arihantjain04/tidlr/blob/main/tsconfig.json"
    click TSApp "https://github.com/arihantjain04/tidlr/blob/main/tsconfig.app.json"
    click TSNode "https://github.com/arihantjain04/tidlr/blob/main/tsconfig.node.json"
    click SupaConfig "https://github.com/arihantjain04/tidlr/blob/main/supabase/config.toml"
    click VercelConfig "https://github.com/arihantjain04/tidlr/blob/main/vercel.json"
    click URLs "https://github.com/arihantjain04/tidlr/blob/main/urls.json"

    %% Styles
    classDef frontend fill:#D6E4FF,stroke:#3366CC,color:#000
    classDef hooks fill:#E6F4EA,stroke:#28A745,color:#000
    classDef service fill:#FFF4D6,stroke:#FFAF1D,color:#000
    classDef external fill:#F0E6FF,stroke:#9B59B6,color:#000
    classDef db fill:#FFE6E6,stroke:#CC3333,color:#000
    classDef pipeline fill:#E8E8E8,stroke:#444,color:#000
    classDef config fill:#F5F5F5,stroke:#666,color:#000
```
