# mayuresh0508/ride_it-main architecture

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

- Interactive diagram: https://gitdiagram.com/mayuresh0508/ride_it-main
- Repository: https://github.com/mayuresh0508/ride_it-main

## Overview

1. **Repository shape**
   This is a two-part project: a Java backend under `back-end/Ride_It` and a frontend workspace under `front-end/ride-it-frontend`. The backend is the only part whose internal architecture is visible here; the frontend’s implementation details are not present in the tree.

2. **Backend style**
   The backend is a **Spring Boot monolith** organized by layers rather than by feature packages. The runtime entry point is `RideItApplication`, with app configuration in `src/main/resources/application.properties`. Maven is the build tool, and there is a GitHub Actions workflow for Maven-based CI.

3. **Request boundary**
   Incoming HTTP traffic is handled by controllers in `com.rideit.controller`:
   `AuthController`, `AdminController`, `CustomerController`, `OwnerController`, `BikeController`-related logic appears to live in service/DAO layers rather than a dedicated controller package, plus `BankAccountController` and `PayementController`.
   These controllers are the main API boundary between the external clients and the backend.

4. **Service layer**
   Business logic is concentrated in `com.rideit.services`. Each domain area has an interface and often a concrete implementation:
   `BikeService`, `BookingService`-related interface only, `CustomerService`, `OwnerService`, `PaymentService`, `BankAccountService`, `AdminService`, plus photo services.
   This layer is the central orchestration point: controllers call services, services enforce rules, and services coordinate persistence and security-related lookups.

5. **Persistence boundary**
   Data access is separated into DAO classes in `com.rideit.dao` such as `BikeDao`, `BookingDao`, `CustomerDao`, `OwnerDao`, `PaymentDao`, `BankAccountDao`, `UserEntityDao`, and photo-related DAOs.
   The repository uses a classic DAO/repository abstraction to isolate the service layer from persistence details.

6. **Domain model**
   Core entities live in `com.rideit.pojo`. The main business objects are:
   `Bike`, `Booking`, `Customer`, `Owner`, `Payment`, `BankAccount`, `Location`, `DamageReport`, `ProfilePhoto`, `PhotosByString`, `User`, `UserEntity`, and `Admin`.
   `BaseEntity` suggests shared audit or identity fields. `UserEntity` / `UserEntityId` imply a join or mapping entity for user-role relationships.

7. **API contracts and DTOs**
   The `com.rideit.dto` package contains the request/response boundary objects used to avoid exposing persistence entities directly. Examples include:
   `BookingRequestDto`, `BikeResponseDto`, `BikeForOwnerDto`, `OwnerRegisterDto`, `OwnerLoginRequesetDto`, `CustomerLoginRequestDto`, `CustomerLoginResponseDto`, `BankAccountDto`, `LocationDto`, `ProfilePhotoDto`, and `ApiResponse`.
   This indicates the backend transforms between API models and internal entities at the service/controller boundary.

8. **Authentication and authorization**
   Security is a major subsystem under `com.rideit.security`.
   It includes `SecurityConfig`, `JwtUtils`, `CustomJwtAuthenticationFilter`, `CustomUserDetailsService`, `CustomUserDetails`, and `CustomAuthenticationEntryPoint`.
   The presence of JWT utilities and a custom filter indicates stateless token-based authentication, likely protecting role-specific endpoints for admin, owner, customer, and possibly bike/payment operations.

9. **Business domains visible in the codebase**
   The structure suggests a ride-sharing / bike-rental platform with these functional domains:
   bike inventory and bike photos, owner management, customer accounts, bookings, payments, bank account linking, and admin oversight.
   Enumerations such as `BookingStatus`, `PaymentStatus`, `ReviewStatus`, `Role`, `Status`, and `FuelType` show explicit workflow/state management in the domain model.

10. **Error handling**
   Custom exceptions in `com.rideit.customException` (`LoginException`, `RegisterException`, `ResourceNotFoundException`) indicate the service layer raises domain-specific failures rather than generic HTTP errors. These are likely translated by controller-level handling into API responses.

11. **Cross-cutting configuration**
   `CorsConfig` suggests the backend is intended to be consumed by a separate frontend origin. That is an important architecture boundary: the frontend and backend are decoupled and communicate over HTTP with CORS enabled.

12. **Testing and delivery**
   There is a minimal test scaffold in `src/test/java/com/rideit/RideItApplicationTests.java`, but no visible broad test suite. CI is configured via `.github/workflows/maven.yml`, so the main delivery path is Maven build/test validation.

