# ratanak-it/fluxibiz-admin-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/ratanak-it/fluxibiz-admin-frontend
- Repository: https://github.com/ratanak-it/fluxibiz-admin-frontend

## Overview

FluxiBiz Admin Panel is a super-administrator console for governing multi-tenant commerce. Administrators authenticate through Keycloak-backed sessions, then provision businesses and subscriptions, manage platform staff and catalog policy, and monitor health, channels, notifications, and audit activity. The sampled code shows dashboard pages using RTK Query feature APIs through a same-origin gateway; session routes resolve identity and permissions. README-described capabilities are retained where implementation excerpts were unavailable; those links are documented capabilities, not claims that unsampled calls were inspected.

Main entry points: [`src/features/businessManagement/businessAdminApi.ts`](https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/features/businessManagement/businessAdminApi.ts) (Business admin API), [`src/app/(dashboard)/businesses/page.tsx`](https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/app/(dashboard)/businesses/page.tsx) (Business management), [`src/app/(dashboard)/overview/page.tsx`](https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/app/(dashboard)/overview/page.tsx) (Operations overview), [`src/app/api/v1/[...path]/route.ts`](https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/app/api/v1/%5B...path%5D/route.ts) (Same-origin API gateway)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and access"]
  node_login["Sign-in pages<br/>[page.tsx]"]
  node_session["Session context<br/>[route.ts]"]
  node_auth["Auth and tokens<br/>[keycloak-token.ts]"]
  node_permissions["Role permissions"]
  node_staff["Platform staff<br/>[page.tsx]"]
  node_staffapi["Staff and role API<br/>[platformUserApi.ts]"]
end

subgraph group_operations["Tenant operations"]
  node_tenant["Business management<br/>[page.tsx]"]
  node_provision["Business provisioning"]
  node_subscriptions["Subscriptions<br/>[page.tsx]"]
  node_businessapi["Business admin API"]
end

subgraph group_oversight["Platform oversight"]
  node_overview["Operations overview<br/>[page.tsx]"]
  node_health["Service health<br/>[healthService.ts]"]
  node_notifications["Live notifications"]
  node_audit["Audit and logs<br/>[page.tsx]"]
  node_webhooks["Webhook monitoring<br/>[page.tsx]"]
  node_export["Report export"]
end

subgraph group_catalog["Catalog and governance"]
  node_channels["Channel management<br/>[page.tsx]"]
  node_catalogui["Catalog and units<br/>[page.tsx]"]
end

subgraph group_runtime["Application runtime"]
  node_gateway["Same-origin API gateway<br/>[route.ts]"]
  node_baseapi["RTK query base<br/>[baseApi.ts]"]
  node_store["Redux store<br/>[store.ts]"]
end

node_admin(("Super admin"))
node_keycloak["Keycloak"]
node_commerce["Commerce platform services"]
node_socket["Notification socket service"]

node_admin -->|"signs in"| node_login
node_login -.->|"authenticates through"| node_keycloak
node_session -->|"resolves token"| node_auth
node_session -->|"checks roles"| node_permissions
node_admin -->|"manages tenants"| node_tenant
node_tenant -.->|"opens provisioning"| node_provision
node_provision -->|"creates business"| node_businessapi
node_tenant -.->|"queries businesses"| node_businessapi
node_admin -->|"manages plans"| node_subscriptions
node_admin -->|"manages access"| node_staff
node_staff -->|"loads staff data"| node_staffapi
node_staffapi -->|"injects endpoints"| node_baseapi
node_admin -->|"reviews metrics"| node_overview
node_overview -->|"checks services"| node_health
node_overview -->|"exports report"| node_export
node_admin -->|"governs channels"| node_channels
node_channels -->|"loads channel data"| node_businessapi
node_admin -->|"enforces catalog"| node_catalogui
node_admin -->|"monitors deliveries"| node_webhooks
node_admin -->|"reviews compliance logs"| node_audit
node_notifications -->|"queries audit logs"| node_businessapi
node_notifications -->|"subscribes live events"| node_socket
node_store -->|"registers middleware"| node_baseapi
node_baseapi -->|"sends requests"| node_gateway
node_gateway -->|"resolves bearer token"| node_auth
node_gateway -.->|"forwards API requests"| node_commerce

