# cgsindac/triptogo architecture

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

- Interactive diagram: https://gitdiagram.com/cgsindac/triptogo
- Repository: https://github.com/cgsindac/triptogo

## Overview

TripToGo is a Lipa City tourism app: users sign in, browse places and reviews, and submit reviews or place suggestions for administrator moderation. The mobile app communicates with a Spring backend, whose services validate requests and persist accounts, places, and reviews in PostgreSQL. The README also describes preference-and-budget recommendations and map features, though their implementation was not sampled; those capabilities are represented without asserting unverified internal call paths. Relationships below are limited to excerpted references or README statements.

Main entry points: [`TTGBackend/src/main/java/com/TripToGo/TTGBackend/Services/ReviewService.java`](https://github.com/cgsindac/triptogo/blob/main/TTGBackend/src/main/java/com/TripToGo/TTGBackend/Services/ReviewService.java) (Reviews and moderation), [`TTGMobile/src/data/api.ts`](https://github.com/cgsindac/triptogo/blob/main/TTGMobile/src/data/api.ts) (API transport), [`TTGMobile/src/app`](https://github.com/cgsindac/triptogo/tree/main/TTGMobile/src/app) (Mobile screens), [`TTGBackend/src/main/java/com/TripToGo/TTGBackend/Services/LocationService.java`](https://github.com/cgsindac/triptogo/blob/main/TTGBackend/src/main/java/com/TripToGo/TTGBackend/Services/LocationService.java) (Place catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile app"]
  node_mobile_app["Mobile screens"]
  node_review_dialog["Review dialog<br/>[ReviewDialog.tsx]"]
  node_mobile_auth["Auth client<br/>[auth.ts]"]
  node_mobile_reviews["Review client<br/>[reviews.ts]"]
  node_mobile_places["Place client<br/>[places.ts]"]
  node_mobile_api["API transport<br/>[api.ts]"]
end

subgraph group_backend["Backend API"]
  node_auth_controller["Authentication API"]
  node_user_controller["User API"]
  node_location_controller["Place API"]
  node_review_controller["Review API"]
  node_auth_service["Sessions and accounts<br/>[AuthService.java]"]
  node_user_service["User management<br/>[UserService.java]"]
  node_location_service["Place catalog"]
  node_review_service["Reviews and moderation<br/>[ReviewService.java]"]
  node_validation["Input validation"]
  node_recommendations["Budget recommendations"]
end

subgraph group_domain["Tourism domain and persistence"]
  node_account_data[("Account records")]
  node_location_data[("Place records")]
  node_review_data[("Review records")]
  node_review_contracts["Review request options"]
end

subgraph group_platform["External systems"]
  node_postgres[("PostgreSQL")]
end

node_traveler(("Traveler or admin"))

node_traveler -->|"uses"| node_mobile_app
node_mobile_app -->|"signs in"| node_mobile_auth
node_mobile_auth -->|"requests"| node_mobile_api
node_mobile_app -.->|"browses places"| node_mobile_places
node_mobile_app -->|"reads reviews"| node_mobile_reviews
node_mobile_app -->|"opens submission"| node_review_dialog
node_review_dialog -->|"submits review"| node_mobile_reviews
node_mobile_reviews -->|"sends requests"| node_mobile_api
node_mobile_places -.->|"sends requests"| node_mobile_api
node_mobile_api -.->|"calls auth API"| node_auth_controller
node_mobile_api -.->|"calls place API"| node_location_controller
node_mobile_api -.->|"calls review API"| node_review_controller
node_traveler -->|"registers or logs in"| node_auth_controller
node_traveler -->|"browses catalog"| node_location_controller
node_traveler -.->|"requests suggestions"| node_recommendations
node_traveler -->|"uses city map"| node_location_controller
node_auth_controller -.->|"delegates"| node_auth_service
node_user_controller -->|"uses sessions"| node_auth_service
node_user_controller -->|"delegates"| node_user_service
node_location_controller -->|"delegates"| node_location_service
node_location_controller -->|"loads review options"| node_review_service
node_review_controller -->|"delegates"| node_review_service
node_review_controller -->|"checks identity"| node_auth_service
node_auth_service -->|"authenticates users"| node_user_service
node_auth_service -->|"checks admins"| node_account_data
node_user_service -->|"reads and writes"| node_account_data
node_location_service -->|"validates input"| node_validation
node_location_service -->|"searches catalog"| node_location_data
node_location_service -->|"aggregates ratings"| node_review_data
node_review_controller -->|"accepts review data"| node_review_contracts
node_review_service -->|"validates input"| node_validation
node_review_service -->|"resolves proposals"| node_location_service
node_review_service -->|"locks and creates places"| node_location_data
node_review_service -->|"stores and moderates"| node_review_data
node_account_data -.->|"persists records"| node_postgres
node_location_data -.->|"persists records"| node_postgres
node_review_data -.->|"persists records"| node_postgres

click node_mobile_app "https://github.com/cgsindac/triptogo/tree/main/TTGMobile/src/app"
click node_review_dialog "https://github.com/cgsindac/triptogo/blob/main/TTGMobile/src/components/ReviewDialog.tsx"
click node_mobile_auth "https://github.com/cgsindac/triptogo/blob/main/TTGMobile/src/data/auth.ts"
click node_mobile_reviews "https://github.com/cgsindac/triptogo/blob/main/TTGMobile/src/data/reviews.ts"
click node_mobile_places "https://github.com/cgsindac/triptogo/blob/main/TTGMobile/src/data/places.ts"
click node_mobile_api "https://github.com/cgsindac/triptogo/blob/main/TTGMobile/src/data/api.ts"
click node_auth_controller "https://github.com/cgsindac/triptogo/blob/main/TTGBackend/src/main/java/com/TripToGo/TTGBackend/Controllers/AuthController.java"
click node_user_controller "https://github.com/cgsindac/triptogo/blob/main/TTGBackend/src/main/java/com/TripToGo/TTGBackend/Controllers/Usercontroller.java"
click node_location_controller "https://github.com/cgsindac/triptogo/blob/main/TTGBackend/src/main/java/com/TripToGo/TTGBackend/Controllers/LocationController.java"
click node_review_controller "https://github.com/cgsindac/triptogo/blob/main/TTGBackend/src/main/java/com/TripToGo/TTGBackend/Controllers/ReviewController.java"
click node_auth_service "https://github.com/cgsindac/triptogo/blob/main/TTGBackend/src/main/java/com/TripToGo/TTGBackend/Services/AuthService.java"
click node_user_service "https://github.com/cgsindac/triptogo/blob/main/TTGBackend/src/main/java/com/TripToGo/TTGBackend/Services/UserService.java"
click node_location_service "https://github.com/cgsindac/triptogo/blob/main/TTGBackend/src/main/java/com/TripToGo/TTGBackend/Services/LocationService.java"
click node_review_service "https://github.com/cgsindac/triptogo/blob/main/TTGBackend/src/main/java/com/TripToGo/TTGBackend/Services/ReviewService.java"
click node_validation "https://github.com/cgsindac/triptogo/blob/main/TTGBackend/src/main/java/com/TripToGo/TTGBackend/Components/InputValidation.java"
click node_account_data "https://github.com/cgsindac/triptogo/blob/main/TTGBackend/src/main/java/com/TripToGo/TTGBackend/Repositories/UserRepository.java"
click node_location_data "https://github.com/cgsindac/triptogo/blob/main/TTGBackend/src/main/java/com/TripToGo/TTGBackend/Repositories/LocationRepository.java"
click node_review_data "https://github.com/cgsindac/triptogo/blob/main/TTGBackend/src/main/java/com/TripToGo/TTGBackend/Repositories/ReviewRepo/ReviewRepository.java"
click node_review_contracts "https://github.com/cgsindac/triptogo/blob/main/TTGBackend/src/main/java/com/TripToGo/TTGBackend/DTOs/ReviewDTOs/ReviewRequestDTO.java"
click node_recommendations "https://github.com/cgsindac/triptogo/tree/main/TTGBackend/src/main/java/com/TripToGo/TTGBackend/Services"

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_app,node_review_dialog,node_mobile_auth,node_mobile_reviews,node_mobile_places,node_mobile_api toneBlue
class node_auth_controller,node_user_controller,node_location_controller,node_review_controller,node_auth_service,node_user_service,node_location_service,node_review_service,node_validation,node_recommendations toneAmber
class node_account_data,node_location_data,node_review_data,node_review_contracts toneMint
class node_postgres toneRose
class node_traveler toneIndigo
```

## Components

### Mobile app

- [Mobile screens](https://github.com/cgsindac/triptogo/tree/main/TTGMobile/src/app): `TTGMobile/src/app`
- [Review dialog](https://github.com/cgsindac/triptogo/blob/main/TTGMobile/src/components/ReviewDialog.tsx): `TTGMobile/src/components/ReviewDialog.tsx`
- [Auth client](https://github.com/cgsindac/triptogo/blob/main/TTGMobile/src/data/auth.ts): `TTGMobile/src/data/auth.ts`
- [Review client](https://github.com/cgsindac/triptogo/blob/main/TTGMobile/src/data/reviews.ts): `TTGMobile/src/data/reviews.ts`
- [Place client](https://github.com/cgsindac/triptogo/blob/main/TTGMobile/src/data/places.ts): `TTGMobile/src/data/places.ts`
- [API transport](https://github.com/cgsindac/triptogo/blob/main/TTGMobile/src/data/api.ts): `TTGMobile/src/data/api.ts`

### Backend API

- [Authentication API](https://github.com/cgsindac/triptogo/blob/main/TTGBackend/src/main/java/com/TripToGo/TTGBackend/Controllers/AuthController.java): `TTGBackend/src/main/java/com/TripToGo/TTGBackend/Controllers/AuthController.java`
- [User API](https://github.com/cgsindac/triptogo/blob/main/TTGBackend/src/main/java/com/TripToGo/TTGBackend/Controllers/Usercontroller.java): `TTGBackend/src/main/java/com/TripToGo/TTGBackend/Controllers/Usercontroller.java`
- [Place API](https://github.com/cgsindac/triptogo/blob/main/TTGBackend/src/main/java/com/TripToGo/TTGBackend/Controllers/LocationController.java): `TTGBackend/src/main/java/com/TripToGo/TTGBackend/Controllers/LocationController.java`
- [Review API](https://github.com/cgsindac/triptogo/blob/main/TTGBackend/src/main/java/com/TripToGo/TTGBackend/Controllers/ReviewController.java): `TTGBackend/src/main/java/com/TripToGo/TTGBackend/Controllers/ReviewController.java`
- [Sessions and accounts](https://github.com/cgsindac/triptogo/blob/main/TTGBackend/src/main/java/com/TripToGo/TTGBackend/Services/AuthService.java): `TTGBackend/src/main/java/com/TripToGo/TTGBackend/Services/AuthService.java`
- [User management](https://github.com/cgsindac/triptogo/blob/main/TTGBackend/src/main/java/com/TripToGo/TTGBackend/Services/UserService.java): `TTGBackend/src/main/java/com/TripToGo/TTGBackend/Services/UserService.java`
- [Place catalog](https://github.com/cgsindac/triptogo/blob/main/TTGBackend/src/main/java/com/TripToGo/TTGBackend/Services/LocationService.java): `TTGBackend/src/main/java/com/TripToGo/TTGBackend/Services/LocationService.java`
- [Reviews and moderation](https://github.com/cgsindac/triptogo/blob/main/TTGBackend/src/main/java/com/TripToGo/TTGBackend/Services/ReviewService.java): `TTGBackend/src/main/java/com/TripToGo/TTGBackend/Services/ReviewService.java`
- [Input validation](https://github.com/cgsindac/triptogo/blob/main/TTGBackend/src/main/java/com/TripToGo/TTGBackend/Components/InputValidation.java): `TTGBackend/src/main/java/com/TripToGo/TTGBackend/Components/InputValidation.java`
- [Budget recommendations](https://github.com/cgsindac/triptogo/tree/main/TTGBackend/src/main/java/com/TripToGo/TTGBackend/Services): `TTGBackend/src/main/java/com/TripToGo/TTGBackend/Services`

### Tourism domain and persistence

- [Account records](https://github.com/cgsindac/triptogo/blob/main/TTGBackend/src/main/java/com/TripToGo/TTGBackend/Repositories/UserRepository.java): `TTGBackend/src/main/java/com/TripToGo/TTGBackend/Repositories/UserRepository.java`
- [Place records](https://github.com/cgsindac/triptogo/blob/main/TTGBackend/src/main/java/com/TripToGo/TTGBackend/Repositories/LocationRepository.java): `TTGBackend/src/main/java/com/TripToGo/TTGBackend/Repositories/LocationRepository.java`
- [Review records](https://github.com/cgsindac/triptogo/blob/main/TTGBackend/src/main/java/com/TripToGo/TTGBackend/Repositories/ReviewRepo/ReviewRepository.java): `TTGBackend/src/main/java/com/TripToGo/TTGBackend/Repositories/ReviewRepo/ReviewRepository.java`
- [Review request options](https://github.com/cgsindac/triptogo/blob/main/TTGBackend/src/main/java/com/TripToGo/TTGBackend/DTOs/ReviewDTOs/ReviewRequestDTO.java): `TTGBackend/src/main/java/com/TripToGo/TTGBackend/DTOs/ReviewDTOs/ReviewRequestDTO.java`

### External systems

- **PostgreSQL**

### Other components

- **Traveler or admin**

## Connections

- Traveler or admin → Mobile screens: uses (evidence: `README.md`)
- Mobile screens → Auth client: signs in (evidence: `TTGMobile/src/app/signup.js`)
- Auth client → API transport: requests (evidence: `TTGMobile/src/data/auth.ts`)
- Mobile screens → Place client: browses places (evidence: `README.md`)
- Mobile screens → Review client: reads reviews (evidence: `TTGMobile/src/app/(tabs)/reviews.tsx`)
- Mobile screens → Review dialog: opens submission (evidence: `TTGMobile/src/app/(tabs)/places/[id].tsx`)
- Review dialog → Review client: submits review (evidence: `TTGMobile/src/components/ReviewDialog.tsx`)
- Review client → API transport: sends requests (evidence: `TTGMobile/src/data/reviews.ts`)
- Place client → API transport: sends requests (evidence: `TTGMobile/src/data/places.ts`)
- API transport → Authentication API: calls auth API
- API transport → Place API: calls place API
- API transport → Review API: calls review API
- Traveler or admin → Authentication API: registers or logs in (evidence: `README.md`)
- Traveler or admin → Place API: browses catalog (evidence: `README.md`)
- Traveler or admin → Budget recommendations: requests suggestions (evidence: `README.md`)
- Traveler or admin → Place API: uses city map (evidence: `README.md`)
- Authentication API → Sessions and accounts: delegates
- User API → Sessions and accounts: uses sessions (evidence: `TTGBackend/src/main/java/com/TripToGo/TTGBackend/Controllers/Usercontroller.java`)
- User API → User management: delegates (evidence: `TTGBackend/src/main/java/com/TripToGo/TTGBackend/Controllers/Usercontroller.java`)
- Place API → Place catalog: delegates (evidence: `TTGBackend/src/main/java/com/TripToGo/TTGBackend/Controllers/LocationController.java`)
- Place API → Reviews and moderation: loads review options (evidence: `TTGBackend/src/main/java/com/TripToGo/TTGBackend/Controllers/LocationController.java`)
- Review API → Reviews and moderation: delegates (evidence: `TTGBackend/src/main/java/com/TripToGo/TTGBackend/Controllers/ReviewController.java`)
- Review API → Sessions and accounts: checks identity (evidence: `TTGBackend/src/main/java/com/TripToGo/TTGBackend/Controllers/ReviewController.java`)
- Sessions and accounts → User management: authenticates users (evidence: `TTGBackend/src/main/java/com/TripToGo/TTGBackend/Services/AuthService.java`)
- Sessions and accounts → Account records: checks admins (evidence: `TTGBackend/src/main/java/com/TripToGo/TTGBackend/Services/AuthService.java`)
- User management → Account records: reads and writes (evidence: `TTGBackend/src/main/java/com/TripToGo/TTGBackend/Services/UserService.java`)
- Place catalog → Input validation: validates input (evidence: `TTGBackend/src/main/java/com/TripToGo/TTGBackend/Services/LocationService.java`)
- Place catalog → Place records: searches catalog (evidence: `TTGBackend/src/main/java/com/TripToGo/TTGBackend/Services/LocationService.java`)
- Place catalog → Review records: aggregates ratings (evidence: `TTGBackend/src/main/java/com/TripToGo/TTGBackend/Services/LocationService.java`)
- Review API → Review request options: accepts review data (evidence: `TTGBackend/src/main/java/com/TripToGo/TTGBackend/Controllers/ReviewController.java`)
- Reviews and moderation → Input validation: validates input (evidence: `TTGBackend/src/main/java/com/TripToGo/TTGBackend/Services/ReviewService.java`)
- Reviews and moderation → Place catalog: resolves proposals (evidence: `TTGBackend/src/main/java/com/TripToGo/TTGBackend/Services/ReviewService.java`)
- Reviews and moderation → Place records: locks and creates places (evidence: `TTGBackend/src/main/java/com/TripToGo/TTGBackend/Services/ReviewService.java`)
- Reviews and moderation → Review records: stores and moderates (evidence: `TTGBackend/src/main/java/com/TripToGo/TTGBackend/Services/ReviewService.java`)
- Account records → PostgreSQL: persists records
- Place records → PostgreSQL: persists records
- Review records → PostgreSQL: persists records
