# predystopic-dev/calc-fe architecture

> Architecture diagram of the GitHub repository predystopic-dev/calc-fe, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/predystopic-dev/calc-fe
- Repository: https://github.com/predystopic-dev/calc-fe

## Overview

##### Main Components

A. Application Layer Components:
- React Application Container
- Screen Components (under /screens)
- UI Components (under /components/ui)
- Asset Management
- Utility Services (/lib)

B. Build & Development Infrastructure:
- Vite Dev Server
- TypeScript Compiler
- ESLint System
- Tailwind CSS Processing

**[Client Browser] ←→ [Vite Dev Server]**
- ↓
**[React Application Container]**
- ↓
- Component Layer
- Screens
- Home Screen
- UI Components
- Button Component
- Utility Services

##### Key Relationships to Highlight

A. Development Flow:
- How TypeScript files (.tsx, .ts) are processed through the build pipeline
- How Tailwind CSS processes the styling
- Demonstrate the Hot Module Replacement (HMR) connection

B. Runtime Flow:
- Component hierarchy and composition
- Asset and utility service usage
- State management (if implemented)

##### Important Architectural Patterns to Emphasize

- Component-Based Architecture:
- src/
- components/     # Reusable UI components
- screens/        # Page-level components
- lib/           # Utility functions
- assets/        # Static resources

##### Technical Stack Indicators

- React 18
- TypeScript
- Vite
- Tailwind CSS
- ESLint
- SWC/Babel (for Fast Refresh)

##### Development Environment Flow

Relationship between:
- TypeScript compilation process
- Vite's development server
- ESLint checking
- Tailwind CSS processing

##### Specific Implementation Details

- Configuration files (tsconfig.json, vite.config.ts, etc.)
- Build optimization processes
- Development tools integration

- Component type indicators
- Build process markers

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Browser["Web Browser"]
    end

    subgraph "Development Infrastructure"
        ViteServer["Vite Dev Server"]:::devtool
        click ViteServer "https://github.com/predystopic-dev/calc-fe/blob/main/vite.config.ts"
        TSCompiler["TypeScript Compiler"]:::devtool
        click TSCompiler "https://github.com/predystopic-dev/calc-fe/blob/main/tsconfig.json"
        ESLint["ESLint System"]:::devtool
        click ESLint "https://github.com/predystopic-dev/calc-fe/blob/main/.eslintrc.json"
        TailwindCSS["Tailwind CSS"]:::styling
        click TailwindCSS "https://github.com/predystopic-dev/calc-fe/blob/main/tailwind.config.js"
    end

    subgraph "Application Layer"
        AppEntry["Application Entry"]:::react
        click AppEntry "https://github.com/predystopic-dev/calc-fe/blob/main/src/main.tsx"
        AppContainer["React App Container"]:::react
        click AppContainer "https://github.com/predystopic-dev/calc-fe/blob/main/src/App.tsx"
        
        subgraph "Core Components"
            Screens["Screen Components"]:::react
            click Screens "https://github.com/predystopic-dev/calc-fe/tree/main/src/screens/"
            HomeScreen["Home Screen"]:::react
            click HomeScreen "https://github.com/predystopic-dev/calc-fe/blob/main/src/screens/home/index.tsx"
            
            UIComponents["UI Components"]:::react
            click UIComponents "https://github.com/predystopic-dev/calc-fe/tree/main/src/components/ui/"
            Button["Button Component"]:::react
            click Button "https://github.com/predystopic-dev/calc-fe/blob/main/src/components/ui/button.tsx"
        end

        subgraph "Support Services"
            Utils["Utility Services"]:::service
            click Utils "https://github.com/predystopic-dev/calc-fe/tree/main/src/lib/"
            UtilFunctions["Utility Functions"]:::service
            click UtilFunctions "https://github.com/predystopic-dev/calc-fe/blob/main/src/lib/utils.ts"
            Assets["Asset Management"]:::service
            click Assets "https://github.com/predystopic-dev/calc-fe/tree/main/src/assets/"
            Constants["Constants"]:::service
            click Constants "https://github.com/predystopic-dev/calc-fe/blob/main/src/constants.ts"
        end

        subgraph "Styling"
            AppCSS["Application CSS"]:::styling
            click AppCSS "https://github.com/predystopic-dev/calc-fe/blob/main/src/App.css"
            IndexCSS["Index CSS"]:::styling
            click IndexCSS "https://github.com/predystopic-dev/calc-fe/blob/main/src/index.css"
        end
    end

    %% Relationships
    Browser <--> ViteServer
    ViteServer --> AppEntry
    TSCompiler --> AppEntry
    ESLint --> AppEntry
    TailwindCSS --> AppCSS
    TailwindCSS --> IndexCSS
    
    AppEntry --> AppContainer
    AppContainer --> Screens
    AppContainer --> UIComponents
    Screens --> HomeScreen
    UIComponents --> Button
    
    Utils --> UtilFunctions
    HomeScreen --> Button
    HomeScreen --> UtilFunctions
    Button --> Assets
    Button --> Constants

    %% Styling
    classDef react fill:#61DAFB,stroke:#333,stroke-width:2px
    classDef service fill:#FF9900,stroke:#333,stroke-width:2px
    classDef devtool fill:#4CAF50,stroke:#333,stroke-width:2px
    classDef styling fill:#FF69B4,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        React["React Component"]:::react
        Service["Service/Utility"]:::service
        DevTool["Development Tool"]:::devtool
        Styling["Styling Component"]:::styling
    end
```
