Feature: Vertex Platform Architecture Abstraction & Template Extraction - #3584
Conversation
…h configuration details
Replace placeholder AirQo adapter stubs with real API bindings (devices, sites, users, networks), including getCurrentUser, login, device/site/network operations and maintenance hooks. Update mock adapter to add a login endpoint, simplify device/site handling, adjust responses and pagination, and remove several cohort/site/readings-specific mock helpers. Align VertexAdapter types with the implemented surface: add LoginCredentials/login, simplify getDeviceCount params, move deploy/recall signatures, and remove several deprecated cohort/site/reading methods to match the concrete implementations.
Introduce a unified airqoAdapter that spreads core API modules (devices, sites, cohorts, networks, users, grids, organizations, permissions, roles) and binds feedback methods; replace createMockAdapter with a mockAdapter that proxies unimplemented methods to return generic mock responses. Update adapter types to derive VertexAdapter from the actual API modules and keep legacy overrides for common method names. Update adapter index to return the new adapters and switch multiple hooks (devices, grids, networks, roles, sites) to use the centralized adapter instead of importing API modules directly. This centralizes API surface, simplifies mocking, and avoids importing individual API modules across hooks.
Replace hardcoded AirQo strings/assets with centralized vertexConfig values and add feature flags and theming support. Updated components and pages to use vertexConfig.org properties (logo, name, shortName, supportEmail, websiteUrl, primaryColor) for branding and contact links. RootLayout metadata now derives title/OG/twitter info from vertexConfig and converts primaryColor to RGB for a --primary CSS variable. Primary sidebar menu items (network requests, sites, grids, shipping) are now conditionally rendered based on vertexConfig.features. Files changed: auth-error, layout, login page, DownloadHero, desktop-titlebar, primary-sidebar, and topbar.
Swap out hard-coded blue Tailwind classes for theme 'primary' variants across several UI components to align with the app's primary color token. Changes touch cohorts page, device activity items, organization modal, shipping batches table, NavItem, primary sidebar, and table export modal — updating button/bg/icon/text/badge/skeleton colors and focus/ring classes. No functional logic was changed; this is a visual/theme update to centralize color usage.
Add a full Vertex (Next.js) web app scaffold under src/vertex-template. This commit introduces app pages, UI components, feature modules (devices, networks, cohorts, grids, shipping, sites), hooks, core services, Redux slices, API routes, types, config files (.eslintrc, .prettierrc, tailwind, next.config, tsconfig), Dockerfile, env example, README and various utilities to bootstrap the AirQo device & network management web application. The template includes route guards, permission constants, and client/server helpers to support development and production builds.
|
Important Review skippedToo many files! This PR contains 295 files, which is 145 over the limit of 150. To get a review, narrow the scope: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (5)
📒 Files selected for processing (295)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
New azure vertex changes available for preview here |
|
@coderabbitai review --dir src/vertex |
|
🧠 Learnings used✅ Action performedReview finished.
|
📝 Description
This PR introduces foundational architectural changes to transform the AirQo application into a highly customizable, white-label platform for deployment of devices and data sharing (Vertex). It abstracts away hardcoded backend dependencies, centralizes configuration, enables dynamic theming, and provides a clean boilerplate template for bootstrapping new applications.
🚀 Key Changes & New Features
1. API Abstraction & Adapter Pattern
VertexAdapterinterface.airqo(production) andmock(development/template) adapters.useDevices,useCohorts,useSites, etc.) to resolve their API calls dynamically through the active adapter.2. Centralized Configuration System
vertex.config.tsbacked by Zod validation to serve as the single source of truth for application settings.siteManagement,shipping,deviceMap, etc.).3. Dynamic Theming & Branding
--primaryCSS variable system.4. Standalone Vertex Template
vertex-templatedirectory.mockadapter and an initialized v1.0.0 changelog, ready to be safely cloned for new tenant applications.🛠️ Testing Instructions
airqoadapter in standard environments.mockadapter and verify that the UI falls back to fixture data.primaryColorhex value invertex.config.tsand ensure the active UI elements across the application (Navigation, Modals, Tables) reflect the new branding.src/vertex-templateand runnpm run buildto verify the standalone template compiles cleanly.🔗 Related Issues