# kirtanpatel2003/taxirentalapp architecture

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

- Interactive diagram: https://gitdiagram.com/kirtanpatel2003/taxirentalapp
- Repository: https://github.com/kirtanpatel2003/taxirentalapp

## Overview

1. **Overall shape:** This repository is a classic **3-tier taxi rental management system**: a **React frontend**, an **Express/Node backend**, and a **PostgreSQL database**. The frontend is the user-facing SPA; the backend is the API and business layer; PostgreSQL is the system of record.

2. **Frontend application boundary:** `App/taxi-frontend` is a **single-page React app** bootstrapped with Create React App. `public/index.html` is the host page, while `src/index.js` and `src/App.js` mount and route the app. Styling is split across `App.css`, `index.css`, and **Bootstrap-based** UI classes.

3. **UI composition:** The frontend is organized into reusable **components** and **pages**. `src/components/Navbar.jsx` is the shared navigation shell, and `src/pages/` contains the main screens: `Home`, `Login`, `RegisterUser`, and role-specific dashboards for `Client`, `Driver`, and `Manager`. This suggests the UI is role-driven rather than feature-module driven.

4. **Backend application boundary:** `App/taxi-backend/server.js` is the backend entry point. It wires up the Express server, mounts route modules, and exposes the HTTP API used by the frontend. The backend is the only layer that should talk directly to the database.

5. **API structure:** The backend is split into feature routes under `routes/`: `register.js`, `manager.js`, `driver.js`, and `client.js`. This indicates a **domain-oriented API** with separate entry points for account creation and role-specific operations instead of one large monolithic route file.

6. **Persistence layer:** `config/db.js` centralizes the PostgreSQL connection configuration. The schema and seed data live in `config/taxi_rental_db.sql`, which is used to create the database objects and initial records. The database is explicitly local/self-managed in the repo, not an external cloud service.

7. **Main data flow:** A typical flow is: **React page → HTTP request → Express route → PostgreSQL query → JSON response → React state/UI update**. Login and registration are the clearest examples in the current codebase, and the dashboard pages imply later role-based reads and updates through the same pipeline.

8. **Role model:** The app centers on at least three business roles: **manager, driver, and client**. The README highlights manager registration and SSN-based login, so identity and role selection are likely key parts of the domain model. The separate dashboard pages reinforce that each role has its own workflow and view boundary.

9. **Development/runtime setup:** The backend runs on **Node.js + Express** and is started with `nodemon` for live reload, typically on **port 1303**. The frontend runs on the standard CRA dev server on **port 3000**. This implies a local-dev split deployment with cross-origin API calls between the two apps.

10. **Tooling and tests:** Frontend scaffolding includes `App.test.js`, `setupTests.js`, and `reportWebVitals.js`, which are standard CRA test/perf hooks rather than custom architecture pieces. There is no sign of a separate job runner, message queue, or background worker, so the architecture is synchronous HTTP + database.

11. **What to draw in an architecture diagram:** Show two deployable applications—**React SPA** and **Express API**—with the SPA consuming the API over HTTP. Behind the API, show **PostgreSQL** as the persistent store, with the SQL file as the initialization artifact. Mark the route modules as separate backend subdomains aligned to user roles and registration.

12. **Notable scope:** The repository currently looks like an **MVP or phase-1 system**: authentication/registration and role-specific shells are present, while more advanced features like driver/car management, booking, and analytics are suggested in the README but not yet fully represented in the file tree.

