# zoikogroup/driverxtra-platform architecture

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

- Interactive diagram: https://gitdiagram.com/zoikogroup/driverxtra-platform
- Repository: https://github.com/zoikogroup/driverxtra-platform

## Overview

DriverXtra is an automotive commerce platform with a Next.js interface and a Django REST backend. The visible user workflow covers account registration or login, then role-specific platform screens; the frontend API client connects those screens to backend capabilities including organisations, seller onboarding, catalogue, garage, and marketplace. Backend URL configuration confirms these domain routes, while the audit writer persists audit records. Several feature modules are represented from the tree and route configuration; their internal behavior was not sampled, so their relationships are not inferred.

Main entry points: [`backend/config/urls.py`](https://github.com/zoikogroup/driverxtra-platform/blob/main/backend/config/urls.py) (Backend API routing), [`frontend/src/lib/api/client.ts`](https://github.com/zoikogroup/driverxtra-platform/blob/main/frontend/src/lib/api/client.ts) (API client), [`frontend/src/app/login/page.tsx`](https://github.com/zoikogroup/driverxtra-platform/blob/main/frontend/src/app/login/page.tsx) (Login and registration), [`frontend/src/lib/prototype-auth/auth-context.tsx`](https://github.com/zoikogroup/driverxtra-platform/blob/main/frontend/src/lib/prototype-auth/auth-context.tsx) (Prototype auth context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend experience"]
  node_auth_pages["Login and registration<br/>[page.tsx]"]
  node_auth_state["Prototype auth context<br/>[auth-context.tsx]"]
  node_api_client["API client<br/>[client.ts]"]
  node_platform_ui["Role dashboards"]
  node_garage_ui["Garage view"]
end

subgraph group_identity["Identity and tenants"]
  node_identity_api["Identity API<br/>[views.py]"]
  node_organisation_api["Organisation API<br/>[views.py]"]
end

subgraph group_seller["Seller operations"]
  node_onboarding_api["Seller onboarding<br/>[views.py]"]
  node_inventory_ui["Seller inventory"]
end

subgraph group_commerce["Vehicle commerce"]
  node_catalogue_api["Vehicle and parts catalogue<br/>[views.py]"]
  node_garage_api["Personal garage API<br/>[views.py]"]
  node_marketplace_api["Marketplace listings<br/>[views.py]"]
  node_marketplace_ui["Marketplace browse and review"]
end

subgraph group_platform["Platform services"]
  node_backend_routes["Backend API routing<br/>[urls.py]"]
  node_health["Health check<br/>[views.py]"]
  node_audit_writer["Audit writer<br/>[writer.py]"]
  node_audit_store[("Audit log records<br/>[models.py]")]
end

node_user(("Platform user"))

node_user -->|"starts session"| node_auth_pages
node_auth_pages -->|"authenticates"| node_auth_state
node_auth_state -->|"calls auth API"| node_api_client
node_auth_pages -->|"registers"| node_auth_state
node_garage_ui -->|"requests garage actions"| node_api_client
node_api_client -->|"requests API routes"| node_backend_routes
node_backend_routes -->|"routes health check"| node_health
node_backend_routes -->|"routes identity"| node_identity_api
node_backend_routes -->|"routes organisations"| node_organisation_api
node_backend_routes -->|"routes onboarding"| node_onboarding_api
node_backend_routes -->|"routes catalogue"| node_catalogue_api
node_backend_routes -->|"routes garage"| node_garage_api
node_backend_routes -->|"routes marketplace"| node_marketplace_api
node_api_client -->|"calls auth endpoints"| node_identity_api
node_api_client -->|"calls organisation endpoints"| node_organisation_api
node_api_client -->|"calls seller endpoints"| node_onboarding_api
node_api_client -->|"calls catalogue endpoints"| node_catalogue_api
node_api_client -->|"calls listing endpoints"| node_marketplace_api
node_audit_writer -->|"writes records"| node_audit_store

click node_auth_pages "https://github.com/zoikogroup/driverxtra-platform/blob/main/frontend/src/app/login/page.tsx"
click node_auth_state "https://github.com/zoikogroup/driverxtra-platform/blob/main/frontend/src/lib/prototype-auth/auth-context.tsx"
click node_api_client "https://github.com/zoikogroup/driverxtra-platform/blob/main/frontend/src/lib/api/client.ts"
click node_platform_ui "https://github.com/zoikogroup/driverxtra-platform/tree/main/frontend/src/components/platform"
click node_garage_ui "https://github.com/zoikogroup/driverxtra-platform/blob/main/frontend/src/components/platform/Phase2GarageView.tsx"
click node_identity_api "https://github.com/zoikogroup/driverxtra-platform/blob/main/backend/apps/identity/views.py"
click node_organisation_api "https://github.com/zoikogroup/driverxtra-platform/blob/main/backend/apps/organisations/views.py"
click node_onboarding_api "https://github.com/zoikogroup/driverxtra-platform/blob/main/backend/apps/onboarding/views.py"
click node_inventory_ui "https://github.com/zoikogroup/driverxtra-platform/blob/main/frontend/src/components/platform/SellerInventoryView.tsx"
click node_catalogue_api "https://github.com/zoikogroup/driverxtra-platform/blob/main/backend/apps/catalogue/views.py"
click node_garage_api "https://github.com/zoikogroup/driverxtra-platform/blob/main/backend/apps/garage/views.py"
click node_marketplace_api "https://github.com/zoikogroup/driverxtra-platform/blob/main/backend/apps/marketplace/views.py"
click node_marketplace_ui "https://github.com/zoikogroup/driverxtra-platform/blob/main/frontend/src/components/platform/MarketplaceBrowseView.tsx"
click node_backend_routes "https://github.com/zoikogroup/driverxtra-platform/blob/main/backend/config/urls.py"
click node_health "https://github.com/zoikogroup/driverxtra-platform/blob/main/backend/common/views.py"
click node_audit_writer "https://github.com/zoikogroup/driverxtra-platform/blob/main/backend/platform_core/audit/writer.py"
click node_audit_store "https://github.com/zoikogroup/driverxtra-platform/blob/main/backend/platform_core/audit/models.py"

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_auth_pages,node_auth_state,node_api_client,node_platform_ui,node_garage_ui,node_user toneBlue
class node_identity_api,node_organisation_api toneAmber
class node_onboarding_api,node_inventory_ui toneMint
class node_catalogue_api,node_garage_api,node_marketplace_api,node_marketplace_ui toneRose
class node_backend_routes,node_health,node_audit_writer,node_audit_store toneIndigo
```

## Components

### Frontend experience

- [Login and registration](https://github.com/zoikogroup/driverxtra-platform/blob/main/frontend/src/app/login/page.tsx): `frontend/src/app/login/page.tsx`
- [Prototype auth context](https://github.com/zoikogroup/driverxtra-platform/blob/main/frontend/src/lib/prototype-auth/auth-context.tsx): `frontend/src/lib/prototype-auth/auth-context.tsx`
- [API client](https://github.com/zoikogroup/driverxtra-platform/blob/main/frontend/src/lib/api/client.ts): `frontend/src/lib/api/client.ts`
- [Role dashboards](https://github.com/zoikogroup/driverxtra-platform/tree/main/frontend/src/components/platform): `frontend/src/components/platform`
- [Garage view](https://github.com/zoikogroup/driverxtra-platform/blob/main/frontend/src/components/platform/Phase2GarageView.tsx): `frontend/src/components/platform/Phase2GarageView.tsx`

### Identity and tenants

- [Identity API](https://github.com/zoikogroup/driverxtra-platform/blob/main/backend/apps/identity/views.py): `backend/apps/identity/views.py`
- [Organisation API](https://github.com/zoikogroup/driverxtra-platform/blob/main/backend/apps/organisations/views.py): `backend/apps/organisations/views.py`

### Seller operations

- [Seller onboarding](https://github.com/zoikogroup/driverxtra-platform/blob/main/backend/apps/onboarding/views.py): `backend/apps/onboarding/views.py`
- [Seller inventory](https://github.com/zoikogroup/driverxtra-platform/blob/main/frontend/src/components/platform/SellerInventoryView.tsx): `frontend/src/components/platform/SellerInventoryView.tsx`

### Vehicle commerce

- [Vehicle and parts catalogue](https://github.com/zoikogroup/driverxtra-platform/blob/main/backend/apps/catalogue/views.py): `backend/apps/catalogue/views.py`
- [Personal garage API](https://github.com/zoikogroup/driverxtra-platform/blob/main/backend/apps/garage/views.py): `backend/apps/garage/views.py`
- [Marketplace listings](https://github.com/zoikogroup/driverxtra-platform/blob/main/backend/apps/marketplace/views.py): `backend/apps/marketplace/views.py`
- [Marketplace browse and review](https://github.com/zoikogroup/driverxtra-platform/blob/main/frontend/src/components/platform/MarketplaceBrowseView.tsx): `frontend/src/components/platform/MarketplaceBrowseView.tsx`

### Platform services

- [Backend API routing](https://github.com/zoikogroup/driverxtra-platform/blob/main/backend/config/urls.py): `backend/config/urls.py`
- [Health check](https://github.com/zoikogroup/driverxtra-platform/blob/main/backend/common/views.py): `backend/common/views.py`
- [Audit writer](https://github.com/zoikogroup/driverxtra-platform/blob/main/backend/platform_core/audit/writer.py): `backend/platform_core/audit/writer.py`
- [Audit log records](https://github.com/zoikogroup/driverxtra-platform/blob/main/backend/platform_core/audit/models.py): `backend/platform_core/audit/models.py`

### Other components

- **Platform user**

## Connections

- Platform user → Login and registration: starts session (evidence: `frontend/src/app/login/page.tsx`)
- Login and registration → Prototype auth context: authenticates (evidence: `frontend/src/app/login/page.tsx`)
- Prototype auth context → API client: calls auth API (evidence: `frontend/src/lib/prototype-auth/auth-context.tsx`)
- Login and registration → Prototype auth context: registers
- Garage view → API client: requests garage actions (evidence: `frontend/src/components/platform/Phase2GarageView.tsx`)
- API client → Backend API routing: requests API routes (evidence: `frontend/src/lib/api/client.ts`)
- Backend API routing → Health check: routes health check (evidence: `backend/config/urls.py`)
- Backend API routing → Identity API: routes identity (evidence: `backend/config/urls.py`)
- Backend API routing → Organisation API: routes organisations (evidence: `backend/config/urls.py`)
- Backend API routing → Seller onboarding: routes onboarding (evidence: `backend/config/urls.py`)
- Backend API routing → Vehicle and parts catalogue: routes catalogue (evidence: `backend/config/urls.py`)
- Backend API routing → Personal garage API: routes garage (evidence: `backend/config/urls.py`)
- Backend API routing → Marketplace listings: routes marketplace (evidence: `backend/config/urls.py`)
- API client → Identity API: calls auth endpoints (evidence: `frontend/src/lib/api/client.ts`)
- API client → Organisation API: calls organisation endpoints (evidence: `frontend/src/lib/api/client.ts`)
- API client → Seller onboarding: calls seller endpoints (evidence: `frontend/src/lib/api/client.ts`)
- API client → Vehicle and parts catalogue: calls catalogue endpoints (evidence: `frontend/src/lib/api/client.ts`)
- API client → Marketplace listings: calls listing endpoints (evidence: `frontend/src/lib/api/client.ts`)
- Audit writer → Audit log records: writes records (evidence: `backend/platform_core/audit/writer.py`)
