# gajjalasandeep84/ldap-ui architecture

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

- Interactive diagram: https://gitdiagram.com/gajjalasandeep84/ldap-ui
- Repository: https://github.com/gajjalasandeep84/ldap-ui

## Overview

This repo is a **frontend-only React (Vite) single-page app** that is **built into static assets** and then **served by NGINX inside a Docker container**, and finally **deployed to Kubernetes** behind a **Service** and **NGINX Ingress**.

So the “system” here is less about backend/data stores and more about the **delivery pipeline + runtime serving path**:
- Build-time: Developer → Docker image → Docker Hub
- Runtime: Browser → Ingress → Service → Pods (NGINX) → static React app

##### File-structure-driven architecture cues
From the tree:

##### Runtime/deploy infrastructure
- `Dockerfile` / `.dockerignore` → container image (likely NGINX serving `/usr/share/nginx/html`)
- `k8s/ldap-ui-deploy.yaml` → Deployment (replicas, pod template, image ref)
- `k8s/ldap-ui-svc.yaml` → ClusterIP Service (load balances to pods)
- `k8s/ldap-ui-ingress.yaml` → Ingress routing for `ldap-ui.local` (NGINX ingress controller)

##### Frontend app structure
- `index.html`, `vite.config.js`, `src/main.jsx` → Vite entry + React bootstrapping
- `src/App.jsx` + `src/components/*` → UI composition
- `src/api/userAccessApi.js`, `src/api/mockData.js` → data access abstraction (currently mock-driven)
- `src/hooks/useDebouncedValue.js` → interaction/UX behavior (debounced search/filter likely)
- `src/theme/nsyohTheme.js` → theming system

Notably absent:
- No backend service directory, no database, no auth provider config. Any “LDAP” is conceptual/UI-focused, not an actual LDAP server integration in this repo.

##### Labels
Use exact names where possible:
- `ldap-ui-ingress`, `ldap-ui-svc`, `ldap-ui-deploy` (verify in YAML)
- Image: `gajjalasandeep/ldap-ui:1.0`
- Domain: `ldap-ui.local`

- Browser → Ingress: **HTTP** (and host header `ldap-ui.local`)
- Ingress → Service: **HTTP** (or TCP forwarding; depends on ingress config)
- Service → Pods: **80/TCP**
- Optionally: show health checks/readiness probes if present in Deployment YAML

##### Boundaries (very important here)
- “Developer Environment”
- “Container Registry (Docker Hub)”
- “Kubernetes Cluster”
- Inside: Ingress Controller (often in `ingress-nginx` namespace), your app namespace resources, pods on nodes

- **Static SPA** served by **NGINX** (not Node/SSR)
- **Replicas/pods** behind a **Service** (load balancing)
- **Ingress host routing** to `ldap-ui.local`
- **Docker build/run** ports (`3000:80`) for local container testing
- The existence of an **API module** that currently uses **mock data** (so stakeholders don’t assume live LDAP queries)
- The separation between:
- **App source** (`src/`, `public/`)
- **Containerization** (`Dockerfile`)
- **Orchestration** (`k8s/*.yaml`)

These three together are the “as many components as possible” breakdown for this repo without inventing nonexistent services.

## Diagram (Mermaid)