click node_login "https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/app/(auth)/login/page.tsx"
click node_session "https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/app/api/session-context/route.ts"
click node_auth "https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/lib/auth/keycloak-token.ts"
click node_permissions "https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/lib/permissionCatalog.ts"
click node_tenant "https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/app/(dashboard)/businesses/page.tsx"
click node_provision "https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/components/admin/CreateBusinessDialog.tsx"
click node_subscriptions "https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/app/(dashboard)/subscriptions/page.tsx"
click node_staff "https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/app/(dashboard)/users/page.tsx"
click node_staffapi "https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/features/platformUsers/platformUserApi.ts"
click node_overview "https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/app/(dashboard)/overview/page.tsx"
click node_health "https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/lib/healthService.ts"
click node_notifications "https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/lib/hook/useAdminNotifications.ts"
click node_audit "https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/app/(dashboard)/logs/audit/page.tsx"
click node_channels "https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/app/(dashboard)/channels/page.tsx"
click node_businessapi "https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/features/businessManagement/businessAdminApi.ts"
click node_catalogui "https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/app/(dashboard)/categories/page.tsx"
click node_webhooks "https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/app/(dashboard)/settings/webhooks/page.tsx"
click node_export "https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/lib/exportReportService.ts"
click node_gateway "https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/app/api/v1/%5B...path%5D/route.ts"
click node_baseapi "https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/lib/baseApi.ts"
click node_store "https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/store/store.ts"

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_login,node_session,node_auth,node_permissions,node_staff,node_staffapi toneBlue
class node_tenant,node_provision,node_subscriptions,node_businessapi toneAmber
class node_overview,node_health,node_notifications,node_audit,node_webhooks,node_export toneMint
class node_channels,node_catalogui toneRose
class node_gateway,node_baseapi,node_store,node_admin,node_keycloak,node_commerce,node_socket toneIndigo
```

## Components

### Identity and access

- [Sign-in pages](https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/app/(auth)/login/page.tsx): `src/app/(auth)/login/page.tsx`
- [Session context](https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/app/api/session-context/route.ts): `src/app/api/session-context/route.ts`
- [Auth and tokens](https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/lib/auth/keycloak-token.ts): `src/lib/auth/keycloak-token.ts`
- [Role permissions](https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/lib/permissionCatalog.ts): `src/lib/permissionCatalog.ts`
- [Platform staff](https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/app/(dashboard)/users/page.tsx): `src/app/(dashboard)/users/page.tsx`
- [Staff and role API](https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/features/platformUsers/platformUserApi.ts): `src/features/platformUsers/platformUserApi.ts`

### Tenant operations

- [Business management](https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/app/(dashboard)/businesses/page.tsx): `src/app/(dashboard)/businesses/page.tsx`
- [Business provisioning](https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/components/admin/CreateBusinessDialog.tsx): `src/components/admin/CreateBusinessDialog.tsx`
- [Subscriptions](https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/app/(dashboard)/subscriptions/page.tsx): `src/app/(dashboard)/subscriptions/page.tsx`
- [Business admin API](https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/features/businessManagement/businessAdminApi.ts): `src/features/businessManagement/businessAdminApi.ts`

### Platform oversight

- [Operations overview](https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/app/(dashboard)/overview/page.tsx): `src/app/(dashboard)/overview/page.tsx`
- [Service health](https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/lib/healthService.ts): `src/lib/healthService.ts`
- [Live notifications](https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/lib/hook/useAdminNotifications.ts): `src/lib/hook/useAdminNotifications.ts`
- [Audit and logs](https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/app/(dashboard)/logs/audit/page.tsx): `src/app/(dashboard)/logs/audit/page.tsx`
- [Webhook monitoring](https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/app/(dashboard)/settings/webhooks/page.tsx): `src/app/(dashboard)/settings/webhooks/page.tsx`
- [Report export](https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/lib/exportReportService.ts): `src/lib/exportReportService.ts`

### Catalog and governance

- [Channel management](https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/app/(dashboard)/channels/page.tsx): `src/app/(dashboard)/channels/page.tsx`
- [Catalog and units](https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/app/(dashboard)/categories/page.tsx): `src/app/(dashboard)/categories/page.tsx`

### Application runtime

- [Same-origin API gateway](https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/app/api/v1/%5B...path%5D/route.ts): `src/app/api/v1/[...path]/route.ts`
- [RTK query base](https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/lib/baseApi.ts): `src/lib/baseApi.ts`
- [Redux store](https://github.com/ratanak-it/fluxibiz-admin-frontend/blob/main/src/store/store.ts): `src/store/store.ts`

### Other components

- **Super admin**
- **Keycloak**
- **Commerce platform services**
- **Notification socket service**

## Connections

- Super admin → Sign-in pages: signs in (evidence: `README.md`)
- Sign-in pages → Keycloak: authenticates through (evidence: `README.md`)
- Session context → Auth and tokens: resolves token (evidence: `src/app/api/session-context/route.ts`)
- Session context → Role permissions: checks roles (evidence: `src/app/api/session-context/route.ts`)
- Super admin → Business management: manages tenants (evidence: `README.md`)
- Business management → Business provisioning: opens provisioning
- Business provisioning → Business admin API: creates business (evidence: `src/components/admin/CreateBusinessDialog.tsx`)
- Business management → Business admin API: queries businesses
- Super admin → Subscriptions: manages plans (evidence: `README.md`)
- Super admin → Platform staff: manages access (evidence: `README.md`)
- Platform staff → Staff and role API: loads staff data (evidence: `src/app/(dashboard)/users/page.tsx`)
- Staff and role API → RTK query base: injects endpoints (evidence: `src/features/platformUsers/platformUserApi.ts`)
- Super admin → Operations overview: reviews metrics (evidence: `README.md`)
- Operations overview → Service health: checks services (evidence: `src/app/(dashboard)/overview/page.tsx`)
- Operations overview → Report export: exports report (evidence: `src/app/(dashboard)/overview/page.tsx`)
- Super admin → Channel management: governs channels (evidence: `README.md`)
- Channel management → Business admin API: loads channel data (evidence: `src/app/(dashboard)/channels/page.tsx`)
- Super admin → Catalog and units: enforces catalog (evidence: `README.md`)
- Super admin → Webhook monitoring: monitors deliveries (evidence: `README.md`)
- Super admin → Audit and logs: reviews compliance logs (evidence: `README.md`)
- Live notifications → Business admin API: queries audit logs (evidence: `src/lib/hook/useAdminNotifications.ts`)
- Live notifications → Notification socket service: subscribes live events (evidence: `src/lib/hook/useAdminNotifications.ts`)
- Redux store → RTK query base: registers middleware (evidence: `src/store/store.ts`)
- RTK query base → Same-origin API gateway: sends requests (evidence: `src/lib/baseApi.ts`)
- Same-origin API gateway → Auth and tokens: resolves bearer token (evidence: `src/app/api/v1/[...path]/route.ts`)
- Same-origin API gateway → Commerce platform services: forwards API requests
