# redward42/web103_unit4_project architecture

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

- Interactive diagram: https://gitdiagram.com/redward42/web103_unit4_project
- Repository: https://github.com/redward42/web103_unit4_project

## Overview

Bolt Bucket is a React car-customization app backed by an Express API and PostgreSQL. Users configure a car, see its calculated price, and submit valid choices; they can then browse saved cars, inspect a car, edit it, or delete it. The client also provides shared API calls, pricing, and feature-combination validation. The README documents these product capabilities; some page implementations were not excerpted, so their page-to-API links rely on the SOURCE INDEX. The API-to-database flow is visible in the controller and database excerpts.

Main entry points: [`client/src/App.jsx`](https://github.com/RedWARd42/web103_unit4_project/blob/main/client/src/App.jsx) (Route selection), [`client/src/services/CarsAPI.jsx`](https://github.com/RedWARd42/web103_unit4_project/blob/main/client/src/services/CarsAPI.jsx) (Cars API client), [`client/src/pages/CreateCar.jsx`](https://github.com/RedWARd42/web103_unit4_project/blob/main/client/src/pages/CreateCar.jsx) (Create car), [`client/src/pages/ViewCars.jsx`](https://github.com/RedWARd42/web103_unit4_project/blob/main/client/src/pages/ViewCars.jsx) (Browse cars)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Car app"]
  node_app["Route selection<br/>[App.jsx]"]
  node_navigation["Navigation<br/>[Navigation.jsx]"]
  node_create["Create car<br/>[CreateCar.jsx]"]
  node_list["Browse cars<br/>[ViewCars.jsx]"]
  node_details["Car details<br/>[CarDetails.jsx]"]
  node_edit["Edit car<br/>[EditCar.jsx]"]
end

subgraph group_client_logic["Configuration logic"]
  node_pricing["Price calculation<br/>[calcPrice.js]"]
  node_validation["Option validation<br/>[validateOptions.js]"]
end

subgraph group_api["Car API"]
  node_cars_api["Cars API client<br/>[CarsAPI.jsx]"]
  node_server["HTTP server<br/>[server.js]"]
  node_routes["Item routes<br/>[customRoutes.js]"]
  node_controller["Item operations"]
end

subgraph group_storage["Persistence"]
  node_database_config["Database pool<br/>[database.js]"]
  node_postgres[("PostgreSQL")]
end

node_driver(("Car builder"))

node_driver -->|"uses"| node_app
node_app -->|"renders"| node_navigation
node_app -->|"routes to"| node_create
node_app -->|"routes to"| node_list
node_app -->|"routes to"| node_details
node_app -->|"routes to"| node_edit
node_create -->|"calculates with"| node_pricing
node_create -->|"validates with"| node_validation
node_create -->|"submits through"| node_cars_api
node_list -->|"loads through"| node_cars_api
node_details -->|"uses"| node_cars_api
node_edit -->|"loads and updates through"| node_cars_api
node_cars_api -->|"sends API requests"| node_server
node_server -->|"mounts"| node_routes
node_routes -->|"dispatches to"| node_controller
node_controller -->|"queries via"| node_database_config
node_database_config -->|"connects to"| node_postgres

click node_app "https://github.com/RedWARd42/web103_unit4_project/blob/main/client/src/App.jsx"
click node_navigation "https://github.com/RedWARd42/web103_unit4_project/blob/main/client/src/components/Navigation.jsx"
click node_create "https://github.com/RedWARd42/web103_unit4_project/blob/main/client/src/pages/CreateCar.jsx"
click node_list "https://github.com/RedWARd42/web103_unit4_project/blob/main/client/src/pages/ViewCars.jsx"
click node_details "https://github.com/RedWARd42/web103_unit4_project/blob/main/client/src/pages/CarDetails.jsx"
click node_edit "https://github.com/RedWARd42/web103_unit4_project/blob/main/client/src/pages/EditCar.jsx"
click node_pricing "https://github.com/RedWARd42/web103_unit4_project/blob/main/client/src/utilities/calcPrice.js"
click node_validation "https://github.com/RedWARd42/web103_unit4_project/blob/main/client/src/utilities/validateOptions.js"
click node_cars_api "https://github.com/RedWARd42/web103_unit4_project/blob/main/client/src/services/CarsAPI.jsx"
click node_server "https://github.com/RedWARd42/web103_unit4_project/blob/main/server/server.js"
click node_routes "https://github.com/RedWARd42/web103_unit4_project/blob/main/server/routes/customRoutes.js"
click node_controller "https://github.com/RedWARd42/web103_unit4_project/blob/main/server/controllers/customItemsController.js"
click node_database_config "https://github.com/RedWARd42/web103_unit4_project/blob/main/server/config/database.js"

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_navigation,node_create,node_list,node_details,node_edit toneBlue
class node_pricing,node_validation toneAmber
class node_cars_api,node_server,node_routes,node_controller toneMint
class node_database_config,node_postgres toneRose
class node_driver toneIndigo
```

## Components

### Car app

- [Route selection](https://github.com/RedWARd42/web103_unit4_project/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Navigation](https://github.com/RedWARd42/web103_unit4_project/blob/main/client/src/components/Navigation.jsx): `client/src/components/Navigation.jsx`
- [Create car](https://github.com/RedWARd42/web103_unit4_project/blob/main/client/src/pages/CreateCar.jsx): `client/src/pages/CreateCar.jsx`
- [Browse cars](https://github.com/RedWARd42/web103_unit4_project/blob/main/client/src/pages/ViewCars.jsx): `client/src/pages/ViewCars.jsx`
- [Car details](https://github.com/RedWARd42/web103_unit4_project/blob/main/client/src/pages/CarDetails.jsx): `client/src/pages/CarDetails.jsx`
- [Edit car](https://github.com/RedWARd42/web103_unit4_project/blob/main/client/src/pages/EditCar.jsx): `client/src/pages/EditCar.jsx`

### Configuration logic

- [Price calculation](https://github.com/RedWARd42/web103_unit4_project/blob/main/client/src/utilities/calcPrice.js): `client/src/utilities/calcPrice.js`
- [Option validation](https://github.com/RedWARd42/web103_unit4_project/blob/main/client/src/utilities/validateOptions.js): `client/src/utilities/validateOptions.js`

### Car API

- [Cars API client](https://github.com/RedWARd42/web103_unit4_project/blob/main/client/src/services/CarsAPI.jsx): `client/src/services/CarsAPI.jsx`
- [HTTP server](https://github.com/RedWARd42/web103_unit4_project/blob/main/server/server.js): `server/server.js`
- [Item routes](https://github.com/RedWARd42/web103_unit4_project/blob/main/server/routes/customRoutes.js): `server/routes/customRoutes.js`
- [Item operations](https://github.com/RedWARd42/web103_unit4_project/blob/main/server/controllers/customItemsController.js): `server/controllers/customItemsController.js`

### Persistence

- [Database pool](https://github.com/RedWARd42/web103_unit4_project/blob/main/server/config/database.js): `server/config/database.js`
- **PostgreSQL**

### Other components

- **Car builder**

## Connections

- Car builder → Route selection: uses (evidence: `README.md`)
- Route selection → Navigation: renders (evidence: `client/src/App.jsx`)
- Route selection → Create car: routes to (evidence: `client/src/App.jsx`)
- Route selection → Browse cars: routes to (evidence: `client/src/App.jsx`)
- Route selection → Car details: routes to (evidence: `client/src/App.jsx`)
- Route selection → Edit car: routes to (evidence: `client/src/App.jsx`)
- Create car → Price calculation: calculates with (evidence: `client/src/pages/CreateCar.jsx`)
- Create car → Option validation: validates with (evidence: `client/src/pages/CreateCar.jsx`)
- Create car → Cars API client: submits through (evidence: `client/src/pages/CreateCar.jsx`)
- Browse cars → Cars API client: loads through (evidence: `client/src/pages/ViewCars.jsx`)
- Car details → Cars API client: uses (evidence: `client/src/pages/CarDetails.jsx`)
- Edit car → Cars API client: loads and updates through (evidence: `client/src/pages/EditCar.jsx`)
- Cars API client → HTTP server: sends API requests (evidence: `client/src/services/CarsAPI.jsx`)
- HTTP server → Item routes: mounts (evidence: `server/server.js`)
- Item routes → Item operations: dispatches to (evidence: `server/routes/customRoutes.js`)
- Item operations → Database pool: queries via (evidence: `server/controllers/customItemsController.js`)
- Database pool → PostgreSQL: connects to (evidence: `server/config/database.js`)
