# tusharvarshney18/erpx-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/tusharvarshney18/erpx-frontend
- Repository: https://github.com/tusharvarshney18/erpx-frontend

## Overview

ERPX is a browser-based ERP suite covering finance, sales, inventory, purchasing, banking, HR, reporting, and organization administration. Users enter through marketing or sign-in, establish an authenticated organization session, and access permission-aware application routes; the dashboard and domain pages provide operational results. Source evidence shows the auth/API and access/search relationships, plus dashboard and self-service dependencies. Many domain route implementations and backend behavior were not sampled, so those capability nodes are grouped by their exact source directory without inferred internal flows.

Main entry points: [`src/lib/auth.tsx`](https://github.com/tusharvarshney18/erpx-frontend/blob/main/src/lib/auth.tsx) (Auth session), [`src/components/command/SearchPalette.tsx`](https://github.com/tusharvarshney18/erpx-frontend/blob/main/src/components/command/SearchPalette.tsx) (Search palette), [`src/hooks/useShortcutTargets.ts`](https://github.com/tusharvarshney18/erpx-frontend/blob/main/src/hooks/useShortcutTargets.ts) (Shortcut targets), [`src/routes/index.tsx`](https://github.com/tusharvarshney18/erpx-frontend/blob/main/src/routes/index.tsx) (Marketing site)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and identity"]
  node_marketing["Marketing site<br/>[index.tsx]"]
  node_sign_in["Sign in<br/>[auth.tsx]"]
  node_identity["Auth session<br/>[auth.tsx]"]
end

subgraph group_navigation["Application navigation"]
  node_routes["Route registry<br/>[routeTree.gen.ts]"]
  node_router["App router<br/>[router.tsx]"]
  node_navigation_policy["Visible navigation"]
  node_shortcuts["Shortcut targets"]
  node_search["Search palette<br/>[SearchPalette.tsx]"]
end

subgraph group_operations["ERP operations"]
  node_dashboard["Dashboard<br/>[dashboard-page.tsx]"]
  node_finance["Accounting and reports"]
  node_sales["Sales and CRM"]
  node_supply["Inventory and purchasing"]
  node_banking["Banking"]
  node_administration["Organization admin"]
end

subgraph group_workforce["Workforce"]
  node_hr_management["HR management"]
  node_self_service["Employee self-service"]
  node_self_service_api["Self-service API<br/>[self-service.ts]"]
end

subgraph group_platform["Shared platform"]
  node_api["API client<br/>[client.ts]"]
  node_access["Access policy<br/>[useAccess.ts]"]
  node_design_layout["Design-system layout"]
  node_design_button["Design-system button<br/>[button.tsx]"]
  node_design_cn["Design class utility<br/>[cn.ts]"]
  node_ui_kit["Shared UI kit"]
end

node_visitor(("Visitor"))

node_visitor -->|"views"| node_marketing
node_marketing -->|"starts signup"| node_sign_in
node_sign_in -->|"authenticates"| node_identity
node_identity -->|"requests auth"| node_api
node_router -->|"loads registry"| node_routes
node_dashboard -->|"loads data"| node_api
node_dashboard -->|"reads session"| node_identity
node_self_service -->|"requests records"| node_self_service_api
node_self_service_api -->|"sends requests"| node_api
node_search -->|"checks permissions"| node_access
node_search -->|"reads organization"| node_identity
node_search -->|"resolves targets"| node_shortcuts
node_shortcuts -->|"gets access context"| node_access
node_shortcuts -->|"filters destinations"| node_navigation_policy
node_design_layout -->|"uses class utility"| node_design_cn
node_design_button -.->|"uses class utility"| node_design_cn
node_ui_kit -.->|"renders interface"| node_marketing

click node_marketing "https://github.com/tusharvarshney18/erpx-frontend/blob/main/src/routes/index.tsx"
click node_sign_in "https://github.com/tusharvarshney18/erpx-frontend/blob/main/src/routes/auth.tsx"
click node_identity "https://github.com/tusharvarshney18/erpx-frontend/blob/main/src/lib/auth.tsx"
click node_api "https://github.com/tusharvarshney18/erpx-frontend/blob/main/src/lib/api/client.ts"
click node_routes "https://github.com/tusharvarshney18/erpx-frontend/blob/main/src/routeTree.gen.ts"
click node_router "https://github.com/tusharvarshney18/erpx-frontend/blob/main/src/router.tsx"
click node_access "https://github.com/tusharvarshney18/erpx-frontend/blob/main/src/hooks/useAccess.ts"
click node_navigation_policy "https://github.com/tusharvarshney18/erpx-frontend/blob/main/src/lib/navigation-access.ts"
click node_shortcuts "https://github.com/tusharvarshney18/erpx-frontend/blob/main/src/hooks/useShortcutTargets.ts"
click node_search "https://github.com/tusharvarshney18/erpx-frontend/blob/main/src/components/command/SearchPalette.tsx"
click node_dashboard "https://github.com/tusharvarshney18/erpx-frontend/blob/main/src/features/dashboard/dashboard-page.tsx"
click node_finance "https://github.com/tusharvarshney18/erpx-frontend/tree/main/src/routes"
click node_sales "https://github.com/tusharvarshney18/erpx-frontend/tree/main/src/routes"
click node_supply "https://github.com/tusharvarshney18/erpx-frontend/tree/main/src/routes"
click node_banking "https://github.com/tusharvarshney18/erpx-frontend/tree/main/src/routes"
click node_administration "https://github.com/tusharvarshney18/erpx-frontend/tree/main/src/routes"
click node_hr_management "https://github.com/tusharvarshney18/erpx-frontend/tree/main/src/routes"
click node_self_service "https://github.com/tusharvarshney18/erpx-frontend/tree/main/src/features/self-service"
click node_self_service_api "https://github.com/tusharvarshney18/erpx-frontend/blob/main/src/lib/api/self-service.ts"
click node_design_layout "https://github.com/tusharvarshney18/erpx-frontend/tree/main/src/design-system/components/layout"
click node_design_button "https://github.com/tusharvarshney18/erpx-frontend/blob/main/src/design-system/components/ui/button.tsx"
click node_design_cn "https://github.com/tusharvarshney18/erpx-frontend/blob/main/src/design-system/lib/cn.ts"
click node_ui_kit "https://github.com/tusharvarshney18/erpx-frontend/tree/main/src/components/ui"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_marketing,node_sign_in,node_identity toneBlue
class node_routes,node_router,node_navigation_policy,node_shortcuts,node_search toneAmber
class node_dashboard,node_finance,node_sales,node_supply,node_banking,node_administration toneMint
class node_hr_management,node_self_service,node_self_service_api toneRose
class node_api,node_access,node_design_layout,node_design_button,node_design_cn,node_ui_kit,node_visitor toneIndigo
```

## Components

### Entry and identity

- [Marketing site](https://github.com/tusharvarshney18/erpx-frontend/blob/main/src/routes/index.tsx): `src/routes/index.tsx`
- [Sign in](https://github.com/tusharvarshney18/erpx-frontend/blob/main/src/routes/auth.tsx): `src/routes/auth.tsx`
- [Auth session](https://github.com/tusharvarshney18/erpx-frontend/blob/main/src/lib/auth.tsx): `src/lib/auth.tsx`

### Application navigation

- [Route registry](https://github.com/tusharvarshney18/erpx-frontend/blob/main/src/routeTree.gen.ts): `src/routeTree.gen.ts`
- [App router](https://github.com/tusharvarshney18/erpx-frontend/blob/main/src/router.tsx): `src/router.tsx`
- [Visible navigation](https://github.com/tusharvarshney18/erpx-frontend/blob/main/src/lib/navigation-access.ts): `src/lib/navigation-access.ts`
- [Shortcut targets](https://github.com/tusharvarshney18/erpx-frontend/blob/main/src/hooks/useShortcutTargets.ts): `src/hooks/useShortcutTargets.ts`
- [Search palette](https://github.com/tusharvarshney18/erpx-frontend/blob/main/src/components/command/SearchPalette.tsx): `src/components/command/SearchPalette.tsx`

### ERP operations

- [Dashboard](https://github.com/tusharvarshney18/erpx-frontend/blob/main/src/features/dashboard/dashboard-page.tsx): `src/features/dashboard/dashboard-page.tsx`
- [Accounting and reports](https://github.com/tusharvarshney18/erpx-frontend/tree/main/src/routes): `src/routes`
- [Sales and CRM](https://github.com/tusharvarshney18/erpx-frontend/tree/main/src/routes): `src/routes`
- [Inventory and purchasing](https://github.com/tusharvarshney18/erpx-frontend/tree/main/src/routes): `src/routes`
- [Banking](https://github.com/tusharvarshney18/erpx-frontend/tree/main/src/routes): `src/routes`
- [Organization admin](https://github.com/tusharvarshney18/erpx-frontend/tree/main/src/routes): `src/routes`

### Workforce

- [HR management](https://github.com/tusharvarshney18/erpx-frontend/tree/main/src/routes): `src/routes`
- [Employee self-service](https://github.com/tusharvarshney18/erpx-frontend/tree/main/src/features/self-service): `src/features/self-service`
- [Self-service API](https://github.com/tusharvarshney18/erpx-frontend/blob/main/src/lib/api/self-service.ts): `src/lib/api/self-service.ts`

### Shared platform

- [API client](https://github.com/tusharvarshney18/erpx-frontend/blob/main/src/lib/api/client.ts): `src/lib/api/client.ts`
- [Access policy](https://github.com/tusharvarshney18/erpx-frontend/blob/main/src/hooks/useAccess.ts): `src/hooks/useAccess.ts`
- [Design-system layout](https://github.com/tusharvarshney18/erpx-frontend/tree/main/src/design-system/components/layout): `src/design-system/components/layout`
- [Design-system button](https://github.com/tusharvarshney18/erpx-frontend/blob/main/src/design-system/components/ui/button.tsx): `src/design-system/components/ui/button.tsx`
- [Design class utility](https://github.com/tusharvarshney18/erpx-frontend/blob/main/src/design-system/lib/cn.ts): `src/design-system/lib/cn.ts`
- [Shared UI kit](https://github.com/tusharvarshney18/erpx-frontend/tree/main/src/components/ui): `src/components/ui`

### Other components

- **Visitor**

## Connections

- Visitor → Marketing site: views (evidence: `src/routes/index.tsx`)
- Marketing site → Sign in: starts signup (evidence: `src/routes/index.tsx`)
- Sign in → Auth session: authenticates (evidence: `src/routes/auth.tsx`)
- Auth session → API client: requests auth (evidence: `src/lib/auth.tsx`)
- App router → Route registry: loads registry (evidence: `src/router.tsx`)
- Dashboard → API client: loads data (evidence: `src/features/dashboard/dashboard-page.tsx`)
- Dashboard → Auth session: reads session (evidence: `src/features/dashboard/dashboard-page.tsx`)
- Employee self-service → Self-service API: requests records (evidence: `src/features/self-service/my-attendance-page.tsx`)
- Self-service API → API client: sends requests (evidence: `src/lib/api/self-service.ts`)
- Search palette → Access policy: checks permissions (evidence: `src/components/command/SearchPalette.tsx`)
- Search palette → Auth session: reads organization (evidence: `src/components/command/SearchPalette.tsx`)
- Search palette → Shortcut targets: resolves targets (evidence: `src/components/command/SearchPalette.tsx`)
- Shortcut targets → Access policy: gets access context (evidence: `src/hooks/useShortcutTargets.ts`)
- Shortcut targets → Visible navigation: filters destinations (evidence: `src/hooks/useShortcutTargets.ts`)
- Design-system layout → Design class utility: uses class utility (evidence: `src/design-system/components/layout/org-switcher.tsx`)
- Design-system button → Design class utility: uses class utility
- Shared UI kit → Marketing site: renders interface
