# legion-0-1/to-do-ro architecture

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

- Interactive diagram: https://gitdiagram.com/legion-0-1/to-do-ro
- Repository: https://github.com/legion-0-1/to-do-ro

## Overview

##### Project type and purpose
- This is a single-page React application (built with Vite) that combines a Pomodoro timer and a To-Do list to boost productivity.
- There is no separate backend or database; the entire system runs in the browser and is served as static assets.

##### File structure
- Top-level files
- vite.config.js (build/dev server config)
- package.json, package-lock.json (dependencies & scripts)
- . gitignore, eslint.config.js (tooling)
- public/
- index.html (HTML shell)
- src/
- main.jsx (app entry point)
- App.jsx, App.css (root component)
- Button.jsx, Timer.jsx, toDo.jsx, Presets.jsx (feature components)
- index.css (global styles)

##### Extract insights from the README
- The app’s two core features are the Pomodoro timer and the To-Do list.
- Target use case: a self-contained productivity widget, deployed as static files.

##### Main components and interactions
a. Components
- Developer Machine – runs: Node.js + Vite CLI → dev server & build pipeline
- Vite Dev Server – bundles + serves on localhost during development
- Build Process – Vite compiles and bundles src/ → dist/
- Static Hosting – e.g., Netlify/GitHub Pages serves the dist/ folder
- Browser – fetches index.html and JS/CSS bundles
- React App (runtime component tree):
– App (root)
– Timer (Pomodoro UI & logic)
– toDo (list UI & logic)
– Presets (timer presets)
– Button (generic UI component)
- Browser APIs / Local Storage – optional persistence layer for tasks or timer state

b. Relationships & data flow
1. Developer triggers “npm run dev” → Vite Dev Server
2. Vite watches src/, compiles on change → serves bundles to Browser
3. “npm run build” → Vite outputs static assets to dist/
4. Hosting service serves index.html + static bundles
5. Browser loads index.html → main.jsx mounts React tree
6. App orchestrates state and passes props to Timer, toDo, Presets, Button
7. Components interact with each other via callbacks and state hooks
8. Optionally read/write to Local Storage for persistence

c. Architectural patterns & design principles
- Component-based UI (React)
- One entry point (main.jsx → App)
- Build-time bundling & code splitting (Vite)
- Separation of concerns: UI components vs. global styles vs. assets vs. config

d. Key technologies
- React (JSX components, hooks)
- Vite (dev server + bundler)
- Browser Web APIs (Local Storage)
- ESLint (code quality)
- CSS (global + component styles)

##### Details
- Be exhaustive: include every top-level directory/role (public/, src/, config files)
- Both the build pipeline and runtime component interactions
- Avoid over-abstraction—list out each React component and where it lives in src/

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Development Infrastructure
    subgraph "Development Environment"
        DevMachine["Developer Machine<br/>(Node.js + Vite CLI)"]:::infra
        ViteServer["Vite Dev Server"]:::infra
        BuildProcess["Vite Build Process<br/>(vite.config.js)"]:::infra
        PackageJSON["package.json<br/>&amp; scripts"]:::infra
        PackageLock["package-lock.json"]:::infra
        ESLintConfig["eslint.config.js"]:::infra
        GitIgnore[".gitignore"]:::infra
    end

    %% Static Hosting
    subgraph "Static Hosting" 
        Hosting["Netlify / GitHub Pages"]:::hosting
        PublicDir["public/"]:::hosting
    end

    %% Browser Runtime
    subgraph "Browser (Client Runtime)" 
        Browser["Web Browser"]:::runtime
        LocalStorage["Local Storage"]:::storage
        subgraph "React App" 
            MainEntry["main.jsx"]:::runtime
            AppComp["App"]:::runtime
            TimerComp["Timer"]:::runtime
            ToDoComp["toDo"]:::runtime
            PresetsComp["Presets"]:::runtime
            ButtonComp["Button"]:::runtime
            AssetsDir["assets/"]:::runtime
            GlobalStyles["index.css"]:::runtime
            AppStyles["App.css"]:::runtime
        end
    end

    %% Connections
    DevMachine -->|"npm run dev"| ViteServer
    ViteServer -->|"serves bundles"| Browser
    DevMachine -->|"npm run build"| BuildProcess
    BuildProcess -->|"outputs dist/ static assets"| Hosting
    Hosting -->|"GET /index.html + bundles"| Browser
    PublicDir --> Hosting
    Browser -->|"loads index.html"| MainEntry
    MainEntry -->|"mounts App()"| AppComp
    AppComp -->|"props/state"| TimerComp
    AppComp -->|"props/state"| ToDoComp
    AppComp -->|"props/state"| PresetsComp
    AppComp -->|"props/state"| ButtonComp
    TimerComp -->|"setItem(key,value)"| LocalStorage
    ToDoComp -->|"setItem(key,value)"| LocalStorage

    %% Click Events
    click BuildProcess "https://github.com/legion-0-1/to-do-ro/blob/main/To-Do-Ro/vite.config.js"
    click PackageJSON "https://github.com/legion-0-1/to-do-ro/blob/main/To-Do-Ro/package.json"
    click ESLintConfig "https://github.com/legion-0-1/to-do-ro/blob/main/To-Do-Ro/eslint.config.js"
    click PublicDir "https://github.com/legion-0-1/to-do-ro/tree/main/To-Do-Ro/public"
    click DevMachine "https://github.com/legion-0-1/to-do-ro/blob/main/To-Do-Ro/.gitignore"
    click PackageLock "https://github.com/legion-0-1/to-do-ro/blob/main/To-Do-Ro/package-lock.json"
    click MainEntry "https://github.com/legion-0-1/to-do-ro/blob/main/To-Do-Ro/src/main.jsx"
    click AppComp "https://github.com/legion-0-1/to-do-ro/blob/main/To-Do-Ro/src/App.jsx"
    click GlobalStyles "https://github.com/legion-0-1/to-do-ro/blob/main/To-Do-Ro/src/index.css"
    click AppStyles "https://github.com/legion-0-1/to-do-ro/blob/main/To-Do-Ro/src/App.css"
    click TimerComp "https://github.com/legion-0-1/to-do-ro/blob/main/To-Do-Ro/src/Timer.jsx"
    click ToDoComp "https://github.com/legion-0-1/to-do-ro/blob/main/To-Do-Ro/src/toDo.jsx"
    click PresetsComp "https://github.com/legion-0-1/to-do-ro/blob/main/To-Do-Ro/src/Presets.jsx"
    click ButtonComp "https://github.com/legion-0-1/to-do-ro/blob/main/To-Do-Ro/src/Button.jsx"
    click AssetsDir "https://github.com/legion-0-1/to-do-ro/tree/main/To-Do-Ro/src/assets"

    %% Styles
    classDef infra fill:#cce5ff,stroke:#3399ff,color:#000
    classDef hosting fill:#d4edda,stroke:#28a745,color:#000
    classDef runtime fill:#ffe5b4,stroke:#ff9900,color:#000
    classDef storage fill:#e2e3e5,stroke:#6c757d,color:#000
```
