# mervearslan1/rent-a-plane architecture

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

- Interactive diagram: https://gitdiagram.com/mervearslan1/rent-a-plane
- Repository: https://github.com/mervearslan1/rent-a-plane

## Overview

Rent a Plane is a React/Spring Boot aircraft-rental demo. A user browses and filters the aircraft catalogue, opens aircraft details, then can submit a date-range booking request; the frontend sends these requests to the backend, which applies business logic and uses PostgreSQL according to the README. The service also has a demo fallback, so an unavailable API can produce sample aircraft and an explicitly unpersisted booking. The README describes WireMock as an external-service simulator, but the sampled source does not establish an active integration; that link is marked unverified.

Main entry points: [`frontend/src/App.jsx`](https://github.com/mervearslan1/rent-a-plane/blob/main/frontend/src/App.jsx) (Route shell), [`frontend/src/pages/HomePage.jsx`](https://github.com/mervearslan1/rent-a-plane/blob/main/frontend/src/pages/HomePage.jsx) (Aircraft search), [`frontend/src/pages/BookingPage.jsx`](https://github.com/mervearslan1/rent-a-plane/blob/main/frontend/src/pages/BookingPage.jsx) (Booking form), [`frontend/src/services/aircraftService.js`](https://github.com/mervearslan1/rent-a-plane/blob/main/frontend/src/services/aircraftService.js) (Aircraft API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web frontend"]
  node_app["Route shell<br/>[App.jsx]"]
  node_navbar["Navigation<br/>[Navbar.jsx]"]
  node_loading["Loading indicator<br/>[Loading.jsx]"]
end

subgraph group_aircraft["Aircraft catalogue"]
  node_home["Aircraft search<br/>[HomePage.jsx]"]
  node_card["Aircraft card<br/>[AircraftCard.jsx]"]
  node_detail["Aircraft details"]
  node_aircraft_service["Aircraft API client<br/>[aircraftService.js]"]
end

subgraph group_booking["Booking"]
  node_booking_page["Booking form<br/>[BookingPage.jsx]"]
  node_booking_api["Booking API client<br/>[aircraftService.js]"]
end

subgraph group_backend["Backend API"]
  node_aircraft_controller["Aircraft endpoints"]
  node_aircraft_logic["Aircraft rules"]
  node_aircraft_model["Aircraft records<br/>[Aircraft.java]"]
  node_aircraft_repository["Aircraft persistence"]
  node_booking_controller["Booking endpoints"]
  node_booking_logic["Booking rules"]
  node_booking_model["Booking records<br/>[Booking.java]"]
  node_booking_status["Booking status<br/>[BookingStatus.java]"]
  node_booking_repository["Booking persistence"]
end

subgraph group_external["Data and integrations"]
  node_postgres[("PostgreSQL")]
  node_wiremock["WireMock"]
end

node_user(("Renter"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_navbar
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_detail
node_app -->|"routes to"| node_booking_page
node_home -->|"loads aircraft"| node_aircraft_service
node_home -->|"renders"| node_card
node_home -->|"renders"| node_loading
node_detail -->|"loads aircraft"| node_aircraft_service
node_detail -->|"renders"| node_loading
node_booking_page -->|"loads aircraft"| node_aircraft_service
node_booking_page -->|"submits request"| node_booking_api
node_booking_page -->|"renders"| node_loading
node_aircraft_service -->|"requests aircraft"| node_aircraft_controller
node_booking_api -->|"posts booking"| node_booking_controller
node_aircraft_controller -.->|"delegates to"| node_aircraft_logic
node_aircraft_logic -.->|"uses persistence"| node_aircraft_repository
node_aircraft_repository -.->|"reads and writes"| node_postgres
node_booking_controller -.->|"delegates to"| node_booking_logic
node_booking_logic -.->|"uses persistence"| node_booking_repository
node_booking_repository -.->|"reads and writes"| node_postgres
node_aircraft_controller -.->|"simulates integration"| node_wiremock

click node_app "https://github.com/mervearslan1/rent-a-plane/blob/main/frontend/src/App.jsx"
click node_navbar "https://github.com/mervearslan1/rent-a-plane/blob/main/frontend/src/components/Navbar.jsx"
click node_home "https://github.com/mervearslan1/rent-a-plane/blob/main/frontend/src/pages/HomePage.jsx"
click node_card "https://github.com/mervearslan1/rent-a-plane/blob/main/frontend/src/components/AircraftCard.jsx"
click node_detail "https://github.com/mervearslan1/rent-a-plane/blob/main/frontend/src/pages/AircraftDetailPage.jsx"
click node_loading "https://github.com/mervearslan1/rent-a-plane/blob/main/frontend/src/components/Loading.jsx"
click node_aircraft_service "https://github.com/mervearslan1/rent-a-plane/blob/main/frontend/src/services/aircraftService.js"
click node_booking_page "https://github.com/mervearslan1/rent-a-plane/blob/main/frontend/src/pages/BookingPage.jsx"
click node_booking_api "https://github.com/mervearslan1/rent-a-plane/blob/main/frontend/src/services/aircraftService.js"
click node_aircraft_controller "https://github.com/mervearslan1/rent-a-plane/blob/main/src/main/java/com/example/rentaplane/module/aircraft/AircraftController.java"
click node_aircraft_logic "https://github.com/mervearslan1/rent-a-plane/blob/main/src/main/java/com/example/rentaplane/module/aircraft/AircraftService.java"
click node_aircraft_model "https://github.com/mervearslan1/rent-a-plane/blob/main/src/main/java/com/example/rentaplane/module/aircraft/Aircraft.java"
click node_aircraft_repository "https://github.com/mervearslan1/rent-a-plane/blob/main/src/main/java/com/example/rentaplane/module/aircraft/AircraftRepository.java"
click node_booking_controller "https://github.com/mervearslan1/rent-a-plane/blob/main/src/main/java/com/example/rentaplane/module/booking/BookingController.java"
click node_booking_logic "https://github.com/mervearslan1/rent-a-plane/blob/main/src/main/java/com/example/rentaplane/module/booking/BookingService.java"
click node_booking_model "https://github.com/mervearslan1/rent-a-plane/blob/main/src/main/java/com/example/rentaplane/module/booking/Booking.java"
click node_booking_status "https://github.com/mervearslan1/rent-a-plane/blob/main/src/main/java/com/example/rentaplane/module/booking/BookingStatus.java"
click node_booking_repository "https://github.com/mervearslan1/rent-a-plane/blob/main/src/main/java/com/example/rentaplane/module/booking/BookingRepository.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_app,node_navbar,node_loading toneBlue
class node_home,node_card,node_detail,node_aircraft_service toneAmber
class node_booking_page,node_booking_api toneMint
class node_aircraft_controller,node_aircraft_logic,node_aircraft_model,node_aircraft_repository,node_booking_controller,node_booking_logic,node_booking_model,node_booking_status,node_booking_repository toneRose
class node_postgres,node_wiremock,node_user toneIndigo
```

## Components

### Web frontend

- [Route shell](https://github.com/mervearslan1/rent-a-plane/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Navigation](https://github.com/mervearslan1/rent-a-plane/blob/main/frontend/src/components/Navbar.jsx): `frontend/src/components/Navbar.jsx`
- [Loading indicator](https://github.com/mervearslan1/rent-a-plane/blob/main/frontend/src/components/Loading.jsx): `frontend/src/components/Loading.jsx`

### Aircraft catalogue

- [Aircraft search](https://github.com/mervearslan1/rent-a-plane/blob/main/frontend/src/pages/HomePage.jsx): `frontend/src/pages/HomePage.jsx`
- [Aircraft card](https://github.com/mervearslan1/rent-a-plane/blob/main/frontend/src/components/AircraftCard.jsx): `frontend/src/components/AircraftCard.jsx`
- [Aircraft details](https://github.com/mervearslan1/rent-a-plane/blob/main/frontend/src/pages/AircraftDetailPage.jsx): `frontend/src/pages/AircraftDetailPage.jsx`
- [Aircraft API client](https://github.com/mervearslan1/rent-a-plane/blob/main/frontend/src/services/aircraftService.js): `frontend/src/services/aircraftService.js`

### Booking

- [Booking form](https://github.com/mervearslan1/rent-a-plane/blob/main/frontend/src/pages/BookingPage.jsx): `frontend/src/pages/BookingPage.jsx`
- [Booking API client](https://github.com/mervearslan1/rent-a-plane/blob/main/frontend/src/services/aircraftService.js): `frontend/src/services/aircraftService.js`

### Backend API

- [Aircraft endpoints](https://github.com/mervearslan1/rent-a-plane/blob/main/src/main/java/com/example/rentaplane/module/aircraft/AircraftController.java): `src/main/java/com/example/rentaplane/module/aircraft/AircraftController.java`
- [Aircraft rules](https://github.com/mervearslan1/rent-a-plane/blob/main/src/main/java/com/example/rentaplane/module/aircraft/AircraftService.java): `src/main/java/com/example/rentaplane/module/aircraft/AircraftService.java`
- [Aircraft records](https://github.com/mervearslan1/rent-a-plane/blob/main/src/main/java/com/example/rentaplane/module/aircraft/Aircraft.java): `src/main/java/com/example/rentaplane/module/aircraft/Aircraft.java`
- [Aircraft persistence](https://github.com/mervearslan1/rent-a-plane/blob/main/src/main/java/com/example/rentaplane/module/aircraft/AircraftRepository.java): `src/main/java/com/example/rentaplane/module/aircraft/AircraftRepository.java`
- [Booking endpoints](https://github.com/mervearslan1/rent-a-plane/blob/main/src/main/java/com/example/rentaplane/module/booking/BookingController.java): `src/main/java/com/example/rentaplane/module/booking/BookingController.java`
- [Booking rules](https://github.com/mervearslan1/rent-a-plane/blob/main/src/main/java/com/example/rentaplane/module/booking/BookingService.java): `src/main/java/com/example/rentaplane/module/booking/BookingService.java`
- [Booking records](https://github.com/mervearslan1/rent-a-plane/blob/main/src/main/java/com/example/rentaplane/module/booking/Booking.java): `src/main/java/com/example/rentaplane/module/booking/Booking.java`
- [Booking status](https://github.com/mervearslan1/rent-a-plane/blob/main/src/main/java/com/example/rentaplane/module/booking/BookingStatus.java): `src/main/java/com/example/rentaplane/module/booking/BookingStatus.java`
- [Booking persistence](https://github.com/mervearslan1/rent-a-plane/blob/main/src/main/java/com/example/rentaplane/module/booking/BookingRepository.java): `src/main/java/com/example/rentaplane/module/booking/BookingRepository.java`

### Data and integrations

- **PostgreSQL**
- **WireMock**

### Other components

- **Renter**

## Connections

- Renter → Route shell: uses (evidence: `readme.md`)
- Route shell → Navigation: renders (evidence: `frontend/src/App.jsx`)
- Route shell → Aircraft search: routes to (evidence: `frontend/src/App.jsx`)
- Route shell → Aircraft details: routes to (evidence: `frontend/src/App.jsx`)
- Route shell → Booking form: routes to (evidence: `frontend/src/App.jsx`)
- Aircraft search → Aircraft API client: loads aircraft (evidence: `frontend/src/pages/HomePage.jsx`)
- Aircraft search → Aircraft card: renders (evidence: `frontend/src/pages/HomePage.jsx`)
- Aircraft search → Loading indicator: renders (evidence: `frontend/src/pages/HomePage.jsx`)
- Aircraft details → Aircraft API client: loads aircraft (evidence: `frontend/src/pages/AircraftDetailPage.jsx`)
- Aircraft details → Loading indicator: renders (evidence: `frontend/src/pages/AircraftDetailPage.jsx`)
- Booking form → Aircraft API client: loads aircraft (evidence: `frontend/src/pages/BookingPage.jsx`)
- Booking form → Booking API client: submits request (evidence: `frontend/src/pages/BookingPage.jsx`)
- Booking form → Loading indicator: renders (evidence: `frontend/src/pages/BookingPage.jsx`)
- Aircraft API client → Aircraft endpoints: requests aircraft (evidence: `frontend/src/services/aircraftService.js`)
- Booking API client → Booking endpoints: posts booking (evidence: `frontend/src/services/aircraftService.js`)
- Aircraft endpoints → Aircraft rules: delegates to (evidence: `readme.md`)
- Aircraft rules → Aircraft persistence: uses persistence (evidence: `readme.md`)
- Aircraft persistence → PostgreSQL: reads and writes (evidence: `readme.md`)
- Booking endpoints → Booking rules: delegates to (evidence: `readme.md`)
- Booking rules → Booking persistence: uses persistence (evidence: `readme.md`)
- Booking persistence → PostgreSQL: reads and writes (evidence: `readme.md`)
- Aircraft endpoints → WireMock: simulates integration
