# hoangphatdev/drivex architecture

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

- Interactive diagram: https://gitdiagram.com/hoangphatdev/drivex
- Repository: https://github.com/hoangphatdev/drivex

## Overview

DriveX is a React UI prototype for a Vietnamese used-car marketplace, not a production service: its data and interactions live in client-side state. Users enter through a role-switchable app shell, browse and inspect listings, estimate on-road costs, and can follow buyer, seller, or admin workflows for wishlists, appointments, listing submission, moderation, and master data. The graph shows documented product capabilities alongside sampled implementation; backend persistence, real authentication, and external services are absent.

Main entry points: [`apps/prototype/src/App.jsx`](https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/App.jsx) (App shell and state), [`apps/prototype/src/components/CarCard.jsx`](https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/components/CarCard.jsx) (Vehicle cards), [`apps/prototype/src/components/StatusBadge.jsx`](https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/components/StatusBadge.jsx) (Status badges), [`apps/prototype/src/utils/formatters.js`](https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/utils/formatters.js) (Formatting and fees)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App orchestration"]
  node_app["App shell and state<br/>[App.jsx]"]
  node_entry["React entry point<br/>[main.jsx]"]
end

subgraph group_discovery["Vehicle discovery"]
  node_marketplace["Marketplace search"]
  node_filters["Search filters<br/>[FilterSidebar.jsx]"]
  node_vehicle["Vehicle details"]
  node_calculator["On-road estimator"]
end

subgraph group_transactions["Buyer and seller workflows"]
  node_auth["Account and profile"]
  node_buyer["Buyer dashboard"]
  node_booking["Appointment dialogs<br/>[Modals.jsx]"]
  node_seller["Seller inventory"]
  node_listing["Listing editor"]
  node_storefront["Seller storefront"]
end

subgraph group_governance["Marketplace administration"]
  node_moderation["Listing moderation"]
  node_master["Master data"]
end

subgraph group_shared["Shared UI and data"]
  node_navbar["Role navigation<br/>[Navbar.jsx]"]
  node_cards["Vehicle cards<br/>[CarCard.jsx]"]
  node_status["Status badges<br/>[StatusBadge.jsx]"]
  node_mockdata["Mock marketplace data<br/>[mockData.js]"]
  node_images["Car image generator"]
  node_formatters["Formatting and fees<br/>[formatters.js]"]
end

node_user(("Marketplace user"))

node_user -->|"uses"| node_app
node_entry -->|"renders"| node_app
node_app -->|"initializes state"| node_mockdata
node_app -->|"renders"| node_navbar
node_app -->|"routes to"| node_marketplace
node_app -->|"routes to"| node_vehicle
node_app -->|"routes to"| node_auth
node_app -->|"routes to"| node_buyer
node_app -->|"routes to"| node_seller
node_app -->|"routes to"| node_listing
node_app -->|"routes to"| node_storefront
node_app -->|"routes to"| node_moderation
node_app -->|"routes to"| node_master
node_app -->|"renders"| node_booking
node_marketplace -->|"renders"| node_filters
node_marketplace -->|"renders"| node_cards
node_vehicle -->|"renders"| node_calculator
node_calculator -->|"calculates fees"| node_formatters
node_buyer -->|"renders"| node_cards
node_seller -->|"renders"| node_status
node_seller -->|"formats values"| node_formatters
node_listing -->|"generates photos"| node_images
node_storefront -->|"renders"| node_cards
node_moderation -->|"renders"| node_status
node_master -->|"renders"| node_status
node_cards -->|"renders"| node_status
node_cards -->|"formats values"| node_formatters
node_booking -->|"renders"| node_status
node_booking -->|"formats prices"| node_formatters
node_mockdata -->|"builds listing photos"| node_images

