# hemant19singh/uberapp architecture

> Architecture diagram of the GitHub repository hemant19singh/uberapp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hemant19singh/uberapp
- Repository: https://github.com/hemant19singh/uberapp

## Overview

##### Project type and purpose
- This is a Spring Boot backend monolith (“UberApp”) that exposes REST endpoints for a ride-sharing service. It uses Postgres + PostGIS for spatial queries, JWT for security, and external services (OSRM for routing, SMTP for email).

##### File-structure analysis
- Top-level: pom.xml, src/main/java, src/main/resources.
- Packages under com.codingshuttle.project.uber.uberApp:
- controllers – REST controllers (Auth, Rider, Driver)
- dto – input/output data transfer objects
- entities – JPA entities (User, Rider, Driver, Ride, Wallet, etc.)
- repositories – Spring Data JPA interfaces to Postgres
- services – business-logic interfaces; impl subpackage holds implementations
- strategies – strategy interfaces and implementations for driver matching, fare-calculation, payment
- configs – MapperConfig, SecurityConfig, WebSecurityConfig
- security – JWT filter and service
- advices – global exception/response handlers
- utils – helper classes (e.g., GeometryUtil)
- src/main/resources holds application-*.properties and data.sql.
- Tests mirror the service layer.

##### README insights
- Core features: user signup/role assignment, ride request → ride creation, two matching strategies (rating, distance), two fare strategies (default, surge), two payment modes (wallet, cash), email notifications on ride start, ratings, wallet.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Client["Client (Mobile/Web)"]:::external

    subgraph "Entry Point"
        Entry["UberAppApplication"]:::entry
    end

    subgraph "Security Layer"
        AuthFilter["JwtAuthFilter"]:::security
        JwtService["JwtService"]:::security
        WebSecConfig["WebSecurityConfig"]:::security
        SecConfig["SecurityConfig"]:::security
    end

    subgraph "API Layer"
        Controllers["Controllers"]:::controllers
    end

    subgraph "Advices"
        AdvicesDir["Advices"]:::advices
    end

    subgraph "Service Layer"
        ServicesInt["Service Interfaces"]:::services
        ServicesImpl["Service Implementations"]:::services
    end

    subgraph "Strategy Layer"
        StrategiesInt["Strategy Interfaces"]:::strategy
        StrategiesImpl["Strategy Implementations"]:::strategy
    end

    subgraph "Persistence Layer"
        Repos["Repositories"]:::repository
        DB["Postgres + PostGIS"]:::database
    end

    subgraph "Domain Model"
        Entities["Entities"]:::domain
    end

    subgraph "DTOs"
        DTOs["DTOs"]:::dtos
    end

    subgraph "Configurations"
        MapperConfig["MapperConfig"]:::config
    end

    subgraph "Utilities"
        GeometryUtil["GeometryUtil"]:::utils
    end

    subgraph "Resources"
        Resources["application-*.properties & data.sql"]:::resources
    end

    subgraph "External Services"
        OSRM["OSRM Routing"]:::external
        SMTP["SMTP Email"]:::external
    end

    Client --> AuthFilter
    AuthFilter --> Controllers
    Controllers --> ServicesInt
    ServicesInt -->|implemented by| ServicesImpl
    ServicesImpl --> StrategiesInt
    StrategiesInt -->|implemented by| StrategiesImpl
    ServicesImpl --> Repos
    Repos --> DB
    ServicesImpl --> OSRM
    ServicesImpl --> SMTP
    Controllers --> AdvicesDir
    ServicesImpl -->|uses| GeometryUtil
    Entry --> Controllers

    click Controllers "https://github.com/hemant19singh/uberapp/tree/main/uberApp/src/main/java/com/codingshuttle/project/uber/uberApp/controllers"
    click AuthFilter "https://github.com/hemant19singh/uberapp/blob/main/uberApp/src/main/java/com/codingshuttle/project/uber/uberApp/security/JwtAuthFilter.java"
    click JwtService "https://github.com/hemant19singh/uberapp/blob/main/uberApp/src/main/java/com/codingshuttle/project/uber/uberApp/security/JwtService.java"
    click WebSecConfig "https://github.com/hemant19singh/uberapp/blob/main/uberApp/src/main/java/com/codingshuttle/project/uber/uberApp/configs/WebSecurityConfig.java"
    click SecConfig "https://github.com/hemant19singh/uberapp/blob/main/uberApp/src/main/java/com/codingshuttle/project/uber/uberApp/configs/SecurityConfig.java"
    click ServicesInt "https://github.com/hemant19singh/uberapp/tree/main/uberApp/src/main/java/com/codingshuttle/project/uber/uberApp/services"
    click ServicesImpl "https://github.com/hemant19singh/uberapp/tree/main/uberApp/src/main/java/com/codingshuttle/project/uber/uberApp/services/impl"
    click StrategiesInt "https://github.com/hemant19singh/uberapp/tree/main/uberApp/src/main/java/com/codingshuttle/project/uber/uberApp/strategies"
    click StrategiesImpl "https://github.com/hemant19singh/uberapp/tree/main/uberApp/src/main/java/com/codingshuttle/project/uber/uberApp/strategies/impl"
    click Repos "https://github.com/hemant19singh/uberapp/tree/main/uberApp/src/main/java/com/codingshuttle/project/uber/uberApp/repositories"
    click Entities "https://github.com/hemant19singh/uberapp/tree/main/uberApp/src/main/java/com/codingshuttle/project/uber/uberApp/entities"
    click DTOs "https://github.com/hemant19singh/uberapp/tree/main/uberApp/src/main/java/com/codingshuttle/project/uber/uberApp/dto"
    click MapperConfig "https://github.com/hemant19singh/uberapp/blob/main/uberApp/src/main/java/com/codingshuttle/project/uber/uberApp/configs/MapperConfig.java"
    click AdvicesDir "https://github.com/hemant19singh/uberapp/tree/main/uberApp/src/main/java/com/codingshuttle/project/uber/uberApp/advices"
    click GeometryUtil "https://github.com/hemant19singh/uberapp/blob/main/uberApp/src/main/java/com/codingshuttle/project/uber/uberApp/utils/GeometryUtil.java"
    click Entry "https://github.com/hemant19singh/uberapp/blob/main/uberApp/src/main/java/com/codingshuttle/project/uber/uberApp/UberAppApplication.java"
    click Resources "https://github.com/hemant19singh/uberapp/blob/main/uberApp/src/main/resources/application.properties"

    classDef controllers fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef security fill:#FFB6C1,stroke:#333,stroke-width:1px
    classDef services fill:#90EE90,stroke:#333,stroke-width:1px
    classDef strategy fill:#FFA500,stroke:#333,stroke-width:1px
    classDef repository fill:#9370DB,stroke:#333,stroke-width:1px
    classDef database fill:#8A2BE2,stroke:#333,stroke-width:1px
    classDef external fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef advices fill:#FFFACD,stroke:#333,stroke-width:1px
    classDef domain fill:#FFC0CB,stroke:#333,stroke-width:1px
    classDef dtos fill:#E0FFFF,stroke:#333,stroke-width:1px
    classDef config fill:#FFD700,stroke:#333,stroke-width:1px
    classDef utils fill:#F5F5F5,stroke:#333,stroke-width:1px
    classDef entry fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef resources fill:#98FB98,stroke:#333,stroke-width:1px
```
