# toriqul2023/testerflight architecture

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

- Interactive diagram: https://gitdiagram.com/toriqul2023/testerflight
- Repository: https://github.com/toriqul2023/testerflight

## Overview

1. This repository is a small Java/Maven application organized around a classic controller–model split. The code lives under `src/main/java`, with domain objects in `Model` and request/operation handlers in `Controller`. There is no separate service or repository layer, so the controllers appear to be the main orchestration boundary.

2. The core domain consists of three model types: `User`, `Flight`, and `Booking`. These represent the main business entities the application manages. `CommonInFlight_User` suggests a shared base or interface between user/flight-related logic, likely used to factor common fields or behaviors.

3. The controller layer is divided by responsibility:
   - `loginRegHandle` handles authentication and registration flows.
   - `userController` manages user-related operations.
   - `flightController` manages flight-related operations.
   - `bookingController` manages booking-related operations.
   - `UserException` provides a custom error path for user-domain failures.

4. The application’s data source appears to be file-backed JSON stored in `src/main/resources`: `user.json`, `flight.json`, and `booking.json`. That points to a lightweight persistence model where runtime state is loaded from and written back to JSON files rather than a database. Those resource files are an important architectural boundary because they define the application’s durable state.

5. `Main.java` is the entry point and likely wires the controllers together or starts whatever runtime the project uses. Because the repo has no obvious framework-specific application class or config tree, the startup flow is probably simple and local to the JVM process.

6. The likely runtime data flow is:
   - `Main` initializes the app.
   - Controllers receive inputs or commands.
   - Controllers create/update `Model` objects.
   - Changes are reflected in the JSON resource files.
   This means the controllers are both the business logic layer and the persistence coordination layer.

7. `pom.xml` indicates the project is built with Maven, so dependency management and packaging are handled in the standard Java build lifecycle. The `Dockerfile` and `render.yaml` show the project is intended to be containerized and deployable to Render, which matters for runtime packaging but not for the internal code structure.

8. The architecture is intentionally minimal: no database, no message broker, no external API client layer, and no separate UI assets in the tree. That makes the main dependency boundary the filesystem itself, with JSON files acting as the persistence interface.

9. Error handling is localized, at least for user operations, through `UserException`. This suggests domain-specific validation or workflow failures are surfaced directly from the controller layer rather than through a centralized exception framework.

10. For an architecture diagram, the main nodes should be:
   - Application entry point (`Main`)
   - Controller layer (`loginRegHandle`, `userController`, `flightController`, `bookingController`)
   - Domain model layer (`User`, `Flight`, `Booking`, shared base/type)
   - File-backed JSON storage (`user.json`, `flight.json`, `booking.json`)
   - Deployment packaging (`Maven`, `Docker`, `Render`)

11. The most important boundary to capture is that persistence is not abstracted behind a database or ORM. Instead, the controllers likely read/write the JSON files directly or through simple utility code. That makes the application self-contained, with state externalized only as resource files inside the project.

12. Overall, this is a compact domain application for managing users, flights, and bookings, with authentication/registration support and file-based persistence. The design is simple and linear, which should be reflected in the diagram as a small set of controllers centered around shared model objects and JSON-backed state.

