# kinddersonne/workgen architecture

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

- Interactive diagram: https://gitdiagram.com/kinddersonne/workgen
- Repository: https://github.com/kinddersonne/workgen

## Overview

##### Project type and purpose
- This is a front-end single-page application (SPA) built with Vite, React and TypeScript.
- It provides a project and task management UI (Kanban board, stats, calendar, etc.).
- Styling and components are powered by Tailwind CSS and shadcn-ui.

##### File structure
- Top level: package.json, Vite & TypeScript configs, public/ for static assets, src/ for all source code.
- src/main.tsx & index.html: application entry point.
- src/components: reusable UI pieces (Layout, Sidebar, KanbanBoard, TaskCard, etc.) plus a full subfolder of low-level shadcn-ui building blocks.
- src/pages: route-level components (Dashboard, Projects, Tasks, Calendar, Login, Register, etc.).
- src/contexts: React Contexts (AuthContext for authentication state, DataContext for fetching & caching app data).
- src/hooks: custom hooks (use-mobile, use-toast).
- src/lib/utils.ts: shared utility functions.
- tsconfig*, vite.config.ts, postcss.config.js, tailwind.config.ts: build and toolchain configuration.

##### README for additional insights
- Confirms tech stack (Vite, TypeScript, React, shadcn-ui, Tailwind).
- Hosted and auto-deployed by Lovable.
- No backend code in repo: data comes from an external API (Lovable or custom), managed via DataContext.

