# airqo-platform/airqo-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/airqo-platform/airqo-frontend
- Repository: https://github.com/airqo-platform/airqo-frontend

## Overview

1. **This is a frontend monorepo, not a single app.**  
   The `src/` directory contains multiple independently deployable client applications plus shared patterns and templates. The repo also includes deployment manifests, CI/CD workflows, and docs for operating the frontend fleet.

2. **The main product surfaces are split by audience and use case.**  
   - `src/website`: public marketing/content website  
   - `src/platform`: main analytics and self-service platform for individuals and organizations  
   - `src/vertex`: operational device/network management app, with extra admin and shipping flows  
   - `src/vertex-desktop`: Electron wrapper around Vertex for desktop/native integration  
   - `src/mobile`: Flutter mobile app  
   - `src/beacon`, `src/calibrate`: smaller product-specific web tools  
   - `src/docs-website`: Docusaurus-based documentation site

3. **Most web apps follow the same high-level layering.**  
   Routes and page shells live in the app router (`app/`), while business functionality is organized into feature modules (`features/`, `modules/`, or domain folders). Shared UI primitives, hooks, services, and utilities are split out into `components/`, `shared/`, `core/`, `lib/`, and `services/` depending on the app.

4. **`src/platform` and `src/vertex` are the core business applications.**  
   They contain the richest domain logic: auth, dashboards, organizations, users, sites, devices, cohorts, roles/permissions, data export, data visualization, feedback, and map-based views. Vertex extends the platform model with more operational workflows like grids and shipping. Both use layered abstractions for API access, RBAC, layouts, and state management.

5. **A key architectural boundary is the API proxy layer.**  
   The Next.js apps expose internal routes under `app/api/...` that proxy or wrap calls to upstream AirQo APIs and external services. This isolates frontend code from backend URL details, centralizes auth/session handling, and enables server-side integration for things like Cloudinary uploads, Slack notifications, and generic external API forwarding.

6. **Auth and authorization are cross-cutting concerns.**  
   The platform/vertex apps have dedicated auth routes, session utilities, route guards, permission guards, and RBAC helpers. These determine which layouts, pages, and actions are available for different user roles and contexts. The architecture clearly separates public pages, authenticated dashboards, and admin/system pages.

7. **State management is intentionally centralized for complex domains.**  
   Platform/Vertex use combinations of Redux slices, query providers, and custom hooks to manage server data and UI state. Feature-specific hooks often sit next to domain modules, while shared stores handle cross-page concerns such as user context, selected locations, cohorts, devices, map settings, and theme preferences.

8. **The public website is content- and SEO-heavy rather than app-heavy.**  
   `src/website` is structured around content pages, marketing sections, and editorial/program pages. It includes strong support for analytics, localization, SEO metadata, sitemap/robots, and safe rendering. It also exposes a few API routes for geocoding, translation, logging, and versioned external access.

9. **`src/mobile` is a separate Flutter client with its own architecture.**  
   It uses the usual Flutter boundaries: `lib/src/app/...` split into blocs/cubits, repositories, services, widgets, and models. Its main domains are authentication, dashboard/forecast, exposure, maps, learn, surveys, profile, notifications, and shared utilities. It also integrates Firebase, secure storage, Hive, and push/logging helpers.

10. **`src/vertex-desktop` is a native shell, not just another UI.**  
   The Electron app adds desktop-specific responsibilities: auth windows, deep links, update management, permissions, menus, and preload APIs. This wrapper sits around the web experience and handles native platform concerns that do not belong in the browser app.

11. **`src/docs-website` and `src/beacon`/`src/calibrate` are focused, standalone frontends.**  
   The docs site is Docusaurus content with product documentation and API guides. Beacon and Calibrate are smaller operational apps with their own Next.js/React stacks and deployment configs, each using the same general pattern of page routes, services, and UI components.