Main entry points: [`App/taxi-frontend/src/App.js`](https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-frontend/src/App.js) (Main app), [`App/taxi-backend/server.js`](https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-backend/server.js) (Taxi API), [`App/taxi-backend/config/taxi_rental_db.sql`](https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-backend/config/taxi_rental_db.sql) (PostgreSQL), [`App/taxi-frontend`](https://github.com/kirtanpatel2003/taxirentalapp/tree/main/App/taxi-frontend) (Taxi UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_frontend_app["Taxi UI<br/>React SPA"]
  node_frontend_bootstrap["App shell<br/>CRA entry<br/>[index.js]"]
  node_frontend_router["Main app<br/>React container<br/>[App.js]"]
  node_frontend_nav["Navbar<br/>shared component<br/>[Navbar.jsx]"]
  node_frontend_home["Home<br/>page<br/>[Home.jsx]"]
  node_frontend_login["Login<br/>page<br/>[Login.jsx]"]
  node_frontend_register["Register<br/>page<br/>[RegisterUser.jsx]"]
  node_frontend_client["Client dashboard<br/>role page"]
  node_frontend_driver["Driver dashboard<br/>role page"]
  node_frontend_manager["Manager dashboard<br/>role page"]
end

subgraph group_backend["Backend"]
  node_backend_api["Taxi API<br/>Express server<br/>[server.js]"]
  node_backend_register["Register API<br/>route module<br/>[register.js]"]
  node_backend_client["Client API<br/>route module<br/>[client.js]"]
  node_backend_driver["Driver API<br/>route module<br/>[driver.js]"]
  node_backend_manager["Manager API<br/>route module<br/>[manager.js]"]
  node_backend_dbconfig["DB config<br/>postgres config<br/>[db.js]"]
end

subgraph group_data["Data"]
  node_db[("PostgreSQL<br/>relational DB<br/>[taxi_rental_db.sql]")]
  node_db_seed["Schema seed<br/>SQL init<br/>[taxi_rental_db.sql]"]
end

node_frontend_app -->|"bootstraps"| node_frontend_bootstrap
node_frontend_bootstrap -->|"mounts"| node_frontend_router
node_frontend_router -->|"uses"| node_frontend_nav
node_frontend_router -->|"routes to"| node_frontend_home
node_frontend_router -->|"routes to"| node_frontend_login
node_frontend_router -->|"routes to"| node_frontend_register
node_frontend_router -->|"routes to"| node_frontend_client
node_frontend_router -->|"routes to"| node_frontend_driver
node_frontend_router -->|"routes to"| node_frontend_manager
node_frontend_app -->|"HTTP API"| node_backend_api
node_backend_api -->|"mounts"| node_backend_register
node_backend_api -->|"mounts"| node_backend_client
node_backend_api -->|"mounts"| node_backend_driver
node_backend_api -->|"mounts"| node_backend_manager
node_backend_api -->|"uses"| node_backend_dbconfig
node_backend_register -->|"queries"| node_db
node_backend_client -->|"queries"| node_db
node_backend_driver -->|"queries"| node_db
node_backend_manager -->|"queries"| node_db
node_db_seed -->|"initializes"| node_db

click node_frontend_app "https://github.com/kirtanpatel2003/taxirentalapp/tree/main/App/taxi-frontend"
click node_frontend_bootstrap "https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-frontend/src/index.js"
click node_frontend_router "https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-frontend/src/App.js"
click node_frontend_nav "https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-frontend/src/components/Navbar.jsx"
click node_frontend_home "https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-frontend/src/pages/Home.jsx"
click node_frontend_login "https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-frontend/src/pages/Login.jsx"
click node_frontend_register "https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-frontend/src/pages/RegisterUser.jsx"
click node_frontend_client "https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-frontend/src/pages/ClientDashboard.jsx"
click node_frontend_driver "https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-frontend/src/pages/DriverDashboard.jsx"
click node_frontend_manager "https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-frontend/src/pages/ManagerDashboard.jsx"
click node_backend_api "https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-backend/server.js"
click node_backend_register "https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-backend/routes/register.js"
click node_backend_client "https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-backend/routes/client.js"
click node_backend_driver "https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-backend/routes/driver.js"
click node_backend_manager "https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-backend/routes/manager.js"
click node_backend_dbconfig "https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-backend/config/db.js"
click node_db "https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-backend/config/taxi_rental_db.sql"
click node_db_seed "https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-backend/config/taxi_rental_db.sql"

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_frontend_app,node_frontend_bootstrap,node_frontend_router,node_frontend_nav,node_frontend_home,node_frontend_login,node_frontend_register,node_frontend_client,node_frontend_driver,node_frontend_manager toneBlue
class node_backend_api,node_backend_register,node_backend_client,node_backend_driver,node_backend_manager,node_backend_dbconfig toneAmber
class node_db,node_db_seed toneMint
```

## Components

### Frontend

React SPA and UI composition

- [Taxi UI](https://github.com/kirtanpatel2003/taxirentalapp/tree/main/App/taxi-frontend): React SPA · Single-page customer, driver, and manager interface · `App/taxi-frontend`
- [App shell](https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-frontend/src/index.js): CRA entry · Bootstraps the React app and mounts routing · `App/taxi-frontend/src/index.js`
- [Main app](https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-frontend/src/App.js): React container · Top-level app composition and navigation flow · `App/taxi-frontend/src/App.js`
- [Navbar](https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-frontend/src/components/Navbar.jsx): shared component · Shared navigation shell across roles · `App/taxi-frontend/src/components/Navbar.jsx`
- [Home](https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-frontend/src/pages/Home.jsx): page · Landing screen for the application · `App/taxi-frontend/src/pages/Home.jsx`
- [Login](https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-frontend/src/pages/Login.jsx): page · Authentication screen for users and roles · `App/taxi-frontend/src/pages/Login.jsx`
- [Register](https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-frontend/src/pages/RegisterUser.jsx): page · User and manager registration screen · `App/taxi-frontend/src/pages/RegisterUser.jsx`
- [Client dashboard](https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-frontend/src/pages/ClientDashboard.jsx): role page · Client-specific workspace and views · `App/taxi-frontend/src/pages/ClientDashboard.jsx`
- [Driver dashboard](https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-frontend/src/pages/DriverDashboard.jsx): role page · Driver-specific workspace and views · `App/taxi-frontend/src/pages/DriverDashboard.jsx`
- [Manager dashboard](https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-frontend/src/pages/ManagerDashboard.jsx): role page · Manager-specific workspace and views · `App/taxi-frontend/src/pages/ManagerDashboard.jsx`

### Backend

Express API and route modules

- [Taxi API](https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-backend/server.js): Express server · HTTP API entry point and server bootstrap · `App/taxi-backend/server.js`
- [Register API](https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-backend/routes/register.js): route module · Account creation and onboarding endpoints · `App/taxi-backend/routes/register.js`
- [Client API](https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-backend/routes/client.js): route module · Client-oriented operations and reads · `App/taxi-backend/routes/client.js`
- [Driver API](https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-backend/routes/driver.js): route module · Driver-oriented operations and reads · `App/taxi-backend/routes/driver.js`
- [Manager API](https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-backend/routes/manager.js): route module · Manager-oriented operations and reads · `App/taxi-backend/routes/manager.js`
- [DB config](https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-backend/config/db.js): postgres config · Central PostgreSQL connection setup · `App/taxi-backend/config/db.js`

### Data

Database and initialization artifacts

- [PostgreSQL](https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-backend/config/taxi_rental_db.sql): relational DB · System of record for users and taxi rental data · `App/taxi-backend/config/taxi_rental_db.sql`
- [Schema seed](https://github.com/kirtanpatel2003/taxirentalapp/blob/main/App/taxi-backend/config/taxi_rental_db.sql): SQL init · Database schema and initial data definition · `App/taxi-backend/config/taxi_rental_db.sql`

## Connections

- Taxi UI → App shell: bootstraps · The SPA starts from the CRA entry point
- App shell → Main app: mounts · Entry code mounts the top-level React app
- Main app → Navbar: uses · App shell shares the navigation component
- Main app → Home: routes to · Main app renders the landing page
- Main app → Login: routes to · Main app renders the login page
- Main app → Register: routes to · Main app renders the registration page
- Main app → Client dashboard: routes to · Main app renders client workspace
- Main app → Driver dashboard: routes to · Main app renders driver workspace
- Main app → Manager dashboard: routes to · Main app renders manager workspace
- Taxi UI → Taxi API: HTTP API · React UI calls the Express backend over HTTP
- Taxi API → Register API: mounts · Server wires in registration endpoints
- Taxi API → Client API: mounts · Server wires in client endpoints
- Taxi API → Driver API: mounts · Server wires in driver endpoints
- Taxi API → Manager API: mounts · Server wires in manager endpoints
- Taxi API → DB config: uses · API server relies on shared database connection setup
- Register API → PostgreSQL: queries · Registration flows persist and read from PostgreSQL
- Client API → PostgreSQL: queries · Client operations access PostgreSQL
- Driver API → PostgreSQL: queries · Driver operations access PostgreSQL
- Manager API → PostgreSQL: queries · Manager operations access PostgreSQL
- Schema seed → PostgreSQL: initializes · SQL script defines schema and seed data for the database