##### Essential architectural elements
- Related components visually (e.g., all shadcn-ui primitives in one cluster).
- Vite build pipeline and Lovable deployment as separate infrastructure steps.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Developer & CI/CD
    subgraph "Developer & CI/CD"
        IDE["Developer IDE"]:::orange
        GitHub["GitHub Repo"]:::orange
        LovableCI["Lovable CI/CD"]:::orange
    end

    %% Infrastructure
    subgraph "Build & Hosting Infrastructure"
        ViteDev["Vite Dev Server"]:::blue
        ViteBuild["Vite Build"]:::blue
        CDN["Lovable CDN Hosting"]:::blue
    end

    %% Client Browser
    subgraph "Browser (Client)"
        subgraph "Entry Point"
            HTML["index.html"]:::green
            Main["src/main.tsx"]:::green
        end

        subgraph "UI Layer" 
            subgraph "Pages (Route-Level Components)"
                Index["Index.tsx"]:::green
                Dashboard["Dashboard.tsx"]:::green
                Projects["Projects.tsx"]:::green
                ProjectDetail["ProjectDetail.tsx"]:::green
                Tasks["Tasks.tsx"]:::green
                Calendar["Calendar.tsx"]:::green
                Reports["Reports.tsx"]:::green
                Team["Team.tsx"]:::green
                Settings["Settings.tsx"]:::green
                Login["Login.tsx"]:::green
                Register["Register.tsx"]:::green
                NotFound["NotFound.tsx"]:::green
            end
            subgraph "Reusable UI Components"
                Layout["Layout.tsx"]:::green
                Sidebar["Sidebar.tsx"]:::green
                KanbanBoard["KanbanBoard.tsx"]:::green
                TaskCard["TaskCard.tsx"]:::green
                StatsCard["StatsCard.tsx"]:::green
                TaskDetail["TaskDetail.tsx"]:::green
                TaskForm["TaskForm.tsx"]:::green
                ProjectForm["ProjectForm.tsx"]:::green
            end
            subgraph "UI Primitives (shadcn-ui)"
                UIPrims["src/components/ui"]:::green
            end
        end

        subgraph "State & Data Layer"
            AuthCtx["AuthContext.tsx"]:::purple
            DataCtx["DataContext.tsx"]:::purple
            MobileHook["use-mobile.tsx"]:::purple
            ToastHook["use-toast.tsx"]:::purple
        end

        Utils["src/lib/utils.ts"]:::purple
    end

    %% External Services
    ExternalAPI["External API (Auth/Data)"]:::gray

    %% Relationships - Code Flow
    IDE --> GitHub --> LovableCI
    LovableCI --> ViteBuild --> CDN
    GitHub --> ViteDev

    %% Relationships - Runtime Flow
    CDN --> HTML --> Main
    Main --> Index
    Main --> Dashboard
    Main --> Projects
    Main --> ProjectDetail
    Main --> Tasks
    Main --> Calendar
    Main --> Reports
    Main --> Team
    Main --> Settings
    Main --> Login
    Main --> Register
    Main --> NotFound

    %% Page to Components and State
    Index --> Layout
    Dashboard --> Sidebar
    Projects --> KanbanBoard
    KanbanBoard --> TaskCard
    TaskCard --> StatsCard
    ProjectDetail --> TaskDetail
    TaskDetail --> TaskForm
    Projects --> ProjectForm

    %% Data Flow through Contexts
    Dashboard --> AuthCtx --> ExternalAPI --> DataCtx --> StatsCard
    KanbanBoard --> DataCtx
    TaskForm --> DataCtx
    ProjectForm --> DataCtx
    Login --> AuthCtx
    Register --> AuthCtx

    %% Hooks and Utils usage
    AuthCtx --> MobileHook
    DataCtx --> ToastHook
    Layout --> Utils
    Sidebar --> Utils

    %% Click Events
    click HTML "https://github.com/kinddersonne/workgen/blob/main/index.html"
    click Main "https://github.com/kinddersonne/workgen/blob/main/src/main.tsx"
    click Index "https://github.com/kinddersonne/workgen/blob/main/src/pages/Index.tsx"
    click Dashboard "https://github.com/kinddersonne/workgen/blob/main/src/pages/Dashboard.tsx"
    click Projects "https://github.com/kinddersonne/workgen/blob/main/src/pages/Projects.tsx"
    click ProjectDetail "https://github.com/kinddersonne/workgen/blob/main/src/pages/ProjectDetail.tsx"
    click Tasks "https://github.com/kinddersonne/workgen/blob/main/src/pages/Tasks.tsx"
    click Calendar "https://github.com/kinddersonne/workgen/blob/main/src/pages/Calendar.tsx"
    click Reports "https://github.com/kinddersonne/workgen/blob/main/src/pages/Reports.tsx"
    click Team "https://github.com/kinddersonne/workgen/blob/main/src/pages/Team.tsx"
    click Settings "https://github.com/kinddersonne/workgen/blob/main/src/pages/Settings.tsx"
    click Login "https://github.com/kinddersonne/workgen/blob/main/src/pages/Login.tsx"
    click Register "https://github.com/kinddersonne/workgen/blob/main/src/pages/Register.tsx"
    click NotFound "https://github.com/kinddersonne/workgen/blob/main/src/pages/NotFound.tsx"
    click Layout "https://github.com/kinddersonne/workgen/blob/main/src/components/Layout.tsx"
    click Sidebar "https://github.com/kinddersonne/workgen/blob/main/src/components/Sidebar.tsx"
    click KanbanBoard "https://github.com/kinddersonne/workgen/blob/main/src/components/KanbanBoard.tsx"
    click TaskCard "https://github.com/kinddersonne/workgen/blob/main/src/components/TaskCard.tsx"
    click StatsCard "https://github.com/kinddersonne/workgen/blob/main/src/components/StatsCard.tsx"
    click TaskDetail "https://github.com/kinddersonne/workgen/blob/main/src/components/TaskDetail.tsx"
    click TaskForm "https://github.com/kinddersonne/workgen/blob/main/src/components/TaskForm.tsx"
    click ProjectForm "https://github.com/kinddersonne/workgen/blob/main/src/components/ProjectForm.tsx"
    click UIPrims "https://github.com/kinddersonne/workgen/tree/main/src/components/ui"
    click AuthCtx "https://github.com/kinddersonne/workgen/blob/main/src/contexts/AuthContext.tsx"
    click DataCtx "https://github.com/kinddersonne/workgen/blob/main/src/contexts/DataContext.tsx"
    click MobileHook "https://github.com/kinddersonne/workgen/blob/main/src/hooks/use-mobile.tsx"
    click ToastHook "https://github.com/kinddersonne/workgen/blob/main/src/hooks/use-toast.tsx"
    click Utils "https://github.com/kinddersonne/workgen/blob/main/src/lib/utils.ts"

    %% Styles
    classDef orange fill:#f96,stroke:#333,color:#000
    classDef blue fill:#6cf,stroke:#333,color:#000
    classDef green fill:#9f6,stroke:#333,color:#000
    classDef purple fill:#c6f,stroke:#333,color:#000
    classDef gray fill:#ccc,stroke:#333,color:#000
```