click node_app "https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/App.jsx"
click node_marketplace "https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/screens/MarketplaceScreen.jsx"
click node_filters "https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/components/FilterSidebar.jsx"
click node_vehicle "https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/screens/VehicleDetailScreen.jsx"
click node_calculator "https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/components/OnRoadCalculator.jsx"
click node_auth "https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/screens/AuthProfileScreen.jsx"
click node_buyer "https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/screens/BuyerDashboardScreen.jsx"
click node_booking "https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/components/Modals.jsx"
click node_seller "https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/screens/SellerDashboardScreen.jsx"
click node_listing "https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/screens/CarListingFormScreen.jsx"
click node_storefront "https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/screens/SellerStorefrontScreen.jsx"
click node_moderation "https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/screens/AdminModerationScreen.jsx"
click node_master "https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/screens/AdminMasterDataScreen.jsx"
click node_navbar "https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/components/Navbar.jsx"
click node_cards "https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/components/CarCard.jsx"
click node_status "https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/components/StatusBadge.jsx"
click node_mockdata "https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/data/mockData.js"
click node_images "https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/utils/carImageGenerator.js"
click node_formatters "https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/utils/formatters.js"
click node_entry "https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/main.jsx"

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_app,node_entry,node_user toneBlue
class node_marketplace,node_filters,node_vehicle,node_calculator toneAmber
class node_auth,node_buyer,node_booking,node_seller,node_listing,node_storefront toneMint
class node_moderation,node_master toneRose
class node_navbar,node_cards,node_status,node_mockdata,node_images,node_formatters toneIndigo
```

## Components

### App orchestration

- [App shell and state](https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/App.jsx): `apps/prototype/src/App.jsx`
- [React entry point](https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/main.jsx): `apps/prototype/src/main.jsx`

### Vehicle discovery

- [Marketplace search](https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/screens/MarketplaceScreen.jsx): `apps/prototype/src/screens/MarketplaceScreen.jsx`
- [Search filters](https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/components/FilterSidebar.jsx): `apps/prototype/src/components/FilterSidebar.jsx`
- [Vehicle details](https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/screens/VehicleDetailScreen.jsx): `apps/prototype/src/screens/VehicleDetailScreen.jsx`
- [On-road estimator](https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/components/OnRoadCalculator.jsx): `apps/prototype/src/components/OnRoadCalculator.jsx`

### Buyer and seller workflows

- [Account and profile](https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/screens/AuthProfileScreen.jsx): `apps/prototype/src/screens/AuthProfileScreen.jsx`
- [Buyer dashboard](https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/screens/BuyerDashboardScreen.jsx): `apps/prototype/src/screens/BuyerDashboardScreen.jsx`
- [Appointment dialogs](https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/components/Modals.jsx): `apps/prototype/src/components/Modals.jsx`
- [Seller inventory](https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/screens/SellerDashboardScreen.jsx): `apps/prototype/src/screens/SellerDashboardScreen.jsx`
- [Listing editor](https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/screens/CarListingFormScreen.jsx): `apps/prototype/src/screens/CarListingFormScreen.jsx`
- [Seller storefront](https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/screens/SellerStorefrontScreen.jsx): `apps/prototype/src/screens/SellerStorefrontScreen.jsx`

### Marketplace administration

- [Listing moderation](https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/screens/AdminModerationScreen.jsx): `apps/prototype/src/screens/AdminModerationScreen.jsx`
- [Master data](https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/screens/AdminMasterDataScreen.jsx): `apps/prototype/src/screens/AdminMasterDataScreen.jsx`

### Shared UI and data

- [Role navigation](https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/components/Navbar.jsx): `apps/prototype/src/components/Navbar.jsx`
- [Vehicle cards](https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/components/CarCard.jsx): `apps/prototype/src/components/CarCard.jsx`
- [Status badges](https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/components/StatusBadge.jsx): `apps/prototype/src/components/StatusBadge.jsx`
- [Mock marketplace data](https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/data/mockData.js): `apps/prototype/src/data/mockData.js`
- [Car image generator](https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/utils/carImageGenerator.js): `apps/prototype/src/utils/carImageGenerator.js`
- [Formatting and fees](https://github.com/hoangphatdev/drivex/blob/main/apps/prototype/src/utils/formatters.js): `apps/prototype/src/utils/formatters.js`

### Other components

- **Marketplace user**

## Connections

- Marketplace user → App shell and state: uses (evidence: `README.md`)
- React entry point → App shell and state: renders (evidence: `apps/prototype/src/main.jsx`)
- App shell and state → Mock marketplace data: initializes state (evidence: `apps/prototype/src/App.jsx`)
- App shell and state → Role navigation: renders (evidence: `apps/prototype/src/App.jsx`)
- App shell and state → Marketplace search: routes to (evidence: `apps/prototype/src/App.jsx`)
- App shell and state → Vehicle details: routes to (evidence: `apps/prototype/src/App.jsx`)
- App shell and state → Account and profile: routes to (evidence: `apps/prototype/src/App.jsx`)
- App shell and state → Buyer dashboard: routes to (evidence: `apps/prototype/src/App.jsx`)
- App shell and state → Seller inventory: routes to (evidence: `apps/prototype/src/App.jsx`)
- App shell and state → Listing editor: routes to (evidence: `apps/prototype/src/App.jsx`)
- App shell and state → Seller storefront: routes to (evidence: `apps/prototype/src/App.jsx`)
- App shell and state → Listing moderation: routes to (evidence: `apps/prototype/src/App.jsx`)
- App shell and state → Master data: routes to (evidence: `apps/prototype/src/App.jsx`)
- App shell and state → Appointment dialogs: renders (evidence: `apps/prototype/src/App.jsx`)
- Marketplace search → Search filters: renders (evidence: `apps/prototype/src/screens/MarketplaceScreen.jsx`)
- Marketplace search → Vehicle cards: renders (evidence: `apps/prototype/src/screens/MarketplaceScreen.jsx`)
- Vehicle details → On-road estimator: renders (evidence: `apps/prototype/src/screens/VehicleDetailScreen.jsx`)
- On-road estimator → Formatting and fees: calculates fees (evidence: `apps/prototype/src/components/OnRoadCalculator.jsx`)
- Buyer dashboard → Vehicle cards: renders (evidence: `apps/prototype/src/screens/BuyerDashboardScreen.jsx`)
- Seller inventory → Status badges: renders (evidence: `apps/prototype/src/screens/SellerDashboardScreen.jsx`)
- Seller inventory → Formatting and fees: formats values (evidence: `apps/prototype/src/screens/SellerDashboardScreen.jsx`)
- Listing editor → Car image generator: generates photos (evidence: `apps/prototype/src/screens/CarListingFormScreen.jsx`)
- Seller storefront → Vehicle cards: renders (evidence: `apps/prototype/src/screens/SellerStorefrontScreen.jsx`)
- Listing moderation → Status badges: renders (evidence: `apps/prototype/src/screens/AdminModerationScreen.jsx`)
- Master data → Status badges: renders (evidence: `apps/prototype/src/screens/AdminMasterDataScreen.jsx`)
- Vehicle cards → Status badges: renders (evidence: `apps/prototype/src/components/CarCard.jsx`)
- Vehicle cards → Formatting and fees: formats values (evidence: `apps/prototype/src/components/CarCard.jsx`)
- Appointment dialogs → Status badges: renders (evidence: `apps/prototype/src/components/Modals.jsx`)
- Appointment dialogs → Formatting and fees: formats prices (evidence: `apps/prototype/src/components/Modals.jsx`)
- Mock marketplace data → Car image generator: builds listing photos (evidence: `apps/prototype/src/data/mockData.js`)
