# nikunjgupta9os/uat architecture

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

- Interactive diagram: https://gitdiagram.com/nikunjgupta9os/uat
- Repository: https://github.com/nikunjgupta9os/uat

## Overview

##### Project type and purpose
- This is a single-page web application (SPA) built with React, TypeScript and Vite.
- The focus is a financial dashboard suite: CFO dashboard, OPS dashboard, MTM calculators, FX booking and exposure modules, user‐access management, report generation, and more.
- There is no custom backend code in the repo (the `server/` folder only contains a README), so the app consumes external or internal REST/GraphQL APIs for data and authentication.

##### File structure
- Top‐level files:
- index.html, main.tsx, App.tsx – entry point and root component.
- ProtectedRoute.tsx – handles client‐side auth routing.
- Vite, ESLint, PostCSS, Tailwind and TypeScript config files – build & lint infrastructure.
- `src/client/` – all feature modules, organized by domain:
- CFODashboard, OPSDashboard, Reports, Settlement, MTMCalculator, DashboardBuilder, MTMRateInput, Notification, linkingScreen, uam (Users/Permissions/Roles).
- `fx/` – deep hierarchy of submodules for net positions, exposure upload, cancellations, forwards, hedging proposals and wizards.
- `src/client/common/` – shared UI (Navbar, Sidebar, Footer, table utilities, drag-and-drop helpers, form validation, theme toggle).
- `src/client/contexts/ThemeContext.tsx` – app-wide theme management using React Context.
- `src/components/` – small reusable inputs and select components.
- No state management library (Redux/MobX) – local state via hooks and a custom store in DashboardBuilder (`useDashboardStore.tsx`).

##### README for additional insights
- It’s a Vite-React-TS starter template with HMR, ESLint, Babel/SWC plugins.
- No mention of backend frameworks, so all API calls are external.

##### Final reminders
- Be exhaustive: capture all essential feature clusters and external dependencies.
- Keep it hierarchical: top-level separation → detailed internals for one or two representative modules.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Build & Development Layer
    subgraph "Build & Dev Tools"
        ViteDev["Vite Dev/Build Server"]:::build
    end

    %% Client Runtime Layer
    subgraph "Client Runtime"
        subgraph "Entry & App"
            HTML["index.html"]:::frontend
            Main["main.tsx"]:::frontend
            App["App.tsx"]:::frontend
            HTML --> Main --> App
        end

        Protected["ProtectedRoute"]:::frontend
        Routing["Routing Layer"]:::frontend
        App --> Protected --> Routing

        subgraph "Feature Modules"
            subgraph "Dashboard Suite"
                CFO["CFODashboard"]:::module
                OPS["OPSDashboard"]:::module
                REP["Reports"]:::module
                Dbuilder["DashboardBuilder"]:::module
            end
            subgraph "FX & MTM Module"
                MTM["MTMCalculator"]:::module
                RateInput["MTMRateInput"]:::module
                FX["FX & Net Position"]:::module
                SETT["Settlement"]:::module
            end
            subgraph "UAM Module"
                UAM["UAM"]:::module
            end
            LS["LinkingScreen"]:::module
            NOTIF["Notification"]:::module
        end

        subgraph "Shared Libraries & Utilities"
            COMMON["common UI"]:::shared
            CMPTS["components"]:::shared
            UI["ui primitives"]:::shared
            THEMECTX["ThemeContext"]:::shared
        end

        Routing --> CFO & OPS & REP & Dbuilder & MTM & RateInput & FX & SETT & UAM & LS & NOTIF
        CFO & OPS & REP & Dbuilder & MTM & RateInput & FX & SETT & UAM & LS & NOTIF --> COMMON
        COMMON --> CMPTS & UI
        App --> THEMECTX
    end

    %% External Services Layer
    subgraph "External Services"
        Auth["Authentication API"]:::external
        Finance["Finance Data API"]:::external
        UserMgmt["User Management API"]:::external
        NotifySvc["Notification Service"]:::external
    end

    App -->|"HTTP REST"| Auth
    App -->|"HTTP REST"| Finance
    App -->|"HTTP REST"| UserMgmt
    App -->|"HTTP REST"| NotifySvc

    ViteDev -->|"HMR/WebSocket"| App
    ViteDev -->|"Build"| CDN["CDN/Hosting"]:::infra

    %% Click Events
    click ViteDev "https://github.com/nikunjgupta9os/uat/blob/master/vite.config.ts"
    click HTML "https://github.com/nikunjgupta9os/uat/blob/master/index.html"
    click Main "https://github.com/nikunjgupta9os/uat/blob/master/src/main.tsx"
    click App "https://github.com/nikunjgupta9os/uat/blob/master/src/App.tsx"
    click Protected "https://github.com/nikunjgupta9os/uat/blob/master/src/ProtectedRoute.tsx"
    click Routing "https://github.com/nikunjgupta9os/uat/blob/master/src/client/route/index.tsx"
    click CFO "https://github.com/nikunjgupta9os/uat/tree/master/src/client/CFODashboard"
    click OPS "https://github.com/nikunjgupta9os/uat/blob/master/src/client/OPSDashboard/OPSDashboard.tsx"
    click MTM "https://github.com/nikunjgupta9os/uat/blob/master/src/client/MTMCalculator/MTMCalculator.tsx"
    click RateInput "https://github.com/nikunjgupta9os/uat/tree/master/src/client/MTMRateInput"
    click Dbuilder "https://github.com/nikunjgupta9os/uat/blob/master/src/client/DashboardBuilder/DashboardBuilder.tsx"
    click REP "https://github.com/nikunjgupta9os/uat/blob/master/src/client/Reports/Reports.tsx"
    click SETT "https://github.com/nikunjgupta9os/uat/tree/master/src/client/Settlement"
    click FX "https://github.com/nikunjgupta9os/uat/tree/master/src/client/fx/NetPosition/"
    click UAM "https://github.com/nikunjgupta9os/uat/tree/master/src/client/uam"
    click LS "https://github.com/nikunjgupta9os/uat/blob/master/src/client/linkingScreen/index.tsx"
    click NOTIF "https://github.com/nikunjgupta9os/uat/blob/master/src/client/Notification/Notification.tsx"
    click COMMON "https://github.com/nikunjgupta9os/uat/tree/master/src/client/common"
    click CMPTS "https://github.com/nikunjgupta9os/uat/tree/master/src/components"
    click UI "https://github.com/nikunjgupta9os/uat/tree/master/src/client/ui"
    click THEMECTX "https://github.com/nikunjgupta9os/uat/blob/master/src/client/contexts/ThemeContext.tsx"

    %% Styles
    classDef build fill:#D0E8FF,stroke:#0366D6,stroke-width:2px;
    classDef frontend fill:#DFFFE0,stroke:#228B22;
    classDef module fill:#E8F4FC,stroke:#1E90FF;
    classDef shared fill:#FFF4E5,stroke:#FFA500;
    classDef external fill:#F3E8FF,stroke:#800080;
    classDef infra fill:#F0F0F0,stroke:#A9A9A9;
```