```mermaid
flowchart TD

%% =========================
%% View A: Deployment / Request Flow (Primary)
%% =========================
subgraph V1["A) Deployment & Request Flow (Kubernetes Runtime)"]
direction TB

User["User / Browser"]:::external
DNS["HostMapping<br/>ldap-ui.local -> 127.0.0.1"]:::external

subgraph K8S["KubernetesCluster"]
direction TB

Ingress["Ingress<br/>ldap-ui-ingress<br/>Host: ldap-ui.local"]:::k8s
Service["Service<br/>ldap-ui-svc<br/>ClusterIP"]:::k8s
Deploy["Deployment<br/>ldap-ui-deploy<br/>Replicas: 3"]:::k8s

subgraph Pods["Pods (ReplicaSet)"]
direction TB

Pod1["Pod #1"]:::pod
Pod2["Pod #2"]:::pod
Pod3["Pod #3"]:::pod

NG1["NGINXContainer<br/>(static file server)"]:::runtime
NG2["NGINXContainer<br/>(static file server)"]:::runtime
NG3["NGINXContainer<br/>(static file server)"]:::runtime

Assets1["StaticAssets<br/>(index.html, JS, CSS)"]:::artifact
Assets2["StaticAssets<br/>(index.html, JS, CSS)"]:::artifact
Assets3["StaticAssets<br/>(index.html, JS, CSS)"]:::artifact

Pod1 -->|"contains"| NG1
NG1 -->|"serves"| Assets1

Pod2 -->|"contains"| NG2
NG2 -->|"serves"| Assets2

Pod3 -->|"contains"| NG3
NG3 -->|"serves"| Assets3
end

Deploy -->|"creates"| Pod1
Deploy -->|"creates"| Pod2
Deploy -->|"creates"| Pod3

Ingress -->|"routes_to"| Service
Service -->|"load_balances_to"| Pod1
Service -->|"load_balances_to"| Pod2
Service -->|"load_balances_to"| Pod3
end

User -->|"resolves_host"| DNS
User -->|"HTTP GET / (Host: ldap-ui.local)"| Ingress

LocalDocker["LocalDockerRun<br/>-p 3000:80"]:::note
User -.->|"optional_local_test"| LocalDocker

NoBackend["NoBackend<br/>SPA served as static assets<br/>(all interactions in-browser)"]:::note
Assets1 -.->|"note"| NoBackend
end

%% =========================
%% View B: Build / Release Pipeline (Secondary)
%% =========================
subgraph V2["B) Build & Release Pipeline (Developer -> Docker Hub -> Kubernetes)"]
direction TB

Dev["DeveloperWorkstation"]:::external
Repo["GitWorkingCopy<br/>(this repo)"]:::code
ViteBuild["BuildStaticAssets<br/>(Vite + React)"]:::build
DockerBuild["DockerBuild<br/>(Dockerfile)"]:::build
Image["DockerImage<br/>gajjalasandeep/ldap-ui:1.0"]:::artifact
Hub["DockerHub<br/>Registry"]:::external
Kubectl["kubectl apply<br/>k8s/*.yaml"]:::build
ClusterPull["KubernetesPullsImage"]:::k8s

Dev -->|"edits"| Repo
Repo -->|"npm install + build"| ViteBuild
ViteBuild -->|"bundles_into"| DockerBuild
DockerBuild -->|"produces"| Image
Image -->|"push"| Hub
Kubectl -->|"applies"| ClusterPull
Hub -->|"pull"| ClusterPull
ClusterPull -->|"starts"| Deploy
end

%% =========================
%% View C: Frontend Module / Component View (Tertiary)
%% =========================
subgraph V3["C) Frontend SPA Module & Data Flow (src/)"]
direction TB

IndexHtml["index.html<br/>(Vite entry HTML)"]:::code
ViteCfg["vite.config.js<br/>(Vite config)"]:::code

subgraph Boot["Bootstrap"]
direction TB
Main["src/main.jsx<br/>(mount React)"]:::code
App["src/App.jsx<br/>(root component)"]:::code
end

subgraph UILayer["UI Layer (components)"]
direction TB
UAV["src/UserAccessViewer.jsx<br/>(main viewer)"]:::ui
URow["src/UserRow.jsx<br/>(user row)"]:::ui

subgraph Tabs["Tabs"]
direction TB
GroupsTab["GroupsTab"]:::ui
MappingTab["MappingTab"]:::ui
PermissionsTab["PermissionsTab"]:::ui
end

subgraph Panels["Panels"]
direction TB
ResultsPane["ResultsPane"]:::ui
UserHeader["UserHeader"]:::ui
end

subgraph Drawers["Drawers"]
direction TB
GroupPermDrawer["GroupPermDrawer"]:::ui
end

subgraph Primitives["UI Primitives"]
direction TB
Chips["chips.jsx"]:::ui
KV["kv.jsx"]:::ui
end
end

subgraph CrossCutting["Cross-cutting"]
direction TB
Theme["src/theme/nsyohTheme.js<br/>(theme)"]:::code
Debounce["src/hooks/useDebouncedValue.js<br/>(debounced UX)"]:::code
AppCss["CSS<br/>App.css"]:::code
IndexCss["CSS<br/>index.css"]:::code
end

subgraph DataLayer["Data Access Layer (mock-driven)"]
direction TB
Api["src/api/userAccessApi.js<br/>(API abstraction)"]:::api
Mock["src/api/mockData.js<br/>(mock data)"]:::data
end

Public["public/<br/>(static public assets)"]:::artifact
AssetsDir["src/assets/<br/>(images/etc.)"]:::artifact

IndexHtml -->|"loads_bundle"| Main
ViteCfg -.->|"builds"| IndexHtml

Main -->|"renders"| App
App -->|"composes"| UILayer

UAV -->|"renders"| URow
UAV -->|"uses"| ResultsPane
UAV -->|"uses"| UserHeader
UAV -->|"opens"| GroupPermDrawer
UAV -->|"uses"| Tabs
UAV -->|"uses"| Debounce

Tabs -->|"tab"| GroupsTab
Tabs -->|"tab"| MappingTab
Tabs -->|"tab"| PermissionsTab

UILayer -->|"uses"| Primitives
UILayer -->|"styled_by"| Theme
UILayer -->|"styled_by"| AppCss
UILayer -->|"styled_by"| IndexCss
UILayer -->|"loads_assets"| AssetsDir
IndexHtml -->|"serves"| Public

UAV -->|"calls"| Api
Api -->|"reads"| Mock
end

Docs["Docs<br/>README + LearningJourney PDF"]:::note
V2 -.->|"documented_in"| Docs
V1 -.->|"documented_in"| Docs

%% =========================
%% Click events (from component_mapping)
%% =========================
click DockerBuild "https://github.com/gajjalasandeep84/ldap-ui/tree/main/Dockerfile"
click Repo "https://github.com/gajjalasandeep84/ldap-ui/blob/main/README.md"
click Docs "https://github.com/gajjalasandeep84/ldap-ui/blob/main/docs/ldap_ui_k8s_learning_journey.pdf"
click Kubectl "https://github.com/gajjalasandeep84/ldap-ui/blob/main/k8s/ldap-ui-deploy.yaml"
click Service "https://github.com/gajjalasandeep84/ldap-ui/blob/main/k8s/ldap-ui-svc.yaml"
click Ingress "https://github.com/gajjalasandeep84/ldap-ui/blob/main/k8s/ldap-ui-ingress.yaml"
click IndexHtml "https://github.com/gajjalasandeep84/ldap-ui/blob/main/index.html"
click ViteCfg "https://github.com/gajjalasandeep84/ldap-ui/blob/main/vite.config.js"
click Main "https://github.com/gajjalasandeep84/ldap-ui/blob/main/src/main.jsx"
click App "https://github.com/gajjalasandeep84/ldap-ui/blob/main/src/App.jsx"
click AppCss "https://github.com/gajjalasandeep84/ldap-ui/blob/main/src/App.css"
click IndexCss "https://github.com/gajjalasandeep84/ldap-ui/blob/main/src/index.css"
click UAV "https://github.com/gajjalasandeep84/ldap-ui/blob/main/src/UserAccessViewer.jsx"
click URow "https://github.com/gajjalasandeep84/ldap-ui/blob/main/src/UserRow.jsx"
click GroupsTab "https://github.com/gajjalasandeep84/ldap-ui/blob/main/src/components/GroupsTab.jsx"
click MappingTab "https://github.com/gajjalasandeep84/ldap-ui/blob/main/src/components/MappingTab.jsx"
click PermissionsTab "https://github.com/gajjalasandeep84/ldap-ui/blob/main/src/components/PermissionsTab.jsx"
click ResultsPane "https://github.com/gajjalasandeep84/ldap-ui/blob/main/src/components/ResultsPane.jsx"
click UserHeader "https://github.com/gajjalasandeep84/ldap-ui/blob/main/src/components/UserHeader.jsx"
click GroupPermDrawer "https://github.com/gajjalasandeep84/ldap-ui/blob/main/src/components/GroupPermDrawer.jsx"
click Chips "https://github.com/gajjalasandeep84/ldap-ui/blob/main/src/components/chips.jsx"
click KV "https://github.com/gajjalasandeep84/ldap-ui/blob/main/src/components/kv.jsx"
click UILayer "https://github.com/gajjalasandeep84/ldap-ui/tree/main/src/components/"
click Api "https://github.com/gajjalasandeep84/ldap-ui/blob/main/src/api/userAccessApi.js"
click Mock "https://github.com/gajjalasandeep84/ldap-ui/blob/main/src/api/mockData.js"
click Debounce "https://github.com/gajjalasandeep84/ldap-ui/blob/main/src/hooks/useDebouncedValue.js"
click Theme "https://github.com/gajjalasandeep84/ldap-ui/blob/main/src/theme/nsyohTheme.js"
click Public "https://github.com/gajjalasandeep84/ldap-ui/tree/main/public/"
click AssetsDir "https://github.com/gajjalasandeep84/ldap-ui/tree/main/src/assets/"
click LocalDocker "https://github.com/gajjalasandeep84/ldap-ui/blob/main/.dockerignore"

%% =========================
%% Styles
%% =========================
classDef external fill:#d9ecff,stroke:#1e66a6,stroke-width:1.5px,color:#0b2b4a;
classDef k8s fill:#d9fbe5,stroke:#167c3a,stroke-width:1.5px,color:#08351a;
classDef pod fill:#fff1cc,stroke:#b7791f,stroke-width:1.5px,color:#4a2c0a;
classDef runtime fill:#ffe0b2,stroke:#b45309,stroke-width:1.5px,color:#4a2206;
classDef code fill:#eef2ff,stroke:#4338ca,stroke-width:1.5px,color:#1f1b6a;
classDef ui fill:#f3f4f6,stroke:#6b7280,stroke-width:1.5px,color:#111827;
classDef api fill:#ede9fe,stroke:#6d28d9,stroke-width:1.5px,color:#2e1065;
classDef data fill:#ffe4e6,stroke:#be123c,stroke-width:1.5px,color:#4c0519;
classDef build fill:#e0f2fe,stroke:#0369a1,stroke-width:1.5px,color:#0c4a6e;
classDef artifact fill:#fafafa,stroke:#525252,stroke-width:1.5px,color:#111827;
classDef note fill:#fef9c3,stroke:#a16207,stroke-width:1.5px,color:#713f12;
```
