# vianahub-pt/vianahub.global.gerit.web architecture

> Architecture diagram of the GitHub repository vianahub-pt/vianahub.global.gerit.web, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vianahub-pt/vianahub.global.gerit.web
- Repository: https://github.com/vianahub-pt/vianahub.global.gerit.web

## Overview

VianaHub Gerit is a multi-tenant operations and administration web application. Users sign in, establish an authenticated session and active tenant, then use workspace modules to manage clients and operational resources or view dashboards; platform administrators have separate tenant, plan, subscription, and job areas. The sampled code confirms session persistence, tenant-scoped HTTP requests, and client-detail responsibilities. The README gives no capability detail, and most feature modules were not sampled, so their internal links are omitted or marked unverified rather than inferred.

Main entry points: [`platform/auth/auth-context.tsx`](https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/platform/auth/auth-context.tsx) (Auth session), [`domains/operations/clients/clients-page.tsx`](https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/domains/operations/clients/clients-page.tsx) (Client management), [`platform/storage/local-storage.ts`](https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/platform/storage/local-storage.ts) (Browser storage), [`platform/api/http/http-client.ts`](https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/platform/api/http/http-client.ts) (HTTP client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and tenancy"]
  node_login["Login screen<br/>[login-screen.tsx]"]
  node_auth["Auth session<br/>[auth-context.tsx]"]
  node_auth_api["Auth endpoints<br/>[route.ts]"]
  node_tenant["Active tenant<br/>[tenant-context.tsx]"]
  node_preferences["User preferences"]
end

subgraph group_workspace["Workspace operations"]
  node_dashboard["Dashboard"]
  node_clients["Client management<br/>[clients-page.tsx]"]
  node_client_details["Client details"]
  node_client_create["Client creation<br/>[clients-create.tsx]"]
  node_equipment["Equipment types"]
  node_actions["Actions<br/>[actions-page.tsx]"]
  node_teams["Teams<br/>[teams-page.tsx]"]
  node_users_roles["Users and roles<br/>[users-page.tsx]"]
  node_vehicles["Vehicles<br/>[vehicles-page.tsx]"]
  node_catalogs["Catalogs<br/>[index.ts]"]
end

subgraph group_admin["Platform administration"]
  node_admin_tenants["Tenant administration<br/>[index.ts]"]
  node_admin_plans["Plans and subscriptions<br/>[index.ts]"]
  node_admin_jobs["Platform jobs<br/>[index.ts]"]
end

subgraph group_platform["Application platform"]
  node_session_store[("Browser storage<br/>[local-storage.ts]")]
  node_http["HTTP client<br/>[http-client.ts]"]
  node_gerit_api["Gerit API proxy<br/>[route.ts]"]
  node_i18n["Localization"]
end

node_user(("User"))

node_user -->|"signs in"| node_login
node_login -.->|"starts session"| node_auth
node_auth -->|"requests login"| node_auth_api
node_auth -->|"persists session"| node_session_store
node_tenant -->|"stores selection"| node_session_store
node_http -->|"uses authenticated fetch"| node_auth
node_http -->|"adds tenant header"| node_tenant
node_auth_api -.->|"proxies upstream"| node_gerit_api
node_user -.->|"opens workspace"| node_dashboard
node_user -.->|"manages clients"| node_clients
node_clients -.->|"opens client"| node_client_details
node_clients -.->|"creates client"| node_client_create
node_user -.->|"manages equipment types"| node_equipment
node_user -.->|"manages actions"| node_actions
node_user -.->|"manages teams"| node_teams
node_user -.->|"manages access"| node_users_roles
node_user -.->|"manages vehicles"| node_vehicles
node_user -.->|"views catalogs"| node_catalogs
node_user -.->|"sets preferences"| node_preferences
node_user -.->|"administers tenants"| node_admin_tenants
node_user -.->|"administers plans"| node_admin_plans
node_user -.->|"views jobs"| node_admin_jobs
node_i18n -->|"reads language setting"| node_session_store

click node_login "https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/platform/auth/login-screen.tsx"
click node_auth "https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/platform/auth/auth-context.tsx"
click node_auth_api "https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/app/api/auth/login/route.ts"
click node_session_store "https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/platform/storage/local-storage.ts"
click node_tenant "https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/platform/tenant/tenant-context.tsx"
click node_http "https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/platform/api/http/http-client.ts"
click node_gerit_api "https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/app/api/gerit/%5B...path%5D/route.ts"
click node_dashboard "https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/domains/workspace/dashboard/gerit-dashboard-home.tsx"
click node_clients "https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/domains/operations/clients/clients-page.tsx"
click node_client_details "https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/domains/operations/clients/clients-details.tsx"
click node_client_create "https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/domains/operations/clients/clients-create.tsx"
click node_equipment "https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/domains/operations/equipment-types/equipment-types-page.tsx"
click node_actions "https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/domains/operations/actions/actions-page.tsx"
click node_teams "https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/domains/operations/teams/teams-page.tsx"
click node_users_roles "https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/domains/operations/users/users-page.tsx"
click node_vehicles "https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/domains/operations/vehicles/vehicles-page.tsx"
click node_catalogs "https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/domains/catalogs/index.ts"
click node_preferences "https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/domains/identity/preferences/user-preferences-page.tsx"
click node_admin_tenants "https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/domains/platform-admin/tenants/index.ts"
click node_admin_plans "https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/domains/platform-admin/subscriptions/index.ts"
click node_admin_jobs "https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/domains/platform-admin/jobs/index.ts"
click node_i18n "https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/platform/i18n/translation-context.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_login,node_auth,node_auth_api,node_tenant,node_preferences,node_user toneBlue
class node_dashboard,node_clients,node_client_details,node_client_create,node_equipment,node_actions,node_teams,node_users_roles,node_vehicles,node_catalogs toneAmber
class node_admin_tenants,node_admin_plans,node_admin_jobs toneMint
class node_session_store,node_http,node_gerit_api,node_i18n toneRose
```

## Components

### Identity and tenancy

- [Login screen](https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/platform/auth/login-screen.tsx): `platform/auth/login-screen.tsx`
- [Auth session](https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/platform/auth/auth-context.tsx): `platform/auth/auth-context.tsx`
- [Auth endpoints](https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/app/api/auth/login/route.ts): `app/api/auth/login/route.ts`
- [Active tenant](https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/platform/tenant/tenant-context.tsx): `platform/tenant/tenant-context.tsx`
- [User preferences](https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/domains/identity/preferences/user-preferences-page.tsx): `domains/identity/preferences/user-preferences-page.tsx`

### Workspace operations

- [Dashboard](https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/domains/workspace/dashboard/gerit-dashboard-home.tsx): `domains/workspace/dashboard/gerit-dashboard-home.tsx`
- [Client management](https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/domains/operations/clients/clients-page.tsx): `domains/operations/clients/clients-page.tsx`
- [Client details](https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/domains/operations/clients/clients-details.tsx): `domains/operations/clients/clients-details.tsx`
- [Client creation](https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/domains/operations/clients/clients-create.tsx): `domains/operations/clients/clients-create.tsx`
- [Equipment types](https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/domains/operations/equipment-types/equipment-types-page.tsx): `domains/operations/equipment-types/equipment-types-page.tsx`
- [Actions](https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/domains/operations/actions/actions-page.tsx): `domains/operations/actions/actions-page.tsx`
- [Teams](https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/domains/operations/teams/teams-page.tsx): `domains/operations/teams/teams-page.tsx`
- [Users and roles](https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/domains/operations/users/users-page.tsx): `domains/operations/users/users-page.tsx`
- [Vehicles](https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/domains/operations/vehicles/vehicles-page.tsx): `domains/operations/vehicles/vehicles-page.tsx`
- [Catalogs](https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/domains/catalogs/index.ts): `domains/catalogs/index.ts`

### Platform administration

- [Tenant administration](https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/domains/platform-admin/tenants/index.ts): `domains/platform-admin/tenants/index.ts`
- [Plans and subscriptions](https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/domains/platform-admin/subscriptions/index.ts): `domains/platform-admin/subscriptions/index.ts`
- [Platform jobs](https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/domains/platform-admin/jobs/index.ts): `domains/platform-admin/jobs/index.ts`

### Application platform

- [Browser storage](https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/platform/storage/local-storage.ts): `platform/storage/local-storage.ts`
- [HTTP client](https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/platform/api/http/http-client.ts): `platform/api/http/http-client.ts`
- [Gerit API proxy](https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/app/api/gerit/%5B...path%5D/route.ts): `app/api/gerit/[...path]/route.ts`
- [Localization](https://github.com/vianahub-pt/vianahub.global.gerit.web/blob/develop/platform/i18n/translation-context.tsx): `platform/i18n/translation-context.tsx`

### Other components

- **User**

## Connections

- User → Login screen: signs in
- Login screen → Auth session: starts session
- Auth session → Auth endpoints: requests login (evidence: `platform/auth/auth-context.tsx`)
- Auth session → Browser storage: persists session (evidence: `platform/auth/auth-context.tsx`)
- Active tenant → Browser storage: stores selection (evidence: `platform/tenant/tenant-context.tsx`)
- HTTP client → Auth session: uses authenticated fetch (evidence: `platform/api/http/http-client.ts`)
- HTTP client → Active tenant: adds tenant header (evidence: `platform/api/http/http-client.ts`)
- Auth endpoints → Gerit API proxy: proxies upstream
- User → Dashboard: opens workspace
- User → Client management: manages clients
- Client management → Client details: opens client
- Client management → Client creation: creates client
- User → Equipment types: manages equipment types
- User → Actions: manages actions
- User → Teams: manages teams
- User → Users and roles: manages access
- User → Vehicles: manages vehicles
- User → Catalogs: views catalogs
- User → User preferences: sets preferences
- User → Tenant administration: administers tenants
- User → Plans and subscriptions: administers plans
- User → Platform jobs: views jobs
- Localization → Browser storage: reads language setting (evidence: `platform/i18n/translation-context.tsx`)
