# shagundubey1/soar architecture

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

- Interactive diagram: https://gitdiagram.com/shagundubey1/soar
- Repository: https://github.com/shagundubey1/soar

## Overview

##### Main components
- Frontend Application: The entire application powered by React. This includes:
- Entry point (index.html and src/main.tsx) and the central application component (src/App.tsx).
- Layouts and routing (directories like src/layouts and src/routes) that organize the UI.
- Pages (after all, you have separate pages for accounts, credit cards, dashboard, investments, loans, etc.) which the router maps.
- State Management: Use of Redux Toolkit (illustrated by file entries in src/features and src/stores) to manage global state.
- API and Services: The src/apis contains API calls, while src/services manages external data connections or business logic.
- Configurations and Constants: Including configuration files (src/config) and constants (src/constants) which provide standardized values and notifications.
- Types & Schemas: Type safety enforced through files in src/@types and schema definitions in src/schema.
- Styling & Build Tools: Tailwind CSS (tailwind.config.js, src/styles) and other build configuration (Vite, ESLint/Prettier, etc.)

##### Relationships and Interactions between Components
- The entry point (main.tsx) loads the App component which further manages the routing and layouts.
- The router (src/routes/routes.tsx) directs users to different pages (under src/pages) based on the URL.
- UI components (in src/components/*) are composed within the pages and layouts (src/layouts) to form the interactive dashboard.
- API services (src/apis and src/services) facilitate data fetching, updating the state or storing transactions.
- The configuration files ensure consistent notifications and styling (e.g., notifyConfig.ts and tailwind.config.js).

##### Architectural Patterns & Technologies
- Component-Based Architecture: The separation into components (base, shared, UI) reflects a modular design.
- Routing and Layout Separation: Pages and layouts show an MVC-like separation in UI design.
- State Management using Redux Toolkit indicates a unidirectional data flow.
- API Abstraction: API calls centralized in src/apis help maintain separation of concerns.
- Use of Build Tools & Linters (Vite for building, ESLint, and Prettier for code quality) to ensure a maintainable workflow.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Presentation/UI Layer
    subgraph "Presentation/UI Layer"
        A["Entry Point (index.html, src/main.tsx)"]:::presentation
        B["Central App (src/App.tsx)"]:::presentation
        C["Main Layout (src/layouts/main-layout/index.tsx)"]:::presentation
        D["Router (src/routes/routes.tsx)"]:::presentation
        E["Pages Directory (src/pages)"]:::presentation
        F["Base Components (src/components/base)"]:::presentation
        G["Shared Components (src/components/shared)"]:::presentation
        H["UI Components (src/components/ui)"]:::presentation
        I["Assets (src/assets)"]:::presentation
    end

    %% State Management Layer
    subgraph "State Management Layer"
        J["Redux Slices (src/features)"]:::state
        K["Global Store (src/stores/index.ts)"]:::state
    end

    %% Data Layer
    subgraph "Data and Services Layer"
        L["API Calls (src/apis/index.ts)"]:::api
        M["Services (src/services/index.ts)"]:::api
        N["External API/Backend"]:::api
    end

    %% Configuration & Utility Layer
    subgraph "Configuration & Utility Layer"
        O["Config Files (src/config)"]:::config
        P["Constants (src/constants)"]:::config
        Q["Types (src/@types)"]:::config
        R["Schemas (src/schema)"]:::config
        S["Styling (src/styles/index.css)"]:::config
        T["Tailwind Config (tailwind.config.js)"]:::config
        U["Build Config (vite.config.ts)"]:::config
    end

    %% Flow Connections for Presentation/UI Layer
    A --> B
    B --> C
    C --> D
    D --> E
    B --> F
    B --> G
    B --> H
    B --> I

    %% Connections between Presentation and State Management
    E -->|"action"| J
    J -->|"storeUpdate"| K

    %% Connections from State Management to Data Layer
    J -->|"API_Call"| L
    J -->|"logic"| M
    L -->|"request"| N
    N -->|"response"| L
    L -->|"update"| J

    %% Dotted connections from Central App to Configuration & Utility
    B ---|"config"| O
    B ---|"config"| P
    B ---|"config"| Q
    B ---|"config"| R
    B ---|"config"| S
    B ---|"config"| T
    B ---|"config"| U

    %% Click Events for Presentation/UI Layer
    click A "https://github.com/shagundubey1/soar/blob/main/index.html"
    click A "https://github.com/shagundubey1/soar/blob/main/src/main.tsx"
    click B "https://github.com/shagundubey1/soar/blob/main/src/App.tsx"
    click C "https://github.com/shagundubey1/soar/blob/main/src/layouts/main-layout/index.tsx"
    click D "https://github.com/shagundubey1/soar/blob/main/src/routes/routes.tsx"
    click E "https://github.com/shagundubey1/soar/tree/main/src/pages"
    click F "https://github.com/shagundubey1/soar/tree/main/src/components/base"
    click G "https://github.com/shagundubey1/soar/tree/main/src/components/shared"
    click H "https://github.com/shagundubey1/soar/tree/main/src/components/ui"
    click I "https://github.com/shagundubey1/soar/tree/main/src/assets"

    %% Click Events for State Management Layer
    click J "https://github.com/shagundubey1/soar/tree/main/src/features"
    click K "https://github.com/shagundubey1/soar/blob/main/src/stores/index.ts"

    %% Click Events for Data and Services Layer
    click L "https://github.com/shagundubey1/soar/blob/main/src/apis/index.ts"
    click M "https://github.com/shagundubey1/soar/blob/main/src/services/index.ts"

    %% Click Events for Configuration & Utility Layer
    click O "https://github.com/shagundubey1/soar/tree/main/src/config"
    click P "https://github.com/shagundubey1/soar/tree/main/src/constants"
    click Q "https://github.com/shagundubey1/soar/tree/main/src/@types"
    click R "https://github.com/shagundubey1/soar/tree/main/src/schema"
    click S "https://github.com/shagundubey1/soar/blob/main/src/styles/index.css"
    click T "https://github.com/shagundubey1/soar/blob/main/tailwind.config.js"
    click U "https://github.com/shagundubey1/soar/blob/main/vite.config.ts"

    %% Styles
    classDef presentation fill:#B3E5FC,stroke:#0277BD,stroke-width:2px;
    classDef state fill:#C8E6C9,stroke:#2E7D32,stroke-width:2px;
    classDef api fill:#FFCDD2,stroke:#C62828,stroke-width:2px;
    classDef config fill:#FFF9C4,stroke:#F9A825,stroke-width:2px;
```
