# kunzzgroups/aiosnova architecture

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

- Interactive diagram: https://gitdiagram.com/kunzzgroups/aiosnova
- Repository: https://github.com/kunzzgroups/aiosnova

## Overview

AIOS Auth Frontend is a React application for sign-in, session management, and core identity administration, with mock APIs used for frontend development. The main workflow is browser navigation through guest/protected routes, authentication and optional MFA, then authenticated identity management through API services. Session state and shared request handling form the internal layer. The README documents mock OAuth, password recovery, and the token/cookie model; some routes and pages are represented at their existing source paths because their implementation was not sampled.

Main entry points: [`src/main.tsx`](https://github.com/kunzzgroups/aiosnova/blob/main/src/main.tsx) (App bootstrap), [`src/modules/core/auth/services/authService.ts`](https://github.com/kunzzgroups/aiosnova/blob/main/src/modules/core/auth/services/authService.ts) (Auth service), [`src/routes/router.tsx`](https://github.com/kunzzgroups/aiosnova/blob/main/src/routes/router.tsx) (Route dispatch), [`src/layouts/AppShell.tsx`](https://github.com/kunzzgroups/aiosnova/blob/main/src/layouts/AppShell.tsx) (App shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_bootstrap["App bootstrap<br/>[main.tsx]"]
  node_router["Route dispatch<br/>[router.tsx]"]
  node_shell["App shell<br/>[AppShell.tsx]"]
  node_sidebar["Navigation sidebar<br/>[Sidebar.tsx]"]
end

subgraph group_auth["Authentication"]
  node_authpages["Auth pages"]
  node_authservice["Auth service<br/>[authService.ts]"]
  node_session["Session hook<br/>[useSession.ts]"]
end

subgraph group_identity["Identity administration"]
  node_identitypages["Identity pages"]
  node_identityservice["Identity service<br/>[identityService.ts]"]
end

subgraph group_shared["Shared application services"]
  node_authstate[("Auth state<br/>[authStore.ts]")]
  node_http["HTTP client<br/>[httpClient.ts]"]
  node_companystate[("Company state<br/>[companyStore.ts]")]
  node_locale[("Language preference<br/>[localeStore.ts]")]
  node_theme[("Theme preference<br/>[themeStore.ts]")]
  node_toast["Toast notifications<br/>[Toast.tsx]"]
end

node_browser(("User browser"))
node_mockapi{{"Mock API"}}

node_browser -->|"opens app"| node_bootstrap
node_bootstrap -->|"hydrates session"| node_authservice
node_bootstrap -->|"renders app"| node_router
node_router -->|"routes auth"| node_authpages
node_router -->|"routes protected"| node_shell
node_shell -->|"renders navigation"| node_sidebar
node_router -->|"routes identity"| node_identitypages
node_authpages -->|"invokes auth"| node_authservice
node_authservice -->|"sends requests"| node_http
node_authservice -->|"updates session"| node_authstate
node_http -->|"refreshes session"| node_authstate
node_http -.->|"requests API"| node_mockapi
node_session -->|"reads session"| node_authstate
node_sidebar -->|"logs out"| node_authservice
node_sidebar -->|"loads companies"| node_identityservice
node_identitypages -.->|"manages records"| node_identityservice
node_identityservice -->|"sends requests"| node_http
node_sidebar -->|"reads and updates"| node_companystate
node_shell -->|"shows theme control"| node_theme
node_shell -->|"shows language control"| node_locale
node_bootstrap -->|"applies theme"| node_theme
node_bootstrap -->|"renders notifications"| node_toast

click node_bootstrap "https://github.com/kunzzgroups/aiosnova/blob/main/src/main.tsx"
click node_router "https://github.com/kunzzgroups/aiosnova/blob/main/src/routes/router.tsx"
click node_authpages "https://github.com/kunzzgroups/aiosnova/tree/main/src/modules/core/auth/pages"
click node_authservice "https://github.com/kunzzgroups/aiosnova/blob/main/src/modules/core/auth/services/authService.ts"
click node_session "https://github.com/kunzzgroups/aiosnova/blob/main/src/modules/core/auth/hooks/useSession.ts"
click node_authstate "https://github.com/kunzzgroups/aiosnova/blob/main/src/stores/authStore.ts"
click node_http "https://github.com/kunzzgroups/aiosnova/blob/main/src/services/httpClient.ts"
click node_shell "https://github.com/kunzzgroups/aiosnova/blob/main/src/layouts/AppShell.tsx"
click node_sidebar "https://github.com/kunzzgroups/aiosnova/blob/main/src/components/navigation/Sidebar.tsx"
click node_identitypages "https://github.com/kunzzgroups/aiosnova/tree/main/src/modules/core/identity/pages"
click node_identityservice "https://github.com/kunzzgroups/aiosnova/blob/main/src/modules/core/identity/services/identityService.ts"
click node_companystate "https://github.com/kunzzgroups/aiosnova/blob/main/src/stores/companyStore.ts"
click node_locale "https://github.com/kunzzgroups/aiosnova/blob/main/src/stores/localeStore.ts"
click node_theme "https://github.com/kunzzgroups/aiosnova/blob/main/src/stores/themeStore.ts"
click node_toast "https://github.com/kunzzgroups/aiosnova/blob/main/src/components/ui/Toast.tsx"

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_bootstrap,node_router,node_shell,node_sidebar,node_browser toneBlue
class node_authpages,node_authservice,node_session toneAmber
class node_identitypages,node_identityservice,node_mockapi toneMint
class node_authstate,node_http,node_companystate,node_locale,node_theme,node_toast toneRose
```

## Components

### Application entry

- [App bootstrap](https://github.com/kunzzgroups/aiosnova/blob/main/src/main.tsx): `src/main.tsx`
- [Route dispatch](https://github.com/kunzzgroups/aiosnova/blob/main/src/routes/router.tsx): `src/routes/router.tsx`
- [App shell](https://github.com/kunzzgroups/aiosnova/blob/main/src/layouts/AppShell.tsx): `src/layouts/AppShell.tsx`
- [Navigation sidebar](https://github.com/kunzzgroups/aiosnova/blob/main/src/components/navigation/Sidebar.tsx): `src/components/navigation/Sidebar.tsx`

### Authentication

- [Auth pages](https://github.com/kunzzgroups/aiosnova/tree/main/src/modules/core/auth/pages): `src/modules/core/auth/pages`
- [Auth service](https://github.com/kunzzgroups/aiosnova/blob/main/src/modules/core/auth/services/authService.ts): `src/modules/core/auth/services/authService.ts`
- [Session hook](https://github.com/kunzzgroups/aiosnova/blob/main/src/modules/core/auth/hooks/useSession.ts): `src/modules/core/auth/hooks/useSession.ts`

### Identity administration

- [Identity pages](https://github.com/kunzzgroups/aiosnova/tree/main/src/modules/core/identity/pages): `src/modules/core/identity/pages`
- [Identity service](https://github.com/kunzzgroups/aiosnova/blob/main/src/modules/core/identity/services/identityService.ts): `src/modules/core/identity/services/identityService.ts`

### Shared application services

- [Auth state](https://github.com/kunzzgroups/aiosnova/blob/main/src/stores/authStore.ts): `src/stores/authStore.ts`
- [HTTP client](https://github.com/kunzzgroups/aiosnova/blob/main/src/services/httpClient.ts): `src/services/httpClient.ts`
- [Company state](https://github.com/kunzzgroups/aiosnova/blob/main/src/stores/companyStore.ts): `src/stores/companyStore.ts`
- [Language preference](https://github.com/kunzzgroups/aiosnova/blob/main/src/stores/localeStore.ts): `src/stores/localeStore.ts`
- [Theme preference](https://github.com/kunzzgroups/aiosnova/blob/main/src/stores/themeStore.ts): `src/stores/themeStore.ts`
- [Toast notifications](https://github.com/kunzzgroups/aiosnova/blob/main/src/components/ui/Toast.tsx): `src/components/ui/Toast.tsx`

### Other components

- **User browser**
- **Mock API**

## Connections

- User browser → App bootstrap: opens app (evidence: `src/main.tsx`)
- App bootstrap → Auth service: hydrates session (evidence: `src/main.tsx`)
- App bootstrap → Route dispatch: renders app
- Route dispatch → Auth pages: routes auth (evidence: `src/routes/router.tsx`)
- Route dispatch → App shell: routes protected (evidence: `src/routes/router.tsx`)
- App shell → Navigation sidebar: renders navigation (evidence: `src/layouts/AppShell.tsx`)
- Route dispatch → Identity pages: routes identity (evidence: `src/routes/router.tsx`)
- Auth pages → Auth service: invokes auth (evidence: `src/modules/core/auth/pages/OAuthCallbackPage.tsx`)
- Auth service → HTTP client: sends requests (evidence: `src/modules/core/auth/services/authService.ts`)
- Auth service → Auth state: updates session (evidence: `src/modules/core/auth/services/authService.ts`)
- HTTP client → Auth state: refreshes session (evidence: `src/services/httpClient.ts`)
- HTTP client → Mock API: requests API
- Session hook → Auth state: reads session (evidence: `src/modules/core/auth/hooks/useSession.ts`)
- Navigation sidebar → Auth service: logs out (evidence: `src/components/navigation/Sidebar.tsx`)
- Navigation sidebar → Identity service: loads companies (evidence: `src/components/navigation/Sidebar.tsx`)
- Identity pages → Identity service: manages records (evidence: `src/modules/core/identity/pages/UserDetailPage.tsx`)
- Identity service → HTTP client: sends requests (evidence: `src/modules/core/identity/services/identityService.ts`)
- Navigation sidebar → Company state: reads and updates (evidence: `src/components/navigation/Sidebar.tsx`)
- App shell → Theme preference: shows theme control (evidence: `src/layouts/AppShell.tsx`)
- App shell → Language preference: shows language control (evidence: `src/layouts/AppShell.tsx`)
- App bootstrap → Theme preference: applies theme (evidence: `src/main.tsx`)
- App bootstrap → Toast notifications: renders notifications
