# bhavesh-sompura/office-hours-calculator architecture

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

- Interactive diagram: https://gitdiagram.com/bhavesh-sompura/office-hours-calculator
- Repository: https://github.com/bhavesh-sompura/office-hours-calculator

## Overview

##### Project type and purpose
- This is a single-page application (SPA) built with React, TypeScript, and Vite.
- It provides a front-end “office-hours calculator” tool, with no separate backend service.

##### File structure
- Top-level files:
- package.json / package-lock.json – npm dependency management
- vite.config.ts – Vite build configuration
- tsconfig*.json – TypeScript compiler settings
- index.html – SPA entry point
- Directories:
- public/ – static assets served as-is
- src/ – core application code
– main.tsx – React bootstrap
– App.tsx / App.css – root component
– landing/ – page components (page.tsx, sub-components)
– lib/utils.ts – shared utility functions
- Support files:
- eslint.config.js – linting rules
- components.json – probably metadata for design or theming

##### README for additional context

a. Main components:
1. Developer Environment
– Node.js & npm
– IDE (with .vscode settings)
2. Source Code Repository
– Git, file tree as above
3. Build Pipeline
– Vite Dev Server (dev mode)
– Vite bundler (prod build)
4. Application Modules (client-side)
– index.html → bootstraps React in browser
– main.tsx → renders App component
– App.tsx → orchestrates routing or UI state
– landing/ pages & components → individual screens
– lib/utils.ts → shared logic (e.g., time calculations)
– assets & public/ → images, styles, static files
5. Browser Runtime
– React DOM
– CSS injection
6. Deployment (optional)
– Static-site host (Netlify, Vercel, S3+CloudFront, GitHub Pages)
b. Relationships & data flow:
– Developer edits src/* → commits to Git → triggers build → Vite bundles code → serves index.html + assets → user’s browser loads JS/CSS → React app renders UIs and invokes utility functions.
c. Architectural patterns & principles:
– Component-based design (React)
– Module separation: pages vs UI components vs utilities
– Static asset hosting (public folder pattern)
– Single entry point (SPA)
d. Key technologies:
– React (JSX/TSX components)
– TypeScript (type safety)
– Vite (fast dev server + bundler)
– ESLint (code quality)
– npm (package management)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer Environment
    subgraph "Developer Environment"
        DEV1["Node.js & npm"]:::build
        DEV2["IDE Settings (.vscode)"]:::code
    end

    %% Source Code Repository
    subgraph "Source Code Repository"
        GIT[".gitignore"]:::code
    end

    %% Build Pipeline
    subgraph "Build Pipeline"
        VITE_DEV["Vite Dev Server"]:::build
        VITE_BUNDLER["Vite Bundler"]:::build
        subgraph "TypeScript Configuration"
            TS1["tsconfig.json"]:::code
            TS2["tsconfig.app.json"]:::code
            TS3["tsconfig.node.json"]:::code
        end
        ESLINT["ESLint Rules"]:::build
    end

    %% Deployment
    subgraph "Deployment"
        HOST["Static Site Host"]:::runtime
    end

    %% Browser Runtime
    subgraph "Browser Runtime"
        BROWSER["User's Browser"]:::runtime
        subgraph "App Modules"
            HTML["index.html"]:::code
            MAIN["main.tsx"]:::code
            APP_TS["App.tsx"]:::code
            APP_CSS["App.css"]:::assets
            LANDING_PAGE["landing/page.tsx"]:::code
            LANDING_COMP["landing/components/page.tsx"]:::code
            UTILS["lib/utils.ts"]:::code
            ASSETS_APP["src/assets/"]:::assets
            ASSETS_PUBLIC["public/"]:::assets
            GLOBAL_CSS["src/index.css"]:::assets
            COMPONENT_META["components.json"]:::code
        end
    end

    %% Connections
    DEV1 --> GIT
    DEV2 --> GIT
    GIT --> VITE_DEV
    VITE_DEV --> VITE_BUNDLER
    VITE_BUNDLER --> TS1
    VITE_BUNDLER --> TS2
    VITE_BUNDLER --> TS3
    VITE_BUNDLER --> ESLINT
    VITE_BUNDLER --> HOST
    HOST --> BROWSER
    VITE_BUNDLER --> BROWSER
    BROWSER --> HTML
    HTML --> MAIN
    MAIN --> APP_TS
    MAIN --> APP_CSS
    APP_TS --> LANDING_PAGE
    LANDING_PAGE --> LANDING_COMP
    APP_TS --> UTILS
    APP_TS --> GLOBAL_CSS
    APP_TS --> ASSETS_APP
    BROWSER --> ASSETS_PUBLIC

    %% Click Events
    click DEV1 "https://github.com/bhavesh-sompura/office-hours-calculator/blob/main/office-hours-calculator/package.json"
    click DEV2 "https://github.com/bhavesh-sompura/office-hours-calculator/tree/main/.vscode/"
    click GIT "https://github.com/bhavesh-sompura/office-hours-calculator/blob/main/office-hours-calculator/.gitignore"
    click VITE_DEV "https://github.com/bhavesh-sompura/office-hours-calculator/blob/main/office-hours-calculator/vite.config.ts"
    click TS1 "https://github.com/bhavesh-sompura/office-hours-calculator/blob/main/office-hours-calculator/tsconfig.json"
    click TS2 "https://github.com/bhavesh-sompura/office-hours-calculator/blob/main/office-hours-calculator/tsconfig.app.json"
    click TS3 "https://github.com/bhavesh-sompura/office-hours-calculator/blob/main/office-hours-calculator/tsconfig.node.json"
    click ESLINT "https://github.com/bhavesh-sompura/office-hours-calculator/blob/main/office-hours-calculator/eslint.config.js"
    click HTML "https://github.com/bhavesh-sompura/office-hours-calculator/blob/main/office-hours-calculator/index.html"
    click MAIN "https://github.com/bhavesh-sompura/office-hours-calculator/blob/main/office-hours-calculator/src/main.tsx"
    click APP_TS "https://github.com/bhavesh-sompura/office-hours-calculator/blob/main/office-hours-calculator/src/App.tsx"
    click APP_CSS "https://github.com/bhavesh-sompura/office-hours-calculator/blob/main/office-hours-calculator/src/App.css"
    click LANDING_PAGE "https://github.com/bhavesh-sompura/office-hours-calculator/blob/main/office-hours-calculator/src/landing/page.tsx"
    click LANDING_COMP "https://github.com/bhavesh-sompura/office-hours-calculator/blob/main/office-hours-calculator/src/landing/components/page.tsx"
    click UTILS "https://github.com/bhavesh-sompura/office-hours-calculator/blob/main/office-hours-calculator/src/lib/utils.ts"
    click ASSETS_APP "https://github.com/bhavesh-sompura/office-hours-calculator/tree/main/office-hours-calculator/src/assets/"
    click ASSETS_PUBLIC "https://github.com/bhavesh-sompura/office-hours-calculator/tree/main/office-hours-calculator/public/"
    click GLOBAL_CSS "https://github.com/bhavesh-sompura/office-hours-calculator/blob/main/office-hours-calculator/src/index.css"
    click COMPONENT_META "https://github.com/bhavesh-sompura/office-hours-calculator/blob/main/office-hours-calculator/components.json"

    %% Styles
    classDef code fill:#cfe2f3,stroke:#0366d6,color:#0366d6
    classDef build fill:#d0f0c0,stroke:#2a7f62,color:#2a7f62
    classDef assets fill:#fff2cc,stroke:#d39e00,color:#d39e00
    classDef runtime fill:#ffebcc,stroke:#bf5700,color:#bf5700
```