13. **What to diagram**
   An accurate architecture diagram should center on:
   frontend client(s) → Spring MVC controllers → service layer → DAO/persistence → entities/database,
   with JWT security intercepting requests before controller execution.
   A secondary flow should show DTO mapping between controllers/services and the domain model, plus photo-related and payment-related subsystems as specialized vertical slices inside the monolith.

Main entry points: [`back-end/Ride_It/src/main/java/com/rideit/services`](https://github.com/mayuresh0508/ride_it-main/tree/main/back-end/Ride_It/src/main/java/com/rideit/services) (Domain services), [`back-end/Ride_It/src/main/java/com/rideit/security/CustomJwtAuthenticationFilter.java`](https://github.com/mayuresh0508/ride_it-main/blob/main/back-end/Ride_It/src/main/java/com/rideit/security/CustomJwtAuthenticationFilter.java) (JWT filter), [`back-end/Ride_It/src/main/java/com/rideit/dto`](https://github.com/mayuresh0508/ride_it-main/tree/main/back-end/Ride_It/src/main/java/com/rideit/dto) (DTOs), [`back-end/Ride_It/src/main/java/com/rideit/security/SecurityConfig.java`](https://github.com/mayuresh0508/ride_it-main/blob/main/back-end/Ride_It/src/main/java/com/rideit/security/SecurityConfig.java) (Security config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend workspace"]
  node_frontend_workspace["Frontend app<br/>client workspace"]
end

subgraph group_backend["Spring Boot backend"]
  node_app_entry(("RideIt app<br/>spring boot entrypoint"))
  node_cors_config["CORS config<br/>web config<br/>[CorsConfig.java]"]
  node_security_config["Security config<br/>jwt security"]
  node_jwt_filter["JWT filter<br/>request filter"]
  node_user_details["User details<br/>auth principal"]
  node_auth_controller["Auth API<br/>http controller"]
  node_admin_controller["Admin API<br/>http controller"]
  node_customer_controller["Customer API<br/>http controller"]
  node_owner_controller["Owner API<br/>http controller"]
  node_bank_controller["Bank API<br/>http controller"]
  node_payment_controller["Payment API<br/>http controller"]
  node_service_layer["Domain services<br/>business services"]
  node_bike_service["Bike service<br/>domain service<br/>[BikeService.java]"]
  node_booking_service["Booking service<br/>domain service"]
  node_account_service["Account services<br/>domain services"]
  node_photo_service["Photo services<br/>media services<br/>[PhotoService.java]"]
  node_dao_layer["DAO layer<br/>persistence access"]
  node_domain_model[("Domain model<br/>entities and enums")]
  node_dto_layer["DTOs<br/>api contracts"]
  node_exceptions["Domain errors<br/>custom exceptions"]
end

subgraph group_delivery["Build and CI"]
  node_maven_ci["Maven CI<br/>github actions workflow<br/>[maven.yml]"]
end

node_frontend_workspace -->|"calls API"| node_cors_config
node_app_entry -->|"loads"| node_cors_config
node_app_entry -->|"boots"| node_security_config
node_security_config -->|"registers"| node_jwt_filter
node_security_config -->|"uses"| node_user_details
node_jwt_filter -->|"guards"| node_auth_controller
node_jwt_filter -->|"guards"| node_admin_controller
node_jwt_filter -->|"guards"| node_customer_controller
node_jwt_filter -->|"guards"| node_owner_controller
node_jwt_filter -->|"guards"| node_bank_controller
node_jwt_filter -->|"guards"| node_payment_controller
node_auth_controller -->|"delegates"| node_service_layer
node_admin_controller -->|"delegates"| node_service_layer
node_customer_controller -->|"delegates"| node_service_layer
node_owner_controller -->|"delegates"| node_service_layer
node_bank_controller -->|"delegates"| node_service_layer
node_payment_controller -->|"delegates"| node_service_layer
node_service_layer -->|"includes"| node_bike_service
node_service_layer -->|"includes"| node_booking_service
node_service_layer -->|"includes"| node_account_service
node_service_layer -->|"includes"| node_photo_service
node_service_layer -->|"persists via"| node_dao_layer
node_service_layer -->|"maps to"| node_dto_layer
node_dao_layer -->|"stores"| node_domain_model
node_auth_controller -->|"exchanges"| node_dto_layer
node_admin_controller -->|"exchanges"| node_dto_layer
node_customer_controller -->|"exchanges"| node_dto_layer
node_owner_controller -->|"exchanges"| node_dto_layer
node_bank_controller -->|"exchanges"| node_dto_layer
node_payment_controller -->|"exchanges"| node_dto_layer
node_service_layer -->|"raises"| node_exceptions
node_maven_ci -->|"validates"| node_app_entry

click node_frontend_workspace "https://github.com/mayuresh0508/ride_it-main/tree/main/front-end/ride-it-frontend"
click node_app_entry "https://github.com/mayuresh0508/ride_it-main/blob/main/back-end/Ride_It/src/main/java/com/rideit/RideItApplication.java"
click node_cors_config "https://github.com/mayuresh0508/ride_it-main/blob/main/back-end/Ride_It/src/main/java/com/rideit/CorsConfig.java"
click node_security_config "https://github.com/mayuresh0508/ride_it-main/blob/main/back-end/Ride_It/src/main/java/com/rideit/security/SecurityConfig.java"
click node_jwt_filter "https://github.com/mayuresh0508/ride_it-main/blob/main/back-end/Ride_It/src/main/java/com/rideit/security/CustomJwtAuthenticationFilter.java"
click node_user_details "https://github.com/mayuresh0508/ride_it-main/blob/main/back-end/Ride_It/src/main/java/com/rideit/security/CustomUserDetailsService.java"
click node_auth_controller "https://github.com/mayuresh0508/ride_it-main/blob/main/back-end/Ride_It/src/main/java/com/rideit/controller/AuthController.java"
click node_admin_controller "https://github.com/mayuresh0508/ride_it-main/blob/main/back-end/Ride_It/src/main/java/com/rideit/controller/AdminController.java"
click node_customer_controller "https://github.com/mayuresh0508/ride_it-main/blob/main/back-end/Ride_It/src/main/java/com/rideit/controller/CustomerController.java"
click node_owner_controller "https://github.com/mayuresh0508/ride_it-main/blob/main/back-end/Ride_It/src/main/java/com/rideit/controller/OwnerController.java"
click node_bank_controller "https://github.com/mayuresh0508/ride_it-main/blob/main/back-end/Ride_It/src/main/java/com/rideit/controller/BankAccountController.java"
click node_payment_controller "https://github.com/mayuresh0508/ride_it-main/blob/main/back-end/Ride_It/src/main/java/com/rideit/controller/PayementController.java"
click node_service_layer "https://github.com/mayuresh0508/ride_it-main/tree/main/back-end/Ride_It/src/main/java/com/rideit/services"
click node_bike_service "https://github.com/mayuresh0508/ride_it-main/blob/main/back-end/Ride_It/src/main/java/com/rideit/services/BikeService.java"
click node_booking_service "https://github.com/mayuresh0508/ride_it-main/blob/main/back-end/Ride_It/src/main/java/com/rideit/services/IBookingService.java"
click node_account_service "https://github.com/mayuresh0508/ride_it-main/tree/main/back-end/Ride_It/src/main/java/com/rideit/services"
click node_photo_service "https://github.com/mayuresh0508/ride_it-main/blob/main/back-end/Ride_It/src/main/java/com/rideit/services/PhotoService.java"
click node_dao_layer "https://github.com/mayuresh0508/ride_it-main/tree/main/back-end/Ride_It/src/main/java/com/rideit/dao"
click node_domain_model "https://github.com/mayuresh0508/ride_it-main/tree/main/back-end/Ride_It/src/main/java/com/rideit/pojo"
click node_dto_layer "https://github.com/mayuresh0508/ride_it-main/tree/main/back-end/Ride_It/src/main/java/com/rideit/dto"
click node_exceptions "https://github.com/mayuresh0508/ride_it-main/tree/main/back-end/Ride_It/src/main/java/com/rideit/customException"
click node_maven_ci "https://github.com/mayuresh0508/ride_it-main/blob/main/.github/workflows/maven.yml"

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_workspace toneBlue
class node_app_entry,node_cors_config,node_security_config,node_jwt_filter,node_user_details,node_auth_controller,node_admin_controller,node_customer_controller,node_owner_controller,node_bank_controller,node_payment_controller,node_service_layer,node_bike_service,node_booking_service,node_account_service,node_photo_service,node_dao_layer,node_domain_model,node_dto_layer,node_exceptions toneAmber
class node_maven_ci toneMint
```

## Components

### Frontend workspace

Separate client workspace consumed over HTTP

- [Frontend app](https://github.com/mayuresh0508/ride_it-main/tree/main/front-end/ride-it-frontend): client workspace · Separate frontend project; implementation details are not visible in the tree · `front-end/ride-it-frontend`

### Spring Boot backend

Monolithic Java backend organized by layers

- [RideIt app](https://github.com/mayuresh0508/ride_it-main/blob/main/back-end/Ride_It/src/main/java/com/rideit/RideItApplication.java): spring boot entrypoint · Main application bootstrap for the backend · `back-end/Ride_It/src/main/java/com/rideit/RideItApplication.java`
- [CORS config](https://github.com/mayuresh0508/ride_it-main/blob/main/back-end/Ride_It/src/main/java/com/rideit/CorsConfig.java): web config · Cross-origin access boundary for the separate frontend · `back-end/Ride_It/src/main/java/com/rideit/CorsConfig.java`
- [Security config](https://github.com/mayuresh0508/ride_it-main/blob/main/back-end/Ride_It/src/main/java/com/rideit/security/SecurityConfig.java): jwt security · Stateless authentication and request protection setup · `back-end/Ride_It/src/main/java/com/rideit/security/SecurityConfig.java`
- [JWT filter](https://github.com/mayuresh0508/ride_it-main/blob/main/back-end/Ride_It/src/main/java/com/rideit/security/CustomJwtAuthenticationFilter.java): request filter · Interprets bearer tokens before controller execution · `back-end/Ride_It/src/main/java/com/rideit/security/CustomJwtAuthenticationFilter.java`
- [User details](https://github.com/mayuresh0508/ride_it-main/blob/main/back-end/Ride_It/src/main/java/com/rideit/security/CustomUserDetailsService.java): auth principal · Custom authenticated user representation and lookup service · `back-end/Ride_It/src/main/java/com/rideit/security/CustomUserDetailsService.java`
- [Auth API](https://github.com/mayuresh0508/ride_it-main/blob/main/back-end/Ride_It/src/main/java/com/rideit/controller/AuthController.java): http controller · Login and registration boundary · `back-end/Ride_It/src/main/java/com/rideit/controller/AuthController.java`
- [Admin API](https://github.com/mayuresh0508/ride_it-main/blob/main/back-end/Ride_It/src/main/java/com/rideit/controller/AdminController.java): http controller · Administrative HTTP boundary · `back-end/Ride_It/src/main/java/com/rideit/controller/AdminController.java`
- [Customer API](https://github.com/mayuresh0508/ride_it-main/blob/main/back-end/Ride_It/src/main/java/com/rideit/controller/CustomerController.java): http controller · Customer-facing HTTP boundary · `back-end/Ride_It/src/main/java/com/rideit/controller/CustomerController.java`
- [Owner API](https://github.com/mayuresh0508/ride_it-main/blob/main/back-end/Ride_It/src/main/java/com/rideit/controller/OwnerController.java): http controller · Owner-facing HTTP boundary · `back-end/Ride_It/src/main/java/com/rideit/controller/OwnerController.java`
- [Bank API](https://github.com/mayuresh0508/ride_it-main/blob/main/back-end/Ride_It/src/main/java/com/rideit/controller/BankAccountController.java): http controller · Bank account HTTP boundary · `back-end/Ride_It/src/main/java/com/rideit/controller/BankAccountController.java`
- [Payment API](https://github.com/mayuresh0508/ride_it-main/blob/main/back-end/Ride_It/src/main/java/com/rideit/controller/PayementController.java): http controller · Payment HTTP boundary · `back-end/Ride_It/src/main/java/com/rideit/controller/PayementController.java`
- [Domain services](https://github.com/mayuresh0508/ride_it-main/tree/main/back-end/Ride_It/src/main/java/com/rideit/services): business services · Core orchestration and rule enforcement across ride-share domains · `back-end/Ride_It/src/main/java/com/rideit/services`
- [Bike service](https://github.com/mayuresh0508/ride_it-main/blob/main/back-end/Ride_It/src/main/java/com/rideit/services/BikeService.java): domain service · Bike inventory and bike-related coordination · `back-end/Ride_It/src/main/java/com/rideit/services/BikeService.java`
- [Booking service](https://github.com/mayuresh0508/ride_it-main/blob/main/back-end/Ride_It/src/main/java/com/rideit/services/IBookingService.java): domain service · Booking lifecycle coordination · `back-end/Ride_It/src/main/java/com/rideit/services/IBookingService.java`
- [Account services](https://github.com/mayuresh0508/ride_it-main/tree/main/back-end/Ride_It/src/main/java/com/rideit/services): domain services · Customer, owner, admin, payment, and bank account workflows · `back-end/Ride_It/src/main/java/com/rideit/services`
- [Photo services](https://github.com/mayuresh0508/ride_it-main/blob/main/back-end/Ride_It/src/main/java/com/rideit/services/PhotoService.java): media services · Profile and bike photo handling · `back-end/Ride_It/src/main/java/com/rideit/services/PhotoService.java`
- [DAO layer](https://github.com/mayuresh0508/ride_it-main/tree/main/back-end/Ride_It/src/main/java/com/rideit/dao): persistence access · Persistence boundary isolating services from storage details · `back-end/Ride_It/src/main/java/com/rideit/dao`
- [Domain model](https://github.com/mayuresh0508/ride_it-main/tree/main/back-end/Ride_It/src/main/java/com/rideit/pojo): entities and enums · Core entities, embedded identities, and workflow states · `back-end/Ride_It/src/main/java/com/rideit/pojo`
- [DTOs](https://github.com/mayuresh0508/ride_it-main/tree/main/back-end/Ride_It/src/main/java/com/rideit/dto): api contracts · Request and response objects at the HTTP boundary · `back-end/Ride_It/src/main/java/com/rideit/dto`
- [Domain errors](https://github.com/mayuresh0508/ride_it-main/tree/main/back-end/Ride_It/src/main/java/com/rideit/customException): custom exceptions · Business-level failures translated to API responses · `back-end/Ride_It/src/main/java/com/rideit/customException`

### Build and CI

Maven build and GitHub Actions validation

- [Maven CI](https://github.com/mayuresh0508/ride_it-main/blob/main/.github/workflows/maven.yml): github actions workflow · Repository delivery pipeline using Maven build and test validation · `.github/workflows/maven.yml`

## Connections

- Frontend app → CORS config: calls API · Frontend communicates with backend over cross-origin HTTP
- RideIt app → CORS config: loads · Application bootstrap includes web CORS setup
- RideIt app → Security config: boots · Application starts the security configuration
- Security config → JWT filter: registers · Security chain installs JWT request filtering
- Security config → User details: uses · Security chain depends on custom user lookup and principal logic
- JWT filter → Auth API: guards · Tokens are validated before protected HTTP handlers run
- JWT filter → Admin API: guards · Role-protected endpoints pass through JWT filtering
- JWT filter → Customer API: guards · Role-protected endpoints pass through JWT filtering
- JWT filter → Owner API: guards · Role-protected endpoints pass through JWT filtering
- JWT filter → Bank API: guards · Role-protected endpoints pass through JWT filtering
- JWT filter → Payment API: guards · Role-protected endpoints pass through JWT filtering
- Auth API → Domain services: delegates · Authentication endpoints call into the business layer
- Admin API → Domain services: delegates · Administrative actions are orchestrated by services
- Customer API → Domain services: delegates · Customer actions are orchestrated by services
- Owner API → Domain services: delegates · Owner actions are orchestrated by services
- Bank API → Domain services: delegates · Bank account actions are orchestrated by services
- Payment API → Domain services: delegates · Payment actions are orchestrated by services
- Domain services → Bike service: includes · Bike domain service participates in central business orchestration
- Domain services → Booking service: includes · Booking workflows are a core service boundary
- Domain services → Account services: includes · Customer, owner, admin, payment, and bank account workflows
- Domain services → Photo services: includes · Photo handling is a dedicated service slice
- Domain services → DAO layer: persists via · Services coordinate persistence through DAO abstractions
- Domain services → DTOs: maps to · Services transform between API contracts and entities
- DAO layer → Domain model: stores · DAOs operate on core entities and workflow state
- Auth API → DTOs: exchanges · Login and registration payloads use DTOs
- Admin API → DTOs: exchanges · Administrative requests and responses use DTOs
- Customer API → DTOs: exchanges · Customer requests and responses use DTOs
- Owner API → DTOs: exchanges · Owner requests and responses use DTOs
- Bank API → DTOs: exchanges · Bank account data uses DTOs
- Payment API → DTOs: exchanges · Payment data uses DTOs
- Domain services → Domain errors: raises · Domain failures are surfaced as custom exceptions
- Maven CI → RideIt app: validates · CI builds and tests the backend application
