# khaitran18/goshare architecture

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

- Interactive diagram: https://gitdiagram.com/khaitran18/goshare
- Repository: https://github.com/khaitran18/goshare

## Overview

GoShare is a ride-hailing API backend serving passenger, driver, and admin workflows. Passengers book and track trips, including bookings for dependents; drivers manage requests and trip progress; admins manage users, drivers, trips, and feedback. Supporting capabilities include wallets and payments, location tracking, chat, ratings, reports, and settings. The graph combines documented product capabilities with source-index and excerpt evidence; several feature links remain unverified because their handlers and controller wiring were not sampled.

Main entry points: [`Api_Mobile/Program.cs`](https://github.com/khaitran18/goshare/blob/main/Api_Mobile/Program.cs) (Mobile API), [`Domain/Interfaces/IUnitOfWork.cs`](https://github.com/khaitran18/goshare/blob/main/Domain/Interfaces/IUnitOfWork.cs) (Unit of work), [`Api_Admin/Controllers`](https://github.com/khaitran18/goshare/tree/main/Api_Admin/Controllers) (Admin features), [`Application/UseCase/TripUC/Handlers`](https://github.com/khaitran18/goshare/tree/main/Application/UseCase/TripUC/Handlers) (Trip use cases)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API surfaces"]
  node_mobile["Mobile API<br/>[Program.cs]"]
  node_adminapi["Admin API<br/>[Program.cs]"]
  node_mobiletrip["Trip endpoints<br/>[TripController.cs]"]
  node_mobiledriver["Driver endpoints"]
  node_adminuser["User endpoints<br/>[UserController.cs]"]
end

subgraph group_journey["Ride workflows"]
  node_tripuse["Trip use cases"]
  node_driveruse["Driver use cases"]
  node_locationuse["Location use cases"]
  node_tripdata["Trip records<br/>[Trip.cs]"]
  node_chat["Chat use cases"]
end

subgraph group_accounts["People and safety"]
  node_useruse["User use cases"]
  node_authuse["Authentication"]
  node_userdata["User records<br/>[User.cs]"]
end

subgraph group_money["Payments and admin"]
  node_walletuse["Wallet use cases"]
  node_payment["Payment use cases"]
  node_transactions["Transaction queries"]
  node_walletdata["Wallet records<br/>[Wallet.cs]"]
  node_adminfeatures["Admin features"]
  node_feedback["Feedback use cases"]
  node_reports["Reports"]
  node_settingsfees["Settings and fees"]
end

subgraph group_platform["Persistence and services"]
  node_triprepo["Trip repository<br/>[TripRepository.cs]"]
  node_userrepo["User repository<br/>[UserRepository.cs]"]
  node_walletrepo["Wallet repository"]
  node_uow["Unit of work<br/>[IUnitOfWork.cs]"]
  node_database[("Relational database<br/>[GoShareContext.cs]")]
  node_storage["Firebase storage<br/>[FirebaseStorage.cs]"]
  node_maps["Google Maps"]
  node_vnpay["VNPay<br/>[PaymentService.cs]"]
end

node_clients(("App users"))
node_guardian(("Guardian"))

node_clients -.->|"uses"| node_mobile
node_mobile -.->|"hosts"| node_mobiletrip
node_mobile -.->|"hosts"| node_mobiledriver
node_adminapi -.->|"hosts"| node_adminuser
node_mobiletrip -.->|"dispatches"| node_tripuse
node_mobiledriver -->|"dispatches"| node_driveruse
node_adminuser -->|"dispatches"| node_useruse
node_tripuse -.->|"reads trips"| node_triprepo
node_triprepo -->|"loads"| node_tripdata
node_useruse -.->|"reads users"| node_userrepo
node_userrepo -->|"queries"| node_userdata
node_locationuse -->|"reads trips"| node_triprepo
node_locationuse -->|"uses"| node_uow
node_driveruse -->|"uses"| node_uow
node_transactions -->|"uses"| node_uow
node_transactions -->|"loads wallet"| node_walletrepo
node_walletrepo -->|"queries"| node_walletdata
node_uow -->|"exposes"| node_walletrepo
node_mobile -.->|"supports messaging"| node_chat
node_mobile -.->|"supports tracking"| node_locationuse
node_mobile -.->|"supports payments"| node_payment
node_mobile -.->|"supports wallets"| node_walletuse
node_clients -.->|"requests assistance"| node_guardian
node_guardian -.->|"tracks dependents"| node_mobile
node_adminapi -.->|"provides management"| node_adminfeatures
node_adminfeatures -.->|"views feedback"| node_feedback
node_adminfeatures -.->|"manages reports"| node_reports
node_adminfeatures -.->|"manages settings"| node_settingsfees
node_payment -.->|"integrates"| node_vnpay
node_driveruse -.->|"uploads documents"| node_storage
node_tripuse -.->|"uses routing"| node_maps
node_uow -.->|"backs repositories"| node_database

click node_mobile "https://github.com/khaitran18/goshare/blob/main/Api_Mobile/Program.cs"
click node_adminapi "https://github.com/khaitran18/goshare/blob/main/Api_Admin/Program.cs"
click node_mobiletrip "https://github.com/khaitran18/goshare/blob/main/Api_Mobile/Controllers/TripController.cs"
click node_mobiledriver "https://github.com/khaitran18/goshare/blob/main/Api_Mobile/Controllers/DriverController.cs"
click node_adminuser "https://github.com/khaitran18/goshare/blob/main/Api_Admin/Controllers/UserController.cs"
click node_tripuse "https://github.com/khaitran18/goshare/tree/main/Application/UseCase/TripUC/Handlers"
click node_driveruse "https://github.com/khaitran18/goshare/tree/main/Application/UseCase/DriverUC/Handlers"
click node_locationuse "https://github.com/khaitran18/goshare/tree/main/Application/UseCase/LocationUC/Handlers"
click node_tripdata "https://github.com/khaitran18/goshare/blob/main/Domain/DataModels/Trip.cs"
click node_triprepo "https://github.com/khaitran18/goshare/blob/main/Infrastructure/Repositories/TripRepository.cs"
click node_useruse "https://github.com/khaitran18/goshare/tree/main/Application/UseCase/UserUC/Handlers"
click node_authuse "https://github.com/khaitran18/goshare/tree/main/Application/UseCase/AuthUC/Handlers"
click node_userdata "https://github.com/khaitran18/goshare/blob/main/Domain/DataModels/User.cs"
click node_userrepo "https://github.com/khaitran18/goshare/blob/main/Infrastructure/Repositories/UserRepository.cs"
click node_chat "https://github.com/khaitran18/goshare/tree/main/Application/UseCase/ChatUC/Handlers"
click node_walletuse "https://github.com/khaitran18/goshare/tree/main/Application/UseCase/WalletUC/Handlers"
click node_payment "https://github.com/khaitran18/goshare/tree/main/Application/UseCase/PaymentUC/Handler"
click node_transactions "https://github.com/khaitran18/goshare/blob/main/Application/UseCase/WallettransactionUC/Handlers/GetUserTransactionQueryHandler.cs"
click node_walletdata "https://github.com/khaitran18/goshare/blob/main/Domain/DataModels/Wallet.cs"
click node_walletrepo "https://github.com/khaitran18/goshare/blob/main/Infrastructure/Repositories/WalletRepository.cs"
click node_adminfeatures "https://github.com/khaitran18/goshare/tree/main/Api_Admin/Controllers"
click node_feedback "https://github.com/khaitran18/goshare/tree/main/Application/UseCase/AppfeedbackUC/Handlers"
click node_reports "https://github.com/khaitran18/goshare/tree/main/Application/UseCase/ReportUC/Handlers"
click node_settingsfees "https://github.com/khaitran18/goshare/tree/main/Application/UseCase/FeeUC/Handler"
click node_uow "https://github.com/khaitran18/goshare/blob/main/Domain/Interfaces/IUnitOfWork.cs"
click node_database "https://github.com/khaitran18/goshare/blob/main/Infrastructure/Data/GoShareContext.cs"
click node_storage "https://github.com/khaitran18/goshare/blob/main/Application/Services/FirebaseStorage.cs"
click node_maps "https://github.com/khaitran18/goshare/blob/main/Application/Common/Utilities/Google/GoogleMapsApiUtilities.cs"
click node_vnpay "https://github.com/khaitran18/goshare/blob/main/Application/Services/PaymentService.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_mobile,node_adminapi,node_mobiletrip,node_mobiledriver,node_adminuser,node_clients toneBlue
class node_tripuse,node_driveruse,node_locationuse,node_tripdata,node_chat toneAmber
class node_useruse,node_authuse,node_userdata toneMint
class node_walletuse,node_payment,node_transactions,node_walletdata,node_adminfeatures,node_feedback,node_reports,node_settingsfees toneRose
class node_triprepo,node_userrepo,node_walletrepo,node_uow,node_database,node_storage,node_maps,node_vnpay,node_guardian toneIndigo
```

## Components

### API surfaces

- [Mobile API](https://github.com/khaitran18/goshare/blob/main/Api_Mobile/Program.cs): `Api_Mobile/Program.cs`
- [Admin API](https://github.com/khaitran18/goshare/blob/main/Api_Admin/Program.cs): `Api_Admin/Program.cs`
- [Trip endpoints](https://github.com/khaitran18/goshare/blob/main/Api_Mobile/Controllers/TripController.cs): `Api_Mobile/Controllers/TripController.cs`
- [Driver endpoints](https://github.com/khaitran18/goshare/blob/main/Api_Mobile/Controllers/DriverController.cs): `Api_Mobile/Controllers/DriverController.cs`
- [User endpoints](https://github.com/khaitran18/goshare/blob/main/Api_Admin/Controllers/UserController.cs): `Api_Admin/Controllers/UserController.cs`

### Ride workflows

- [Trip use cases](https://github.com/khaitran18/goshare/tree/main/Application/UseCase/TripUC/Handlers): `Application/UseCase/TripUC/Handlers`
- [Driver use cases](https://github.com/khaitran18/goshare/tree/main/Application/UseCase/DriverUC/Handlers): `Application/UseCase/DriverUC/Handlers`
- [Location use cases](https://github.com/khaitran18/goshare/tree/main/Application/UseCase/LocationUC/Handlers): `Application/UseCase/LocationUC/Handlers`
- [Trip records](https://github.com/khaitran18/goshare/blob/main/Domain/DataModels/Trip.cs): `Domain/DataModels/Trip.cs`
- [Chat use cases](https://github.com/khaitran18/goshare/tree/main/Application/UseCase/ChatUC/Handlers): `Application/UseCase/ChatUC/Handlers`

### People and safety

- [User use cases](https://github.com/khaitran18/goshare/tree/main/Application/UseCase/UserUC/Handlers): `Application/UseCase/UserUC/Handlers`
- [Authentication](https://github.com/khaitran18/goshare/tree/main/Application/UseCase/AuthUC/Handlers): `Application/UseCase/AuthUC/Handlers`
- [User records](https://github.com/khaitran18/goshare/blob/main/Domain/DataModels/User.cs): `Domain/DataModels/User.cs`

### Payments and admin

- [Wallet use cases](https://github.com/khaitran18/goshare/tree/main/Application/UseCase/WalletUC/Handlers): `Application/UseCase/WalletUC/Handlers`
- [Payment use cases](https://github.com/khaitran18/goshare/tree/main/Application/UseCase/PaymentUC/Handler): `Application/UseCase/PaymentUC/Handler`
- [Transaction queries](https://github.com/khaitran18/goshare/blob/main/Application/UseCase/WallettransactionUC/Handlers/GetUserTransactionQueryHandler.cs): `Application/UseCase/WallettransactionUC/Handlers/GetUserTransactionQueryHandler.cs`
- [Wallet records](https://github.com/khaitran18/goshare/blob/main/Domain/DataModels/Wallet.cs): `Domain/DataModels/Wallet.cs`
- [Admin features](https://github.com/khaitran18/goshare/tree/main/Api_Admin/Controllers): `Api_Admin/Controllers`
- [Feedback use cases](https://github.com/khaitran18/goshare/tree/main/Application/UseCase/AppfeedbackUC/Handlers): `Application/UseCase/AppfeedbackUC/Handlers`
- [Reports](https://github.com/khaitran18/goshare/tree/main/Application/UseCase/ReportUC/Handlers): `Application/UseCase/ReportUC/Handlers`
- [Settings and fees](https://github.com/khaitran18/goshare/tree/main/Application/UseCase/FeeUC/Handler): `Application/UseCase/FeeUC/Handler`

### Persistence and services

- [Trip repository](https://github.com/khaitran18/goshare/blob/main/Infrastructure/Repositories/TripRepository.cs): `Infrastructure/Repositories/TripRepository.cs`
- [User repository](https://github.com/khaitran18/goshare/blob/main/Infrastructure/Repositories/UserRepository.cs): `Infrastructure/Repositories/UserRepository.cs`
- [Wallet repository](https://github.com/khaitran18/goshare/blob/main/Infrastructure/Repositories/WalletRepository.cs): `Infrastructure/Repositories/WalletRepository.cs`
- [Unit of work](https://github.com/khaitran18/goshare/blob/main/Domain/Interfaces/IUnitOfWork.cs): `Domain/Interfaces/IUnitOfWork.cs`
- [Relational database](https://github.com/khaitran18/goshare/blob/main/Infrastructure/Data/GoShareContext.cs): `Infrastructure/Data/GoShareContext.cs`
- [Firebase storage](https://github.com/khaitran18/goshare/blob/main/Application/Services/FirebaseStorage.cs): `Application/Services/FirebaseStorage.cs`
- [Google Maps](https://github.com/khaitran18/goshare/blob/main/Application/Common/Utilities/Google/GoogleMapsApiUtilities.cs): `Application/Common/Utilities/Google/GoogleMapsApiUtilities.cs`
- [VNPay](https://github.com/khaitran18/goshare/blob/main/Application/Services/PaymentService.cs): `Application/Services/PaymentService.cs`

### Other components

- **App users**
- **Guardian**

## Connections

- App users → Mobile API: uses
- Mobile API → Trip endpoints: hosts
- Mobile API → Driver endpoints: hosts
- Admin API → User endpoints: hosts
- Trip endpoints → Trip use cases: dispatches
- Driver endpoints → Driver use cases: dispatches (evidence: `Api_Mobile/Controllers/DriverController.cs`)
- User endpoints → User use cases: dispatches (evidence: `Api_Admin/Controllers/UserController.cs`)
- Trip use cases → Trip repository: reads trips (evidence: `Application/UseCase/TripUC/Handlers/GetTripQueryHandler.cs`)
- Trip repository → Trip records: loads (evidence: `Infrastructure/Repositories/TripRepository.cs`)
- User use cases → User repository: reads users (evidence: `Application/UseCase/UserUC/Handlers/GetDriverRegisterCodeQueryHandler.cs`)
- User repository → User records: queries (evidence: `Infrastructure/Repositories/UserRepository.cs`)
- Location use cases → Trip repository: reads trips (evidence: `Application/UseCase/LocationUC/Handlers/GetLocationQueryHandler.cs`)
- Location use cases → Unit of work: uses (evidence: `Application/UseCase/LocationUC/Handlers/GetLocationQueryHandler.cs`)
- Driver use cases → Unit of work: uses (evidence: `Application/UseCase/DriverUC/Handlers/GetDriverWalletStatisticQueryHandler.cs`)
- Transaction queries → Unit of work: uses (evidence: `Application/UseCase/WallettransactionUC/Handlers/GetUserTransactionQueryHandler.cs`)
- Transaction queries → Wallet repository: loads wallet (evidence: `Application/UseCase/WallettransactionUC/Handlers/GetUserTransactionQueryHandler.cs`)
- Wallet repository → Wallet records: queries (evidence: `Infrastructure/Repositories/WalletRepository.cs`)
- Unit of work → Wallet repository: exposes (evidence: `Domain/Interfaces/IUnitOfWork.cs`)
- Mobile API → Chat use cases: supports messaging
- Mobile API → Location use cases: supports tracking
- Mobile API → Payment use cases: supports payments
- Mobile API → Wallet use cases: supports wallets
- App users → Guardian: requests assistance
- Guardian → Mobile API: tracks dependents
- Admin API → Admin features: provides management
- Admin features → Feedback use cases: views feedback
- Admin features → Reports: manages reports
- Admin features → Settings and fees: manages settings
- Payment use cases → VNPay: integrates
- Driver use cases → Firebase storage: uploads documents
- Trip use cases → Google Maps: uses routing
- Unit of work → Relational database: backs repositories
