# gunasurya/carpoolapp architecture

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

- Interactive diagram: https://gitdiagram.com/gunasurya/carpoolapp
- Repository: https://github.com/gunasurya/carpoolapp

## Overview

CarpoolApp is an Angular client backed by an ASP.NET Core API and SQL Server. The main workflow is account registration or login, then offering a ride or searching for a match, booking a ride, and reviewing rides or profile details. The API separates controllers, business services, repositories, and EF Core persistence; ride matching and booking are distinct domain stages. The README documents authentication and ride scheduling, while sampled sources show the service and persistence boundaries. Some client-to-API wiring and unsampled UI behavior are not established by the excerpts.

Main entry points: [`CarpoolApplication-main/src/app/modules/carpooling/carpooling-routing.module.ts`](https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApplication-main/src/app/modules/carpooling/carpooling-routing.module.ts) (Ride routing), [`CarpoolApi-main/CarPoolServiceAPI/Controllers/CarpoolController.cs`](https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApi-main/CarPoolServiceAPI/Controllers/CarpoolController.cs) (API controllers), [`CarpoolApi-main/CarpoolService.BAL/Services/RideService.cs`](https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApi-main/CarpoolService.BAL/Services/RideService.cs) (Ride service), [`CarpoolApi-main/CarpoolService.BAL/Services/UserService.cs`](https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApi-main/CarpoolService.BAL/Services/UserService.cs) (User service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Angular client"]
  node_app["Angular app<br/>[app.module.ts]"]
  node_routes["App routing"]
  node_ride_routes["Ride routing"]
end

subgraph group_auth["Identity"]
  node_login_ui["Login and signup<br/>[login.component.ts]"]
  node_guard["Token guard"]
  node_interceptor["Auth interceptor"]
  node_user_client["User client<br/>[user.service.ts]"]
  node_profile["Profile"]
end

subgraph group_ride["Ride operations"]
  node_dashboard["Ride dashboard"]
  node_ride_search["Find rides<br/>[home.component.ts]"]
  node_offer_ride["Offer ride"]
  node_book_ride["Book ride"]
  node_my_rides["My rides"]
end

subgraph group_backend["API services"]
  node_api["API controllers"]
  node_auth_api["Authentication API"]
  node_user_api["User API<br/>[UserController.cs]"]
  node_ride_service["Ride service<br/>[RideService.cs]"]
  node_user_service["User service<br/>[UserService.cs]"]
  node_token_service["Token service<br/>[TokenService.cs]"]
  node_password_hash["Password hashing"]
  node_api_response["API response<br/>[ApiResponse.cs]"]
end

subgraph group_data["Persistence"]
  node_ride_repository["Ride repository<br/>[RideRepository.cs]"]
  node_user_repository["User repository<br/>[UserRepository.cs]"]
  node_db[("Carpool database")]
  node_ride_model["Ride records<br/>[CarPoolRide.cs]"]
end

node_rider(("Rider"))

node_rider -->|"uses"| node_app
node_app -->|"loads"| node_routes
node_routes -->|"routes to"| node_login_ui
node_routes -->|"routes to"| node_ride_routes
node_ride_routes -->|"routes to"| node_dashboard
node_ride_routes -->|"routes to"| node_ride_search
node_ride_routes -->|"routes to"| node_offer_ride
node_ride_routes -->|"routes to"| node_book_ride
node_ride_routes -->|"routes to"| node_my_rides
node_ride_routes -->|"routes to"| node_profile
node_app -->|"registers"| node_interceptor
node_auth_api -->|"calls"| node_user_service
node_auth_api -->|"calls"| node_token_service
node_user_api -->|"calls"| node_user_service
node_api -->|"calls"| node_ride_service
node_user_service -->|"delegates to"| node_user_repository
node_user_service -->|"hashes with"| node_password_hash
node_ride_service -->|"delegates to"| node_ride_repository
node_ride_service -->|"queries"| node_db
node_ride_service -->|"checks seats"| node_ride_model
node_ride_repository -->|"persists rides"| node_db
node_user_repository -->|"persists users"| node_db
node_login_ui -.->|"uses"| node_user_client
node_interceptor -.->|"reads token"| node_guard
node_user_client -.->|"HTTP requests"| node_auth_api
node_ride_search -.->|"requests matches"| node_api
node_offer_ride -.->|"submits offer"| node_api
node_book_ride -.->|"submits booking"| node_api
node_my_rides -.->|"requests rides"| node_api
node_profile -.->|"uses"| node_user_client

click node_app "https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApplication-main/src/app/app.module.ts"
click node_routes "https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApplication-main/src/app/app-routing.module.ts"
click node_ride_routes "https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApplication-main/src/app/modules/carpooling/carpooling-routing.module.ts"
click node_login_ui "https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApplication-main/src/app/login/login.component.ts"
click node_guard "https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApplication-main/src/app/services/auth-guard.service.ts"
click node_interceptor "https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApplication-main/src/app/interceptors/auth.interceptor.ts"
click node_user_client "https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApplication-main/src/app/services/user.service.ts"
click node_dashboard "https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApplication-main/src/app/modules/carpooling/components/dashboard/dashboard.component.ts"
click node_ride_search "https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApplication-main/src/app/modules/carpooling/components/home/home.component.ts"
click node_offer_ride "https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApplication-main/src/app/modules/carpooling/components/offer-ride/offer-ride.component.ts"
click node_book_ride "https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApplication-main/src/app/modules/carpooling/components/book-ride/book-ride.component.ts"
click node_my_rides "https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApplication-main/src/app/modules/carpooling/components/my-rides/my-rides.component.ts"
click node_profile "https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApplication-main/src/app/modules/carpooling/components/profile/profile.component.ts"
click node_api "https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApi-main/CarPoolServiceAPI/Controllers/CarpoolController.cs"
click node_auth_api "https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApi-main/CarPoolServiceAPI/Controllers/AuthenticationController.cs"
click node_user_api "https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApi-main/CarPoolServiceAPI/Controllers/UserController.cs"
click node_ride_service "https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApi-main/CarpoolService.BAL/Services/RideService.cs"
click node_user_service "https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApi-main/CarpoolService.BAL/Services/UserService.cs"
click node_token_service "https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApi-main/CarpoolService.BAL/Services/TokenService.cs"
click node_password_hash "https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApi-main/CarpoolService.BAL/Services/BCryptAdapterService.cs"
click node_ride_repository "https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApi-main/CarpoolService.DAL/Repositories/RideRepository.cs"
click node_user_repository "https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApi-main/CarpoolService.DAL/Repositories/UserRepository.cs"
click node_db "https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApi-main/CarpoolService.DAL/CarpoolDbContext.cs"
click node_ride_model "https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApi-main/CarPoolService.Models/DBModels/CarPoolRide.cs"
click node_api_response "https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApi-main/CarPoolService.Models/ApiResponse.cs"

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_routes,node_ride_routes toneBlue
class node_login_ui,node_guard,node_interceptor,node_user_client,node_profile toneAmber
class node_dashboard,node_ride_search,node_offer_ride,node_book_ride,node_my_rides toneMint
class node_api,node_auth_api,node_user_api,node_ride_service,node_user_service,node_token_service,node_password_hash,node_api_response toneRose
class node_ride_repository,node_user_repository,node_db,node_ride_model,node_rider toneIndigo
```

## Components

### Angular client

- [Angular app](https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApplication-main/src/app/app.module.ts): `CarpoolApplication-main/src/app/app.module.ts`
- [App routing](https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApplication-main/src/app/app-routing.module.ts): `CarpoolApplication-main/src/app/app-routing.module.ts`
- [Ride routing](https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApplication-main/src/app/modules/carpooling/carpooling-routing.module.ts): `CarpoolApplication-main/src/app/modules/carpooling/carpooling-routing.module.ts`

### Identity

- [Login and signup](https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApplication-main/src/app/login/login.component.ts): `CarpoolApplication-main/src/app/login/login.component.ts`
- [Token guard](https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApplication-main/src/app/services/auth-guard.service.ts): `CarpoolApplication-main/src/app/services/auth-guard.service.ts`
- [Auth interceptor](https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApplication-main/src/app/interceptors/auth.interceptor.ts): `CarpoolApplication-main/src/app/interceptors/auth.interceptor.ts`
- [User client](https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApplication-main/src/app/services/user.service.ts): `CarpoolApplication-main/src/app/services/user.service.ts`
- [Profile](https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApplication-main/src/app/modules/carpooling/components/profile/profile.component.ts): `CarpoolApplication-main/src/app/modules/carpooling/components/profile/profile.component.ts`

### Ride operations

- [Ride dashboard](https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApplication-main/src/app/modules/carpooling/components/dashboard/dashboard.component.ts): `CarpoolApplication-main/src/app/modules/carpooling/components/dashboard/dashboard.component.ts`
- [Find rides](https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApplication-main/src/app/modules/carpooling/components/home/home.component.ts): `CarpoolApplication-main/src/app/modules/carpooling/components/home/home.component.ts`
- [Offer ride](https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApplication-main/src/app/modules/carpooling/components/offer-ride/offer-ride.component.ts): `CarpoolApplication-main/src/app/modules/carpooling/components/offer-ride/offer-ride.component.ts`
- [Book ride](https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApplication-main/src/app/modules/carpooling/components/book-ride/book-ride.component.ts): `CarpoolApplication-main/src/app/modules/carpooling/components/book-ride/book-ride.component.ts`
- [My rides](https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApplication-main/src/app/modules/carpooling/components/my-rides/my-rides.component.ts): `CarpoolApplication-main/src/app/modules/carpooling/components/my-rides/my-rides.component.ts`

### API services

- [API controllers](https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApi-main/CarPoolServiceAPI/Controllers/CarpoolController.cs): `CarpoolApi-main/CarPoolServiceAPI/Controllers/CarpoolController.cs`
- [Authentication API](https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApi-main/CarPoolServiceAPI/Controllers/AuthenticationController.cs): `CarpoolApi-main/CarPoolServiceAPI/Controllers/AuthenticationController.cs`
- [User API](https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApi-main/CarPoolServiceAPI/Controllers/UserController.cs): `CarpoolApi-main/CarPoolServiceAPI/Controllers/UserController.cs`
- [Ride service](https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApi-main/CarpoolService.BAL/Services/RideService.cs): `CarpoolApi-main/CarpoolService.BAL/Services/RideService.cs`
- [User service](https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApi-main/CarpoolService.BAL/Services/UserService.cs): `CarpoolApi-main/CarpoolService.BAL/Services/UserService.cs`
- [Token service](https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApi-main/CarpoolService.BAL/Services/TokenService.cs): `CarpoolApi-main/CarpoolService.BAL/Services/TokenService.cs`
- [Password hashing](https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApi-main/CarpoolService.BAL/Services/BCryptAdapterService.cs): `CarpoolApi-main/CarpoolService.BAL/Services/BCryptAdapterService.cs`
- [API response](https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApi-main/CarPoolService.Models/ApiResponse.cs): `CarpoolApi-main/CarPoolService.Models/ApiResponse.cs`

### Persistence

- [Ride repository](https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApi-main/CarpoolService.DAL/Repositories/RideRepository.cs): `CarpoolApi-main/CarpoolService.DAL/Repositories/RideRepository.cs`
- [User repository](https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApi-main/CarpoolService.DAL/Repositories/UserRepository.cs): `CarpoolApi-main/CarpoolService.DAL/Repositories/UserRepository.cs`
- [Carpool database](https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApi-main/CarpoolService.DAL/CarpoolDbContext.cs): `CarpoolApi-main/CarpoolService.DAL/CarpoolDbContext.cs`
- [Ride records](https://github.com/gunasurya/carpoolapp/blob/main/CarpoolApi-main/CarPoolService.Models/DBModels/CarPoolRide.cs): `CarpoolApi-main/CarPoolService.Models/DBModels/CarPoolRide.cs`

### Other components

- **Rider**

## Connections

- Rider → Angular app: uses
- Angular app → App routing: loads (evidence: `CarpoolApplication-main/src/app/app.module.ts`)
- App routing → Login and signup: routes to (evidence: `CarpoolApplication-main/src/app/app-routing.module.ts`)
- App routing → Ride routing: routes to (evidence: `CarpoolApplication-main/src/app/app-routing.module.ts`)
- Ride routing → Ride dashboard: routes to (evidence: `CarpoolApplication-main/src/app/modules/carpooling/carpooling-routing.module.ts`)
- Ride routing → Find rides: routes to (evidence: `CarpoolApplication-main/src/app/modules/carpooling/carpooling-routing.module.ts`)
- Ride routing → Offer ride: routes to (evidence: `CarpoolApplication-main/src/app/modules/carpooling/carpooling-routing.module.ts`)
- Ride routing → Book ride: routes to (evidence: `CarpoolApplication-main/src/app/modules/carpooling/carpooling-routing.module.ts`)
- Ride routing → My rides: routes to (evidence: `CarpoolApplication-main/src/app/modules/carpooling/carpooling-routing.module.ts`)
- Ride routing → Profile: routes to (evidence: `CarpoolApplication-main/src/app/modules/carpooling/carpooling-routing.module.ts`)
- Angular app → Auth interceptor: registers (evidence: `CarpoolApplication-main/src/app/app.module.ts`)
- Authentication API → User service: calls (evidence: `CarpoolApi-main/CarPoolServiceAPI/Controllers/AuthenticationController.cs`)
- Authentication API → Token service: calls (evidence: `CarpoolApi-main/CarPoolServiceAPI/Controllers/AuthenticationController.cs`)
- User API → User service: calls (evidence: `CarpoolApi-main/CarPoolServiceAPI/Controllers/UserController.cs`)
- API controllers → Ride service: calls (evidence: `CarpoolApi-main/CarPoolServiceAPI/Controllers/CarpoolController.cs`)
- User service → User repository: delegates to (evidence: `CarpoolApi-main/CarpoolService.BAL/Services/UserService.cs`)
- User service → Password hashing: hashes with (evidence: `CarpoolApi-main/CarpoolService.BAL/Services/UserService.cs`)
- Ride service → Ride repository: delegates to (evidence: `CarpoolApi-main/CarpoolService.BAL/Services/RideService.cs`)
- Ride service → Carpool database: queries (evidence: `CarpoolApi-main/CarpoolService.BAL/Services/RideService.cs`)
- Ride service → Ride records: checks seats (evidence: `CarpoolApi-main/CarpoolService.BAL/Services/RideService.cs`)
- Ride repository → Carpool database: persists rides (evidence: `CarpoolApi-main/CarpoolService.DAL/Repositories/RideRepository.cs`)
- User repository → Carpool database: persists users (evidence: `CarpoolApi-main/CarpoolService.DAL/Repositories/UserRepository.cs`)
- Login and signup → User client: uses (evidence: `CarpoolApplication-main/src/app/login/login.component.ts`)
- Auth interceptor → Token guard: reads token
- User client → Authentication API: HTTP requests
- Find rides → API controllers: requests matches
- Offer ride → API controllers: submits offer
- Book ride → API controllers: submits booking
- My rides → API controllers: requests rides
- Profile → User client: uses