12. **Infrastructure is first-class in this repo.**  
   `k8s/` contains Helm charts for core deployables like platform, vertex, beacon, calibrate, and docs-website, including stage/prod values and AKS-specific overlays. The repo’s GitHub Actions workflows cover CI, code quality, previews, production deployments, Android release flows, and Firebase App Distribution.

13. **The repo is optimized for multi-environment delivery.**  
   Many apps have `.env` examples, Dockerfiles, docker-compose files, and environment-aware config layers. This supports local development, containerized builds, Kubernetes deployment, and platform-specific release channels without changing application code paths.

14. **For an architecture diagram, the most important system boundary is “client app → service layer → API/external services.”**  
   Each app’s UI layer talks to domain services/hooks/repositories, which in turn call internal API routes, upstream AirQo backend APIs, or third-party services such as Firebase, Cloudinary, Slack, analytics tools, and map/geocoding providers. That boundary is repeated across the web, desktop, and mobile clients, even though the UI technologies differ.

Main entry points: [`src/vertex`](https://github.com/airqo-platform/airqo-frontend/tree/staging/src/vertex) (Vertex), [`src/platform`](https://github.com/airqo-platform/airqo-frontend/tree/staging/src/platform) (Platform), [`src/website`](https://github.com/airqo-platform/airqo-frontend/tree/staging/src/website) (Website), [`.github/workflows`](https://github.com/airqo-platform/airqo-frontend/blob/staging/.github/workflows) (CI/CD workflows)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_group_frontends["Client apps"]
  node_website["Website<br/>Next.js marketing site"]
  node_platform["Platform<br/>Next.js analytics app"]
  node_vertex["Vertex<br/>Next.js ops app"]
  node_beacon["Beacon<br/>Next.js ops tool"]
  node_calibrate["Calibrate<br/>React calibrator"]
  node_docs_site["Docs site<br/>Docusaurus docs"]
end

subgraph group_group_shared["Shared frontend systems"]
  node_vertex_template["Vertex template<br/>Next.js scaffold"]
  node_website_features["Site features<br/>content modules"]
  node_website_services["Site services<br/>content/data layer"]
  node_website_api[("Site API routes<br/>edge proxy")]
  node_platform_modules["Platform modules<br/>domain modules"]
  node_platform_shared["Platform shared<br/>shared core"]
  node_platform_api[("Platform API<br/>proxy layer")]
  node_vertex_core["Vertex core<br/>domain core"]
  node_vertex_features["Vertex features<br/>feature modules"]
  node_vertex_api[("Vertex API<br/>proxy layer")]
end

subgraph group_group_mobile["Mobile"]
  node_mobile_app["Mobile app<br/>Flutter client"]
end

subgraph group_group_desktop["Desktop"]
  node_desktop_shell["Vertex desktop<br/>Electron shell"]
  node_desktop_main["Desktop main<br/>Electron main"]
  node_desktop_preload["Preload API<br/>desktop bridge"]
end

subgraph group_group_infra["Delivery and ops"]
  node_infra_k8s[("K8s charts<br/>helm deploy")]
  node_infra_ci[("CI/CD workflows<br/>github actions<br/>[workflows]")]
  node_repo_docs["Repo docs<br/>operating docs"]
end

node_repo["Frontend monorepo"]

node_repo -->|"contains"| node_website
node_repo -->|"contains"| node_platform
node_repo -->|"contains"| node_vertex
node_repo -->|"contains"| node_vertex_template
node_repo -->|"contains"| node_beacon
node_repo -->|"contains"| node_calibrate
node_repo -->|"contains"| node_docs_site
node_repo -->|"contains"| node_mobile_app
node_repo -->|"contains"| node_desktop_shell
node_website -->|"renders"| node_website_features
node_website -->|"fetches"| node_website_services
node_website -->|"exposes"| node_website_api
node_platform -->|"composes"| node_platform_modules
node_platform -->|"reuses"| node_platform_shared
node_platform -->|"proxies"| node_platform_api
node_vertex -->|"composes"| node_vertex_features
node_vertex -->|"reuses"| node_vertex_core
node_vertex -->|"proxies"| node_vertex_api
node_vertex -.->|"wrapped by"| node_desktop_shell
node_desktop_shell -->|"implements"| node_desktop_main
node_desktop_shell -->|"bridges"| node_desktop_preload
node_infra_k8s -->|"deploys"| node_platform
node_infra_k8s -->|"deploys"| node_vertex
node_infra_k8s -->|"deploys"| node_website
node_infra_ci -->|"builds"| node_website
node_infra_ci -->|"builds"| node_platform
node_infra_ci -->|"builds"| node_vertex
node_infra_ci -->|"releases"| node_mobile_app
node_repo_docs -.->|"documents"| node_platform
node_repo_docs -.->|"documents"| node_vertex_template

click node_website "https://github.com/airqo-platform/airqo-frontend/tree/staging/src/website"
click node_platform "https://github.com/airqo-platform/airqo-frontend/tree/staging/src/platform"
click node_vertex "https://github.com/airqo-platform/airqo-frontend/tree/staging/src/vertex"
click node_vertex_template "https://github.com/airqo-platform/airqo-frontend/tree/staging/src/vertex-template"
click node_beacon "https://github.com/airqo-platform/airqo-frontend/tree/staging/src/beacon"
click node_calibrate "https://github.com/airqo-platform/airqo-frontend/tree/staging/src/calibrate"
click node_docs_site "https://github.com/airqo-platform/airqo-frontend/tree/staging/src/docs-website"
click node_mobile_app "https://github.com/airqo-platform/airqo-frontend/tree/staging/src/mobile"
click node_desktop_shell "https://github.com/airqo-platform/airqo-frontend/tree/staging/src/vertex-desktop"
click node_website_features "https://github.com/airqo-platform/airqo-frontend/tree/staging/src/website/src/features"
click node_website_services "https://github.com/airqo-platform/airqo-frontend/tree/staging/src/website/src/services"
click node_website_api "https://github.com/airqo-platform/airqo-frontend/tree/staging/src/website/src/app/api"
click node_platform_modules "https://github.com/airqo-platform/airqo-frontend/tree/staging/src/platform/src/modules"
click node_platform_shared "https://github.com/airqo-platform/airqo-frontend/tree/staging/src/platform/src/shared"
click node_platform_api "https://github.com/airqo-platform/airqo-frontend/tree/staging/src/platform/src/app/api"
click node_vertex_core "https://github.com/airqo-platform/airqo-frontend/tree/staging/src/vertex/core"
click node_vertex_features "https://github.com/airqo-platform/airqo-frontend/tree/staging/src/vertex/components/features"
click node_vertex_api "https://github.com/airqo-platform/airqo-frontend/tree/staging/src/vertex/app/api"
click node_desktop_main "https://github.com/airqo-platform/airqo-frontend/tree/staging/src/vertex-desktop/main"
click node_desktop_preload "https://github.com/airqo-platform/airqo-frontend/tree/staging/src/vertex-desktop/preload"
click node_infra_k8s "https://github.com/airqo-platform/airqo-frontend/tree/staging/k8s"
click node_infra_ci "https://github.com/airqo-platform/airqo-frontend/blob/staging/.github/workflows"
click node_repo_docs "https://github.com/airqo-platform/airqo-frontend/tree/staging/docs"

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_website,node_platform,node_vertex,node_beacon,node_calibrate,node_docs_site toneBlue
class node_vertex_template,node_website_features,node_website_services,node_website_api,node_platform_modules,node_platform_shared,node_platform_api,node_vertex_core,node_vertex_features,node_vertex_api toneAmber
class node_mobile_app toneMint
class node_desktop_shell,node_desktop_main,node_desktop_preload toneRose
class node_infra_k8s,node_infra_ci,node_repo_docs toneIndigo
class node_repo toneNeutral
```

## Components

### Client apps

Deployable frontend applications and app templates under src/

- [Website](https://github.com/airqo-platform/airqo-frontend/tree/staging/src/website): Next.js marketing site · Public content, SEO, and product storytelling site · `src/website`
- [Platform](https://github.com/airqo-platform/airqo-frontend/tree/staging/src/platform): Next.js analytics app · Core self-service and analytics product for individuals and organizations · `src/platform`
- [Vertex](https://github.com/airqo-platform/airqo-frontend/tree/staging/src/vertex): Next.js ops app · Operational device, network, cohort, grid, and shipping application · `src/vertex`
- [Beacon](https://github.com/airqo-platform/airqo-frontend/tree/staging/src/beacon): Next.js ops tool · Smaller device and maintenance-focused web application · `src/beacon`
- [Calibrate](https://github.com/airqo-platform/airqo-frontend/tree/staging/src/calibrate): React calibrator · Standalone calibration tool with its own client stack · `src/calibrate`
- [Docs site](https://github.com/airqo-platform/airqo-frontend/tree/staging/src/docs-website): Docusaurus docs · Product and API documentation website · `src/docs-website`

### Shared frontend systems

Reusable architecture, services, and cross-app primitives

- [Vertex template](https://github.com/airqo-platform/airqo-frontend/tree/staging/src/vertex-template): Next.js scaffold · Reusable template and adapter foundation for Vertex-style apps · `src/vertex-template`
- [Site features](https://github.com/airqo-platform/airqo-frontend/tree/staging/src/website/src/features): content modules · Marketing pages, product pages, solutions, and program content · `src/website/src/features`
- [Site services](https://github.com/airqo-platform/airqo-frontend/tree/staging/src/website/src/services): content/data layer · Website API clients, external integrations, and content services · `src/website/src/services`
- [Site API routes](https://github.com/airqo-platform/airqo-frontend/tree/staging/src/website/src/app/api): edge proxy · Next.js routes for geocoding, translation, logging, and versioned API forwarding · `src/website/src/app/api`
- [Platform modules](https://github.com/airqo-platform/airqo-frontend/tree/staging/src/platform/src/modules): domain modules · Analytics, map, data export, billing, themes, and profile features · `src/platform/src/modules`
- [Platform shared](https://github.com/airqo-platform/airqo-frontend/tree/staging/src/platform/src/shared): shared core · Reusable UI, hooks, services, stores, layouts, auth, and utilities · `src/platform/src/shared`
- [Platform API](https://github.com/airqo-platform/airqo-frontend/tree/staging/src/platform/src/app/api): proxy layer · Internal routes that proxy auth, cloudinary, slack, and external APIs · `src/platform/src/app/api`
- [Vertex core](https://github.com/airqo-platform/airqo-frontend/tree/staging/src/vertex/core): domain core · Adapters, auth, permissions, config, hooks, redux, services, and utilities · `src/vertex/core`
- [Vertex features](https://github.com/airqo-platform/airqo-frontend/tree/staging/src/vertex/components/features): feature modules · Admin and user-facing workflows for devices, cohorts, sites, networks, grids, shipping, and feedback · `src/vertex/components/features`
- [Vertex API](https://github.com/airqo-platform/airqo-frontend/tree/staging/src/vertex/app/api): proxy layer · Internal routes that wrap auth, cloudinary, slack, and backend forwarding · `src/vertex/app/api`

### Mobile

Flutter mobile client

- [Mobile app](https://github.com/airqo-platform/airqo-frontend/tree/staging/src/mobile): Flutter client · Native mobile application with bloc-driven feature modules · `src/mobile`

### Desktop

Electron wrapper for the Vertex web experience

- [Vertex desktop](https://github.com/airqo-platform/airqo-frontend/tree/staging/src/vertex-desktop): Electron shell · Desktop wrapper around Vertex with native integration · `src/vertex-desktop`
- [Desktop main](https://github.com/airqo-platform/airqo-frontend/tree/staging/src/vertex-desktop/main): Electron main · Windows, auth, deep links, menus, permissions, and updates · `src/vertex-desktop/main`
- [Preload API](https://github.com/airqo-platform/airqo-frontend/tree/staging/src/vertex-desktop/preload): desktop bridge · Preload layer exposing safe APIs to the renderer · `src/vertex-desktop/preload`

### Delivery and ops

Kubernetes, CI/CD, and repository-level operational assets

- [K8s charts](https://github.com/airqo-platform/airqo-frontend/tree/staging/k8s): helm deploy · Helm charts and environment overlays for frontend deployments · `k8s`
- [CI/CD workflows](https://github.com/airqo-platform/airqo-frontend/blob/staging/.github/workflows): github actions · Build, preview, deploy, release, and quality workflows for all frontends · `.github/workflows`
- [Repo docs](https://github.com/airqo-platform/airqo-frontend/tree/staging/docs): operating docs · Repository-level guidance for roles, operating model, and contributions · `docs`

### Other components

- **Frontend monorepo**: monorepo · Multi-app frontend repository with web, mobile, desktop, and deployment assets

## Connections

- Frontend monorepo → Website: contains · Monorepo includes the public website client
- Frontend monorepo → Platform: contains · Monorepo includes the core platform client
- Frontend monorepo → Vertex: contains · Monorepo includes the Vertex operations client
- Frontend monorepo → Vertex template: contains · Monorepo includes the reusable Vertex template
- Frontend monorepo → Beacon: contains · Monorepo includes the Beacon client
- Frontend monorepo → Calibrate: contains · Monorepo includes the Calibrate client
- Frontend monorepo → Docs site: contains · Monorepo includes the docs website
- Frontend monorepo → Mobile app: contains · Monorepo includes the Flutter mobile app
- Frontend monorepo → Vertex desktop: contains · Monorepo includes the Electron desktop shell
- Website → Site features: renders · Route-driven pages are assembled from feature modules
- Website → Site services: fetches · Content and utility data comes from service layer
- Website → Site API routes: exposes · Website provides internal API routes for geocoding, translation, logging, and forwarding
- Platform → Platform modules: composes · App routes assemble product domain modules
- Platform → Platform shared: reuses · Shared core provides UI, hooks, state, and services
- Platform → Platform API: proxies · Platform isolates backend and third-party calls behind API routes
- Vertex → Vertex features: composes · App routes assemble operational feature modules
- Vertex → Vertex core: reuses · Core layer provides app-wide contracts, auth, state, and utilities
- Vertex → Vertex API: proxies · Vertex isolates backend and third-party calls behind API routes
- Vertex → Vertex desktop: wrapped by · Desktop app wraps the Vertex experience for native platform concerns
- Vertex desktop → Desktop main: implements · Main process owns windows, updates, menus, and deep links
- Vertex desktop → Preload API: bridges · Preload layer exposes safe desktop APIs to the renderer
- K8s charts → Platform: deploys · Helm charts define platform runtime deployment
- K8s charts → Vertex: deploys · Helm charts define Vertex runtime deployment
- K8s charts → Website: deploys · Helm charts define website deployment
- CI/CD workflows → Website: builds · Workflows cover website CI and deployment
- CI/CD workflows → Platform: builds · Workflows cover platform CI and deployment
- CI/CD workflows → Vertex: builds · Workflows cover Vertex CI, performance, and release flows
- CI/CD workflows → Mobile app: releases · Workflows cover Android release and Firebase distribution
- Repo docs → Platform: documents · Repo docs capture platform architecture and operations
- Repo docs → Vertex template: documents · Repo docs capture template contracts and coupling guidance
