# codewithnaveed01/apex-fullstack architecture

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

- Interactive diagram: https://gitdiagram.com/codewithnaveed01/apex-fullstack
- Repository: https://github.com/codewithnaveed01/apex-fullstack

## Overview

APEX is a car-rental marketplace with customer booking and payment flows plus an operations panel for fleet, owner applications, verification, and administration. Customers browse fleet availability, submit bookings and documents, then provide payment receipts; admins verify payments and manage operational records. The Java HTTP layer serves the customer/admin SPA and API, with services enforcing pricing, booking, and payment rules over PostgreSQL repositories. README documents broader capabilities not fully represented in sampled source; those branches are shown at subsystem level.

Main entry points: [`backend/src/com/apex/dao/BookingRepo.java`](https://github.com/codewithnaveed01/apex-fullstack/blob/main/backend/src/com/apex/dao/BookingRepo.java) (Repositories), [`backend/src/com/apex/web/Router.java`](https://github.com/codewithnaveed01/apex-fullstack/blob/main/backend/src/com/apex/web/Router.java) (Router and auth), [`backend/src/com/apex/web/controllers`](https://github.com/codewithnaveed01/apex-fullstack/tree/main/backend/src/com/apex/web/controllers) (Other resource APIs), [`backend/src/com/apex/Main.java`](https://github.com/codewithnaveed01/apex-fullstack/blob/main/backend/src/com/apex/Main.java) (Server startup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_spa["Customer SPA<br/>[customer.js]"]
  node_static["Served web assets<br/>[StaticHandler.java]"]
end

subgraph group_http["HTTP API"]
  node_main["Server startup<br/>[Main.java]"]
  node_router["Router and auth<br/>[Router.java]"]
  node_booking_api["Booking API"]
  node_fleet_api["Fleet API"]
  node_review_api["Review API"]
  node_other_api["Other resource APIs"]
end

subgraph group_domain["Domain services"]
  node_auth["Authentication<br/>[AuthService.java]"]
  node_booking["Booking rules"]
  node_pricing["Server pricing"]
  node_payment["Payment verification"]
  node_upload["Document uploads<br/>[UploadService.java]"]
  node_state["Admin state sync<br/>[StateService.java]"]
  node_ops_services["Other services"]
end

subgraph group_persistence["Persistence"]
  node_repos["Repositories<br/>[BookingRepo.java]"]
  node_database["DB client<br/>[Database.java]"]
end

node_customer(("Customer"))
node_admin(("Operations admin"))
node_postgres[("PostgreSQL")]
node_private_docs[("Private documents")]

node_customer -->|"uses"| node_spa
node_admin -->|"uses"| node_spa
node_spa -->|"API requests"| node_router
node_main -->|"registers routes"| node_router
node_main -->|"serves assets"| node_static
node_router -->|"dispatches"| node_booking_api
node_router -->|"dispatches"| node_fleet_api
node_router -->|"dispatches"| node_review_api
node_router -->|"dispatches"| node_other_api
node_router -->|"validates sessions"| node_auth
node_booking_api -->|"creates and updates"| node_booking
node_booking_api -->|"reads bookings"| node_repos
node_fleet_api -->|"manages fleet"| node_repos
node_review_api -->|"manages reviews"| node_repos
node_other_api -->|"authenticates"| node_auth
node_other_api -->|"payment actions"| node_payment
node_other_api -->|"uploads documents"| node_upload
node_other_api -->|"syncs admin state"| node_state
node_other_api -->|"resource operations"| node_ops_services
node_booking -->|"computes charges"| node_pricing
node_booking -->|"reads and writes"| node_repos
node_payment -->|"updates payments"| node_repos
node_upload -->|"stores metadata"| node_repos
node_upload -->|"stores files"| node_private_docs
node_state -->|"syncs records"| node_repos
node_auth -->|"reads sessions/users"| node_repos
node_repos -->|"executes SQL"| node_database
node_database -->|"queries"| node_postgres
node_main -->|"seeds startup data"| node_ops_services

click node_spa "https://github.com/codewithnaveed01/apex-fullstack/blob/main/frontend/customer.js"
click node_main "https://github.com/codewithnaveed01/apex-fullstack/blob/main/backend/src/com/apex/Main.java"
click node_router "https://github.com/codewithnaveed01/apex-fullstack/blob/main/backend/src/com/apex/web/Router.java"
click node_booking_api "https://github.com/codewithnaveed01/apex-fullstack/blob/main/backend/src/com/apex/web/controllers/BookingController.java"
click node_fleet_api "https://github.com/codewithnaveed01/apex-fullstack/blob/main/backend/src/com/apex/web/controllers/FleetController.java"
click node_review_api "https://github.com/codewithnaveed01/apex-fullstack/blob/main/backend/src/com/apex/web/controllers/ReviewController.java"
click node_other_api "https://github.com/codewithnaveed01/apex-fullstack/tree/main/backend/src/com/apex/web/controllers"
click node_auth "https://github.com/codewithnaveed01/apex-fullstack/blob/main/backend/src/com/apex/service/AuthService.java"
click node_booking "https://github.com/codewithnaveed01/apex-fullstack/blob/main/backend/src/com/apex/service/BookingService.java"
click node_pricing "https://github.com/codewithnaveed01/apex-fullstack/blob/main/backend/src/com/apex/service/PricingService.java"
click node_payment "https://github.com/codewithnaveed01/apex-fullstack/blob/main/backend/src/com/apex/service/PaymentService.java"
click node_upload "https://github.com/codewithnaveed01/apex-fullstack/blob/main/backend/src/com/apex/service/UploadService.java"
click node_state "https://github.com/codewithnaveed01/apex-fullstack/blob/main/backend/src/com/apex/service/StateService.java"
click node_ops_services "https://github.com/codewithnaveed01/apex-fullstack/tree/main/backend/src/com/apex/service"
click node_repos "https://github.com/codewithnaveed01/apex-fullstack/blob/main/backend/src/com/apex/dao/BookingRepo.java"
click node_database "https://github.com/codewithnaveed01/apex-fullstack/blob/main/backend/src/com/apex/db/Database.java"
click node_static "https://github.com/codewithnaveed01/apex-fullstack/blob/main/backend/src/com/apex/web/StaticHandler.java"

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_spa,node_static toneBlue
class node_main,node_router,node_booking_api,node_fleet_api,node_review_api,node_other_api,node_postgres,node_private_docs toneAmber
class node_auth,node_booking,node_pricing,node_payment,node_upload,node_state,node_ops_services toneMint
class node_repos,node_database toneRose
class node_customer,node_admin toneIndigo
```

## Components

### Web experience

- [Customer SPA](https://github.com/codewithnaveed01/apex-fullstack/blob/main/frontend/customer.js): `frontend/customer.js`
- [Served web assets](https://github.com/codewithnaveed01/apex-fullstack/blob/main/backend/src/com/apex/web/StaticHandler.java): `backend/src/com/apex/web/StaticHandler.java`

### HTTP API

- [Server startup](https://github.com/codewithnaveed01/apex-fullstack/blob/main/backend/src/com/apex/Main.java): `backend/src/com/apex/Main.java`
- [Router and auth](https://github.com/codewithnaveed01/apex-fullstack/blob/main/backend/src/com/apex/web/Router.java): `backend/src/com/apex/web/Router.java`
- [Booking API](https://github.com/codewithnaveed01/apex-fullstack/blob/main/backend/src/com/apex/web/controllers/BookingController.java): `backend/src/com/apex/web/controllers/BookingController.java`
- [Fleet API](https://github.com/codewithnaveed01/apex-fullstack/blob/main/backend/src/com/apex/web/controllers/FleetController.java): `backend/src/com/apex/web/controllers/FleetController.java`
- [Review API](https://github.com/codewithnaveed01/apex-fullstack/blob/main/backend/src/com/apex/web/controllers/ReviewController.java): `backend/src/com/apex/web/controllers/ReviewController.java`
- [Other resource APIs](https://github.com/codewithnaveed01/apex-fullstack/tree/main/backend/src/com/apex/web/controllers): `backend/src/com/apex/web/controllers`

### Domain services

- [Authentication](https://github.com/codewithnaveed01/apex-fullstack/blob/main/backend/src/com/apex/service/AuthService.java): `backend/src/com/apex/service/AuthService.java`
- [Booking rules](https://github.com/codewithnaveed01/apex-fullstack/blob/main/backend/src/com/apex/service/BookingService.java): `backend/src/com/apex/service/BookingService.java`
- [Server pricing](https://github.com/codewithnaveed01/apex-fullstack/blob/main/backend/src/com/apex/service/PricingService.java): `backend/src/com/apex/service/PricingService.java`
- [Payment verification](https://github.com/codewithnaveed01/apex-fullstack/blob/main/backend/src/com/apex/service/PaymentService.java): `backend/src/com/apex/service/PaymentService.java`
- [Document uploads](https://github.com/codewithnaveed01/apex-fullstack/blob/main/backend/src/com/apex/service/UploadService.java): `backend/src/com/apex/service/UploadService.java`
- [Admin state sync](https://github.com/codewithnaveed01/apex-fullstack/blob/main/backend/src/com/apex/service/StateService.java): `backend/src/com/apex/service/StateService.java`
- [Other services](https://github.com/codewithnaveed01/apex-fullstack/tree/main/backend/src/com/apex/service): `backend/src/com/apex/service`

### Persistence

- [Repositories](https://github.com/codewithnaveed01/apex-fullstack/blob/main/backend/src/com/apex/dao/BookingRepo.java): `backend/src/com/apex/dao/BookingRepo.java`
- [DB client](https://github.com/codewithnaveed01/apex-fullstack/blob/main/backend/src/com/apex/db/Database.java): `backend/src/com/apex/db/Database.java`

### Other components

- **Customer**
- **Operations admin**
- **PostgreSQL**
- **Private documents**

## Connections

- Customer → Customer SPA: uses
- Operations admin → Customer SPA: uses
- Customer SPA → Router and auth: API requests
- Server startup → Router and auth: registers routes
- Server startup → Served web assets: serves assets
- Router and auth → Booking API: dispatches
- Router and auth → Fleet API: dispatches
- Router and auth → Review API: dispatches
- Router and auth → Other resource APIs: dispatches
- Router and auth → Authentication: validates sessions
- Booking API → Booking rules: creates and updates
- Booking API → Repositories: reads bookings
- Fleet API → Repositories: manages fleet
- Review API → Repositories: manages reviews
- Other resource APIs → Authentication: authenticates
- Other resource APIs → Payment verification: payment actions
- Other resource APIs → Document uploads: uploads documents
- Other resource APIs → Admin state sync: syncs admin state
- Other resource APIs → Other services: resource operations
- Booking rules → Server pricing: computes charges
- Booking rules → Repositories: reads and writes
- Payment verification → Repositories: updates payments
- Document uploads → Repositories: stores metadata
- Document uploads → Private documents: stores files
- Admin state sync → Repositories: syncs records
- Authentication → Repositories: reads sessions/users
- Repositories → DB client: executes SQL
- DB client → PostgreSQL: queries
- Server startup → Other services: seeds startup data
