How mayuresh0508/ride_it-main works
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: services Domain services · CustomJwtAuthenticationFilter.java JWT filter · dto DTOs · SecurityConfig.java Security config
Components 22
Frontend workspace
Separate client workspace consumed over HTTP
- Frontend app · 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 · Main application bootstrap for the backend
back-end/Ride_It/src/main/java/com/rideit/RideItApplication.java - CORS config · Cross-origin access boundary for the separate frontend
back-end/Ride_It/src/main/java/com/rideit/CorsConfig.java - Security config · Stateless authentication and request protection setup
back-end/Ride_It/src/main/java/com/rideit/security/SecurityConfig.java - JWT filter · Interprets bearer tokens before controller execution
back-end/Ride_It/src/main/java/com/rideit/security/CustomJwtAuthenticationFilter.java - User details · Custom authenticated user representation and lookup service
back-end/Ride_It/src/main/java/com/rideit/security/CustomUserDetailsService.java - Auth API · Login and registration boundary
back-end/Ride_It/src/main/java/com/rideit/controller/AuthController.java - Admin API · Administrative HTTP boundary
back-end/Ride_It/src/main/java/com/rideit/controller/AdminController.java - Customer API · Customer-facing HTTP boundary
back-end/Ride_It/src/main/java/com/rideit/controller/CustomerController.java - Owner API · Owner-facing HTTP boundary
back-end/Ride_It/src/main/java/com/rideit/controller/OwnerController.java - Bank API · Bank account HTTP boundary
back-end/Ride_It/src/main/java/com/rideit/controller/BankAccountController.java - Payment API · Payment HTTP boundary
back-end/Ride_It/src/main/java/com/rideit/controller/PayementController.java - Domain services · Core orchestration and rule enforcement across ride-share domains
back-end/Ride_It/src/main/java/com/rideit/services - Bike service · Bike inventory and bike-related coordination
back-end/Ride_It/src/main/java/com/rideit/services/BikeService.java - Booking service · Booking lifecycle coordination
back-end/Ride_It/src/main/java/com/rideit/services/IBookingService.java - Account services · Customer, owner, admin, payment, and bank account workflows
back-end/Ride_It/src/main/java/com/rideit/services - Photo services · Profile and bike photo handling
back-end/Ride_It/src/main/java/com/rideit/services/PhotoService.java - DAO layer · Persistence boundary isolating services from storage details
back-end/Ride_It/src/main/java/com/rideit/dao - Domain model · Core entities, embedded identities, and workflow states
back-end/Ride_It/src/main/java/com/rideit/pojo - DTOs · Request and response objects at the HTTP boundary
back-end/Ride_It/src/main/java/com/rideit/dto - Domain errors · 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 · Repository delivery pipeline using Maven build and test validation
.github/workflows/maven.yml
Connections 32
- 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