# rahidmondal/t8d architecture

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

- Interactive diagram: https://gitdiagram.com/rahidmondal/t8d
- Repository: https://github.com/rahidmondal/t8d

## Overview

##### Project type and purpose
- From the file tree and README, T8D is a monorepo full-stack “offline-first” to-do list application.
- Frontend: React + TypeScript + Vite + Tailwind CSS, built as a PWA.
- Backend: Node.js/TypeScript sync server & API.
- Monorepo uses pnpm workspaces, Docker for production, GitHub Pages for frontend hosting.

##### File structure
- Top level:
- backend/ – Node API + sync server (package.json, tsconfig.node.json).
- frontend/ – React client (src/, public/, config, tests).
- docker-compose.prod.yml, monorepo config (pnpm-workspace.yaml, tsconfig.json).
- frontend/src organizes components (TodoList, Form, ThemeContext, etc.), models (Task, TaskList), utils (database adapter + todo logic).
- Tests folder parallels src for unit/integration tests.
- Dockerfiles & Caddyfile in frontend indicate containerized, static-server deployment.
- Workflow docs describe branching, CI/CD, release.

##### README for additional insights
- Emphasizes offline-first feature and private task management.
- Lists tech stack & deployment targets (Docker, GitHub Pages).
- Monorepo structure synopsis confirms clear frontend ↔ backend split.

##### Essential architectural elements
- Don’t just show “frontend” and “backend”—break out local DB, service worker, sync module, and persistent DB.
- Build/deployment artifacts only if the audience cares about ops; otherwise focus on runtime.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Layer
    Browser["User Browser"]:::external

    %% Frontend Layer
    subgraph "Frontend (PWA)" 
        direction TB
        Main["PWA Entry (main.tsx)"]:::frontend
        Root["Root Component (App.tsx)"]:::frontend
        UI["React UI Components"]:::frontend
        CSS["Global Styles (index.css)"]:::frontend
        TailwindCfg["Tailwind Config"]:::frontend
        SW["Service Worker & Assets"]:::frontend
        DBAdapter["IndexedDB Adapter"]:::frontend
        TodoLogic["Todo & Sync Logic"]:::frontend
        TaskModel["Task Model"]:::frontend
        ListModel["TaskList Model"]:::frontend
        Tests["Frontend Tests"]:::frontend
    end

    %% Backend Layer
    subgraph "Backend"
        direction TB
        APIServer["Sync & API Server"]:::backend
        Database["Persistent DB"]:::backend
    end

    %% Infrastructure Layer
    subgraph "Infrastructure"
        direction TB
        MonorepoCfg["Monorepo & TS Config"]:::infra
        DockerCompose["Docker Compose"]:::infra
        CICD["CI/CD Pipeline"]:::infra
        DockerRegistry["Docker Registry / GitHub Pages"]:::infra
        subgraph "Frontend Deployment"
            direction TB
            Dockerfile["Dockerfile"]:::infra
            Caddyfile["Caddyfile"]:::infra
            DockerIgnore[".dockerignore"]:::infra
        end
    end

    %% Connections
    Browser --> UI
    UI --> DBAdapter
    UI --> TodoLogic
    TodoLogic --> DBAdapter
    TodoLogic --> APIServer
    APIServer --> Database

    MonorepoCfg --> DockerCompose
    DockerCompose --> APIServer
    DockerCompose --> DockerRegistry
    CICD --> DockerCompose
    CICD --> DockerRegistry

    %% Click Events
    click Main "https://github.com/rahidmondal/t8d/blob/main/frontend/src/main.tsx"
    click Root "https://github.com/rahidmondal/t8d/blob/main/frontend/src/App.tsx"
    click UI "https://github.com/rahidmondal/t8d/tree/main/frontend/src/components"
    click CSS "https://github.com/rahidmondal/t8d/blob/main/frontend/src/index.css"
    click TailwindCfg "https://github.com/rahidmondal/t8d/blob/main/frontend/tailwind.config.js"
    click SW "https://github.com/rahidmondal/t8d/tree/main/frontend/public"
    click DBAdapter "https://github.com/rahidmondal/t8d/blob/main/frontend/src/utils/database/database.ts"
    click TodoLogic "https://github.com/rahidmondal/t8d/blob/main/frontend/src/utils/todo/todo.ts"
    click TaskModel "https://github.com/rahidmondal/t8d/blob/main/frontend/src/models/Task.ts"
    click ListModel "https://github.com/rahidmondal/t8d/blob/main/frontend/src/models/TaskList.ts"
    click Tests "https://github.com/rahidmondal/t8d/tree/main/frontend/tests"
    click APIServer "https://github.com/rahidmondal/t8d/tree/main/backend"
    click BackendPkg "https://github.com/rahidmondal/t8d/blob/main/backend/package.json"
    click BackendTS "https://github.com/rahidmondal/t8d/blob/main/backend/tsconfig.node.json"
    click DockerCompose "https://github.com/rahidmondal/t8d/blob/main/docker-compose.prod.yml"
    click MonorepoCfg "https://github.com/rahidmondal/t8d/blob/main/pnpm-workspace.yaml"
    click RootTS "https://github.com/rahidmondal/t8d/blob/main/tsconfig.json"
    click README "https://github.com/rahidmondal/t8d/blob/main/README.md"
    click Workflow "https://github.com/rahidmondal/t8d/blob/main/WORKFLOW.md"
    click Dockerfile "https://github.com/rahidmondal/t8d/tree/main/frontend/Dockerfile"
    click Caddyfile "https://github.com/rahidmondal/t8d/tree/main/frontend/Caddyfile"
    click DockerIgnore "https://github.com/rahidmondal/t8d/blob/main/frontend/.dockerignore"

    %% Styles
    classDef frontend fill:#e0ffe0,stroke:#0a0,stroke-width:1px
    classDef backend fill:#e0f0ff,stroke:#00a,stroke-width:1px
    classDef infra fill:#f0f0f0,stroke:#666,stroke-width:1px
    classDef external fill:#fff0f0,stroke:#a00,stroke-width:1px
```
