# omdarentcar/orc architecture

> Architecture diagram of the GitHub repository omdarentcar/orc, 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/omdarentcar/orc
- Repository: https://github.com/omdarentcar/orc

## Overview

Omda Rent Car is a car-rental platform with a public vehicle-browsing and booking experience and an authenticated admin console. The main customer path is browsing/filtering cars, checking a car’s approved booking dates, and submitting a booking; administrators manage cars and booking status and monitor dashboard notifications. The graph includes the documented real-time and image-management capabilities. Several page and route implementations are unsampled, so their internal call wiring is shown only where supported by the application structure and README.

Main entry points: [`client/src/services/api.ts`](https://github.com/omdarentcar/orc/blob/main/client/src/services/api.ts) (API client), [`server/src/index.ts`](https://github.com/omdarentcar/orc/blob/main/server/src/index.ts) (Express API), [`client/src/App.tsx`](https://github.com/omdarentcar/orc/blob/main/client/src/App.tsx) (Client router), [`server/src/lib/prisma.ts`](https://github.com/omdarentcar/orc/blob/main/server/src/lib/prisma.ts) (Prisma client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer experience"]
  node_app["Client router<br/>[App.tsx]"]
  node_home["Car discovery<br/>[HomePage.tsx]"]
  node_booking["Booking form<br/>[BookingModal.tsx]"]
  node_clientapi["API client<br/>[api.ts]"]
end

subgraph group_admin["Admin console"]
  node_login["Admin login<br/>[LoginPage.tsx]"]
  node_authstate["Auth state<br/>[AuthContext.tsx]"]
  node_adminlayout["Admin workspace<br/>[AdminLayout.tsx]"]
  node_carsui["Car management<br/>[Cars.tsx]"]
  node_bookingsui["Booking management<br/>[Bookings.tsx]"]
  node_dashboardui["Dashboard<br/>[Dashboard.tsx]"]
  node_notifications["Notifications"]
end

subgraph group_server["API and domain"]
  node_server["Express API<br/>[index.ts]"]
  node_authroute["Auth routes<br/>[auth.ts]"]
  node_carsroute["Car routes<br/>[cars.ts]"]
  node_bookingroute["Booking routes<br/>[bookings.ts]"]
  node_dashboardroute["Dashboard routes<br/>[dashboard.ts]"]
  node_authmw["Token verification<br/>[auth.ts]"]
end

subgraph group_integrations["Persistence and integrations"]
  node_prisma["Prisma client<br/>[prisma.ts]"]
  node_database[("PostgreSQL")]
  node_cloudinary["Cloudinary media<br/>[cloudinary.ts]"]
  node_socketserver["Socket server<br/>[socket.ts]"]
  node_socketclient["Socket client<br/>[socket.ts]"]
end

node_visitor(("Renter"))
node_adminactor(("Administrator"))

node_visitor -->|"opens"| node_app
node_app -->|"routes to"| node_home
node_home -->|"requests cars"| node_clientapi
node_home -->|"opens booking"| node_booking
node_booking -->|"submits booking"| node_clientapi
node_adminactor -->|"opens admin"| node_app
node_app -->|"routes to"| node_login
node_login -->|"authenticates"| node_authstate
node_authstate -->|"requests identity"| node_clientapi
node_app -->|"protects routes"| node_adminlayout
node_adminlayout -->|"hosts"| node_carsui
node_adminlayout -->|"hosts"| node_bookingsui
node_adminlayout -->|"hosts"| node_dashboardui
node_carsui -->|"manages cars"| node_clientapi
node_bookingsui -->|"manages bookings"| node_clientapi
node_dashboardui -->|"loads stats"| node_clientapi
node_notifications -->|"loads and updates"| node_clientapi
node_notifications -->|"subscribes"| node_socketclient
node_clientapi -->|"HTTP requests"| node_server
node_server -->|"mounts"| node_authroute
node_server -->|"mounts"| node_carsroute
node_server -->|"mounts"| node_bookingroute
node_server -->|"mounts"| node_dashboardroute
node_authroute -->|"guards admin"| node_authmw
node_carsroute -->|"guards admin writes"| node_authmw
node_bookingroute -->|"guards admin actions"| node_authmw
node_dashboardroute -->|"guards admin"| node_authmw
node_authroute -->|"reads and updates"| node_prisma
node_carsroute -->|"reads and writes"| node_prisma
node_bookingroute -->|"reads and writes"| node_prisma
node_dashboardroute -->|"reads stats"| node_prisma
node_prisma -->|"queries"| node_database
node_carsroute -.->|"stores car images"| node_cloudinary
node_server -->|"initializes"| node_socketserver
node_socketclient -->|"connects"| node_socketserver
node_socketserver -->|"booking updates"| node_notifications

click node_app "https://github.com/omdarentcar/orc/blob/main/client/src/App.tsx"
click node_home "https://github.com/omdarentcar/orc/blob/main/client/src/pages/Home/HomePage.tsx"
click node_booking "https://github.com/omdarentcar/orc/blob/main/client/src/pages/Home/BookingModal.tsx"
click node_clientapi "https://github.com/omdarentcar/orc/blob/main/client/src/services/api.ts"
click node_login "https://github.com/omdarentcar/orc/blob/main/client/src/pages/Login/LoginPage.tsx"
click node_authstate "https://github.com/omdarentcar/orc/blob/main/client/src/context/AuthContext.tsx"
click node_adminlayout "https://github.com/omdarentcar/orc/blob/main/client/src/pages/Admin/AdminLayout.tsx"
click node_carsui "https://github.com/omdarentcar/orc/blob/main/client/src/pages/Admin/Cars.tsx"
click node_bookingsui "https://github.com/omdarentcar/orc/blob/main/client/src/pages/Admin/Bookings.tsx"
click node_dashboardui "https://github.com/omdarentcar/orc/blob/main/client/src/pages/Admin/Dashboard.tsx"
click node_notifications "https://github.com/omdarentcar/orc/blob/main/client/src/context/NotificationsContext.tsx"
click node_server "https://github.com/omdarentcar/orc/blob/main/server/src/index.ts"
click node_authroute "https://github.com/omdarentcar/orc/blob/main/server/src/routes/auth.ts"
click node_carsroute "https://github.com/omdarentcar/orc/blob/main/server/src/routes/cars.ts"
click node_bookingroute "https://github.com/omdarentcar/orc/blob/main/server/src/routes/bookings.ts"
click node_dashboardroute "https://github.com/omdarentcar/orc/blob/main/server/src/routes/dashboard.ts"
click node_authmw "https://github.com/omdarentcar/orc/blob/main/server/src/middleware/auth.ts"
click node_prisma "https://github.com/omdarentcar/orc/blob/main/server/src/lib/prisma.ts"
click node_cloudinary "https://github.com/omdarentcar/orc/blob/main/server/src/services/cloudinary.ts"
click node_socketserver "https://github.com/omdarentcar/orc/blob/main/server/src/socket.ts"
click node_socketclient "https://github.com/omdarentcar/orc/blob/main/client/src/services/socket.ts"

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_home,node_booking,node_clientapi toneBlue
class node_login,node_authstate,node_adminlayout,node_carsui,node_bookingsui,node_dashboardui,node_notifications toneAmber
class node_server,node_authroute,node_carsroute,node_bookingroute,node_dashboardroute,node_authmw toneMint
class node_prisma,node_database,node_cloudinary,node_socketserver,node_socketclient toneRose
class node_visitor,node_adminactor toneIndigo
```

## Components

### Customer experience

- [Client router](https://github.com/omdarentcar/orc/blob/main/client/src/App.tsx): `client/src/App.tsx`
- [Car discovery](https://github.com/omdarentcar/orc/blob/main/client/src/pages/Home/HomePage.tsx): `client/src/pages/Home/HomePage.tsx`
- [Booking form](https://github.com/omdarentcar/orc/blob/main/client/src/pages/Home/BookingModal.tsx): `client/src/pages/Home/BookingModal.tsx`
- [API client](https://github.com/omdarentcar/orc/blob/main/client/src/services/api.ts): `client/src/services/api.ts`

### Admin console

- [Admin login](https://github.com/omdarentcar/orc/blob/main/client/src/pages/Login/LoginPage.tsx): `client/src/pages/Login/LoginPage.tsx`
- [Auth state](https://github.com/omdarentcar/orc/blob/main/client/src/context/AuthContext.tsx): `client/src/context/AuthContext.tsx`
- [Admin workspace](https://github.com/omdarentcar/orc/blob/main/client/src/pages/Admin/AdminLayout.tsx): `client/src/pages/Admin/AdminLayout.tsx`
- [Car management](https://github.com/omdarentcar/orc/blob/main/client/src/pages/Admin/Cars.tsx): `client/src/pages/Admin/Cars.tsx`
- [Booking management](https://github.com/omdarentcar/orc/blob/main/client/src/pages/Admin/Bookings.tsx): `client/src/pages/Admin/Bookings.tsx`
- [Dashboard](https://github.com/omdarentcar/orc/blob/main/client/src/pages/Admin/Dashboard.tsx): `client/src/pages/Admin/Dashboard.tsx`
- [Notifications](https://github.com/omdarentcar/orc/blob/main/client/src/context/NotificationsContext.tsx): `client/src/context/NotificationsContext.tsx`

### API and domain

- [Express API](https://github.com/omdarentcar/orc/blob/main/server/src/index.ts): `server/src/index.ts`
- [Auth routes](https://github.com/omdarentcar/orc/blob/main/server/src/routes/auth.ts): `server/src/routes/auth.ts`
- [Car routes](https://github.com/omdarentcar/orc/blob/main/server/src/routes/cars.ts): `server/src/routes/cars.ts`
- [Booking routes](https://github.com/omdarentcar/orc/blob/main/server/src/routes/bookings.ts): `server/src/routes/bookings.ts`
- [Dashboard routes](https://github.com/omdarentcar/orc/blob/main/server/src/routes/dashboard.ts): `server/src/routes/dashboard.ts`
- [Token verification](https://github.com/omdarentcar/orc/blob/main/server/src/middleware/auth.ts): `server/src/middleware/auth.ts`

### Persistence and integrations

- [Prisma client](https://github.com/omdarentcar/orc/blob/main/server/src/lib/prisma.ts): `server/src/lib/prisma.ts`
- **PostgreSQL**
- [Cloudinary media](https://github.com/omdarentcar/orc/blob/main/server/src/services/cloudinary.ts): `server/src/services/cloudinary.ts`
- [Socket server](https://github.com/omdarentcar/orc/blob/main/server/src/socket.ts): `server/src/socket.ts`
- [Socket client](https://github.com/omdarentcar/orc/blob/main/client/src/services/socket.ts): `client/src/services/socket.ts`

### Other components

- **Renter**
- **Administrator**

## Connections

- Renter → Client router: opens
- Client router → Car discovery: routes to
- Car discovery → API client: requests cars
- Car discovery → Booking form: opens booking
- Booking form → API client: submits booking
- Administrator → Client router: opens admin
- Client router → Admin login: routes to
- Admin login → Auth state: authenticates
- Auth state → API client: requests identity
- Client router → Admin workspace: protects routes
- Admin workspace → Car management: hosts
- Admin workspace → Booking management: hosts
- Admin workspace → Dashboard: hosts
- Car management → API client: manages cars
- Booking management → API client: manages bookings
- Dashboard → API client: loads stats
- Notifications → API client: loads and updates
- Notifications → Socket client: subscribes
- API client → Express API: HTTP requests
- Express API → Auth routes: mounts
- Express API → Car routes: mounts
- Express API → Booking routes: mounts
- Express API → Dashboard routes: mounts
- Auth routes → Token verification: guards admin
- Car routes → Token verification: guards admin writes
- Booking routes → Token verification: guards admin actions
- Dashboard routes → Token verification: guards admin
- Auth routes → Prisma client: reads and updates
- Car routes → Prisma client: reads and writes
- Booking routes → Prisma client: reads and writes
- Dashboard routes → Prisma client: reads stats
- Prisma client → PostgreSQL: queries
- Car routes → Cloudinary media: stores car images
- Express API → Socket server: initializes
- Socket client → Socket server: connects
- Socket server → Notifications: booking updates