Main entry points: [`src/main/java/Controller/bookingController.java`](https://github.com/toriqul2023/testerflight/blob/main/src/main/java/Controller/bookingController.java) (Bookings), [`src/main/java/Main.java`](https://github.com/toriqul2023/testerflight/blob/main/src/main/java/Main.java) (Main), [`src/main/java/Controller/userController.java`](https://github.com/toriqul2023/testerflight/blob/main/src/main/java/Controller/userController.java) (Users), [`src/main/java/Model/User.java`](https://github.com/toriqul2023/testerflight/blob/main/src/main/java/Model/User.java) (User)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_group_entry["Runtime"]
  node_node_main(("Main<br/>entrypoint<br/>[Main.java]"))
end

subgraph group_group_controller["Controllers"]
  node_node_login["Login / Reg<br/>auth controller"]
  node_node_user_ctrl["Users<br/>domain controller"]
  node_node_flight_ctrl["Flights<br/>domain controller"]
  node_node_booking_ctrl["Bookings<br/>domain controller"]
  node_node_user_ex{{"User Error<br/>exception<br/>[UserException.java]"}}
end

subgraph group_group_model["Domain"]
  node_node_user["User<br/>entity<br/>[User.java]"]
  node_node_flight["Flight<br/>entity<br/>[Flight.java]"]
  node_node_booking["Booking<br/>entity<br/>[Booking.java]"]
  node_node_common["Shared Base<br/>shared model"]
end

subgraph group_group_storage["JSON Store"]
  node_node_user_json[("user.json<br/>json store<br/>[user.json]")]
  node_node_flight_json[("flight.json<br/>json store<br/>[flight.json]")]
  node_node_booking_json[("booking.json<br/>json store<br/>[booking.json]")]
end

subgraph group_group_delivery["Build & Deploy"]
  node_node_pom["Maven<br/>build<br/>[pom.xml]"]
  node_node_docker["Dockerfile<br/>container build"]
  node_node_render["Render<br/>deploy config<br/>[render.yaml]"]
end

node_node_main -->|"starts"| node_node_login
node_node_main -->|"starts"| node_node_user_ctrl
node_node_main -->|"starts"| node_node_flight_ctrl
node_node_main -->|"starts"| node_node_booking_ctrl
node_node_login -->|"uses"| node_node_user
node_node_user_ctrl -->|"manages"| node_node_user
node_node_flight_ctrl -->|"manages"| node_node_flight
node_node_booking_ctrl -->|"manages"| node_node_booking
node_node_booking_ctrl -->|"links"| node_node_user
node_node_booking_ctrl -->|"links"| node_node_flight
node_node_user -->|"inherits"| node_node_common
node_node_flight -->|"inherits"| node_node_common
node_node_user_ctrl -.->|"raises"| node_node_user_ex
node_node_login -->|"persists"| node_node_user_json
node_node_user_ctrl -->|"persists"| node_node_user_json
node_node_flight_ctrl -->|"persists"| node_node_flight_json
node_node_booking_ctrl -->|"persists"| node_node_booking_json
node_node_pom -->|"builds"| node_node_main
node_node_docker -->|"packages"| node_node_pom
node_node_render -->|"deploys"| node_node_docker

click node_node_main "https://github.com/toriqul2023/testerflight/blob/main/src/main/java/Main.java"
click node_node_login "https://github.com/toriqul2023/testerflight/blob/main/src/main/java/Controller/loginRegHandle.java"
click node_node_user_ctrl "https://github.com/toriqul2023/testerflight/blob/main/src/main/java/Controller/userController.java"
click node_node_flight_ctrl "https://github.com/toriqul2023/testerflight/blob/main/src/main/java/Controller/flightController.java"
click node_node_booking_ctrl "https://github.com/toriqul2023/testerflight/blob/main/src/main/java/Controller/bookingController.java"
click node_node_user_ex "https://github.com/toriqul2023/testerflight/blob/main/src/main/java/Controller/UserException.java"
click node_node_user "https://github.com/toriqul2023/testerflight/blob/main/src/main/java/Model/User.java"
click node_node_flight "https://github.com/toriqul2023/testerflight/blob/main/src/main/java/Model/Flight.java"
click node_node_booking "https://github.com/toriqul2023/testerflight/blob/main/src/main/java/Model/Booking.java"
click node_node_common "https://github.com/toriqul2023/testerflight/blob/main/src/main/java/Model/CommonInFlight_User.java"
click node_node_user_json "https://github.com/toriqul2023/testerflight/blob/main/src/main/resources/user.json"
click node_node_flight_json "https://github.com/toriqul2023/testerflight/blob/main/src/main/resources/flight.json"
click node_node_booking_json "https://github.com/toriqul2023/testerflight/blob/main/src/main/resources/booking.json"
click node_node_pom "https://github.com/toriqul2023/testerflight/blob/main/pom.xml"
click node_node_docker "https://github.com/toriqul2023/testerflight/tree/main/Dockerfile"
click node_node_render "https://github.com/toriqul2023/testerflight/blob/main/render.yaml"

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_node_main toneBlue
class node_node_login,node_node_user_ctrl,node_node_flight_ctrl,node_node_booking_ctrl,node_node_user_ex toneAmber
class node_node_user,node_node_flight,node_node_booking,node_node_common toneMint
class node_node_user_json,node_node_flight_json,node_node_booking_json toneRose
class node_node_pom,node_node_docker,node_node_render toneIndigo
```

## Components

### Runtime

Application startup and orchestration

- [Main](https://github.com/toriqul2023/testerflight/blob/main/src/main/java/Main.java): entrypoint · Application entry point · `src/main/java/Main.java`

### Controllers

Command and domain operation handlers

- [Login / Reg](https://github.com/toriqul2023/testerflight/blob/main/src/main/java/Controller/loginRegHandle.java): auth controller · Authentication and registration flow · `src/main/java/Controller/loginRegHandle.java`
- [Users](https://github.com/toriqul2023/testerflight/blob/main/src/main/java/Controller/userController.java): domain controller · User operations and coordination · `src/main/java/Controller/userController.java`
- [Flights](https://github.com/toriqul2023/testerflight/blob/main/src/main/java/Controller/flightController.java): domain controller · Flight operations and coordination · `src/main/java/Controller/flightController.java`
- [Bookings](https://github.com/toriqul2023/testerflight/blob/main/src/main/java/Controller/bookingController.java): domain controller · Booking operations and coordination · `src/main/java/Controller/bookingController.java`
- [User Error](https://github.com/toriqul2023/testerflight/blob/main/src/main/java/Controller/UserException.java): exception · Domain-specific user failure path · `src/main/java/Controller/UserException.java`

### Domain

Core business entities and shared types

- [User](https://github.com/toriqul2023/testerflight/blob/main/src/main/java/Model/User.java): entity · User domain object · `src/main/java/Model/User.java`
- [Flight](https://github.com/toriqul2023/testerflight/blob/main/src/main/java/Model/Flight.java): entity · Flight domain object · `src/main/java/Model/Flight.java`
- [Booking](https://github.com/toriqul2023/testerflight/blob/main/src/main/java/Model/Booking.java): entity · Booking domain object · `src/main/java/Model/Booking.java`
- [Shared Base](https://github.com/toriqul2023/testerflight/blob/main/src/main/java/Model/CommonInFlight_User.java): shared model · Common user-flight abstraction · `src/main/java/Model/CommonInFlight_User.java`

### JSON Store

File-backed persistent state

- [user.json](https://github.com/toriqul2023/testerflight/blob/main/src/main/resources/user.json): json store · Persisted user state · `src/main/resources/user.json`
- [flight.json](https://github.com/toriqul2023/testerflight/blob/main/src/main/resources/flight.json): json store · Persisted flight state · `src/main/resources/flight.json`
- [booking.json](https://github.com/toriqul2023/testerflight/blob/main/src/main/resources/booking.json): json store · Persisted booking state · `src/main/resources/booking.json`

### Build & Deploy

Packaging and deployment artifacts

- [Maven](https://github.com/toriqul2023/testerflight/blob/main/pom.xml): build · Dependency and packaging management · `pom.xml`
- [Dockerfile](https://github.com/toriqul2023/testerflight/tree/main/Dockerfile): container build · Container packaging · `Dockerfile`
- [Render](https://github.com/toriqul2023/testerflight/blob/main/render.yaml): deploy config · Deployment configuration · `render.yaml`

## Connections

- Main → Login / Reg: starts · Bootstraps authentication flow
- Main → Users: starts · Bootstraps user operations
- Main → Flights: starts · Bootstraps flight operations
- Main → Bookings: starts · Bootstraps booking operations
- Login / Reg → User: uses · Creates and validates users
- Users → User: manages · Reads and updates users
- Flights → Flight: manages · Reads and updates flights
- Bookings → Booking: manages · Reads and updates bookings
- Bookings → User: links · Associates bookings with users
- Bookings → Flight: links · Associates bookings with flights
- User → Shared Base: inherits · Shares common user-flight behavior
- Flight → Shared Base: inherits · Shares common user-flight behavior
- Users → User Error: raises · User-domain failure path
- Login / Reg → user.json: persists · Stores user state in JSON
- Users → user.json: persists · Stores user state in JSON
- Flights → flight.json: persists · Stores flight state in JSON
- Bookings → booking.json: persists · Stores booking state in JSON
- Maven → Main: builds · Maven compiles and packages the app
- Dockerfile → Maven: packages · Container image wraps the Maven-built app
- Render → Dockerfile: deploys · Render deploys the containerized app
