# bit-lords-csulb/travel-cents architecture

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

- Interactive diagram: https://gitdiagram.com/bit-lords-csulb/travel-cents
- Repository: https://github.com/bit-lords-csulb/travel-cents

## Overview

##### Project type & purpose (from file tree + minimal README)
This is a **native Android application** (single `app` module) written in **Kotlin**, structured around **Jetpack Compose UI** and likely **MVVM** (presence of `AuthViewModel.kt`). The presence of `app/google-services.json` strongly indicates **Firebase integration** (most commonly Firebase Auth + Firestore/Realtime DB + Cloud Storage, etc.). There is **no server-side code** in the repository, so the “system” is primarily a **mobile client** + **external backend-as-a-service**.

##### Top-level / build & deployment boundary
- `build.gradle.kts`, `settings.gradle.kts`, `gradle/libs.versions.toml`: Gradle build + dependency management (version catalog).
- `app/build.gradle.kts`: Android module build config (where Compose, Firebase plugins, minSdk/targetSdk, etc. will be configured).
- `app/google-services.json`: Firebase project binding (client talks to Firebase services).

##### Runtime code structure (what runs on device)
- `MainActivity.kt`: app entry point / host for Compose content.
- `ui/TravelCentsNavigation.kt`: centralized navigation graph/router (Compose Navigation).
- `ui/auth/*`: auth-related screens + `AuthViewModel.kt`
- `ui/main/*`: main feature screens (Home, Current, Chats, NewTrip, Settings, plus `MainScaffold`)
- `data/AuthModel.kt`: data/model layer (currently only auth model is obvious)
- `ui/theme/*`: Compose theme system

- a **presentation layer** (Compose screens)
- **navigation layer**
- at least one **ViewModel**
- a thin **data/model layer** (but not much repository/service separation is visible in the tree)

##### Test structure
- `app/src/test` (unit tests)
- `app/src/androidTest` (instrumented UI/device tests)

##### Firebase (external platform)
- “Firebase Auth (likely)”
- “Firebase DB (Firestore/Realtime) (unknown from tree)”
- “Firebase Storage/FCM (unknown from tree)”
and mark those as “TBD/confirm in dependencies”.

##### Components inside the Android App (mid-level)

- **Entry / Host**
- `MainActivity` (hosts Compose, sets theme, attaches Nav)
- **Navigation**
- `TravelCentsNavigation` (routes between auth + main flows)
- **Presentation (Compose UI)**
- Auth screens: `LoginPage`, `SignUpPage`, `ForgotPassword`
- Main screens: `HomePage`, `CurrentPage`, `ChatsPage`, `NewTripPage`, `SettingsPage`
- Layout shell: `MainScaffold`
- **State / ViewModels**
- `AuthViewModel` (auth state, actions)
- **Data / Models**
- `AuthModel`
- **Theming**

##### Important architectural patterns to highlight (based on structure)
- **MVVM-ish**: Compose UI (View) + `AuthViewModel` (ViewModel) + `AuthModel` (Model).
- **Single-Activity architecture**: `MainActivity` hosts all Compose content; navigation swaps composables.
- **Feature grouping by package**: `ui/auth`, `ui/main` (feature slices), plus shared `ui/theme`.

- Android App
- Firebase
- Optional: “Android OS / Device” boundary
- MainActivity
- Navigation
- Screens (auth + main)
- ViewModels
- Data models

##### Step 2 — Use boundaries that match reality
- Outer boundary: “User’s Android Device”
- Inner: “TravelCents Android App (Kotlin, Jetpack Compose)”

- “Jetpack Compose” on the UI boundary
- “Compose Navigation” on navigation
- “AndroidX Lifecycle ViewModel” on `AuthViewModel`

##### Step 5 — Include “unknowns” explicitly rather than guessing
Because the README is empty and we can’t see Gradle contents here:
- Inside it, list services as:
- “Firebase Auth (confirmed by presence of auth UI/viewmodel naming; still verify in build.gradle)”
- “Firestore/Realtime DB (TBD)”
- “Cloud Storage / FCM (TBD)”

(This repo has the Gradle structure to justify it.)

## Diagram (Mermaid)

```mermaid
flowchart TD

%% =========================
%% Diagram A — Runtime / Container View
%% =========================
subgraph RUNTIME["Runtime (C4: Container)"]
direction TB

U["User"]:::external

subgraph DEVICE["User's Android Device"]
direction TB
APP["TravelCents Android App\n(Kotlin • Jetpack Compose • Single-Activity)"]:::container
end

subgraph FIREBASE["Firebase (Google Cloud)\n(configured by google-services.json)"]
direction TB
FBA["Firebase Auth\n(confirmed-by-naming; verify dependencies)"]:::external
FBDB["Firestore / Realtime DB\n(TBD)"]:::external
FBST["Cloud Storage / FCM\n(TBD)"]:::external
end

U -->|"interacts(UI)"| APP
APP -->|"authRequests/dataSync(viaFirebaseAndroidSDK)"| FBA
APP -->|"dataRead/write(TBD)"| FBDB
APP -->|"media/push(TBD)"| FBST

FBA -.->|"authState/sessionChanges(async)"| APP
FBDB -.->|"dataResponses/streams(async)"| APP
FBST -.->|"upload/download/status(async)"| APP
end

%% =========================
%% Diagram B — Android App Component View
%% =========================
subgraph COMPONENTS["Android App (C4: Component) — On-device runtime"]
direction TB

subgraph BUILD_HINT["Build & Configuration (non-runtime artifacts)"]
direction TB
GRADLE_TOP["Gradle Build System\n(build.gradle.kts • settings.gradle.kts • libs.versions.toml)"]:::build
GRADLE_APP["Android Module Build\n(app/build.gradle.kts)"]:::build
MANIFEST["AndroidManifest.xml\n(entry + permissions + components)"]:::build
GSERV["google-services.json\n(Firebase client binding)"]:::build
GRADLE_TOP -->|"configures"| GRADLE_APP
GRADLE_APP -->|"packages/merges"| MANIFEST
GRADLE_APP -->|"appliesGoogleServices"| GSERV
end

subgraph APP_INTERNAL["TravelCents App Code (Kotlin)"]
direction TB

subgraph ENTRY_NAV["Entry & Navigation"]
direction TB
MA["MainActivity\n(Single Activity host)"]:::entry
NAV["TravelCentsNavigation\n(Compose Navigation graph/router)"]:::nav
MA -->|"setContent(theme+navHost)"| NAV
end

subgraph THEME["Compose Theming (cross-cutting)"]
direction TB
TH["Theme.kt"]:::theme
CL["Color.kt"]:::theme
TP["Type.kt"]:::theme
end

subgraph UI_LAYER["Presentation Layer (Jetpack Compose UI)"]
direction TB

subgraph AUTH_UI["Auth Feature — Screens"]
direction TB
LP["LoginPage"]:::ui
SU["SignUpPage"]:::ui
FP["ForgotPassword"]:::ui
end

subgraph MAIN_UI["Main Feature — Shell + Screens"]
direction TB
MS["MainScaffold\n(app shell/layout)"]:::ui
HP["HomePage"]:::ui
CP["CurrentPage"]:::ui
CH["ChatsPage"]:::ui
NT["NewTripPage"]:::ui
SP["SettingsPage"]:::ui
MS -->|"hosts"| HP
MS -->|"hosts"| CP
MS -->|"hosts"| CH
MS -->|"hosts"| NT
MS -->|"hosts"| SP
end

end

subgraph STATE_DATA["State & Data"]
direction TB
AVM["AuthViewModel\n(AndroidX Lifecycle ViewModel)"]:::viewmodel
AM["AuthModel\n(data/model)"]:::model
AVM -->|"reads/writes"| AM
end

subgraph INTEGRATION["External Integration Boundary"]
direction TB
FSDK["Firebase Android SDK\n(client libraries)"]:::sdk
end

%% Navigation routes
NAV -->|"route:auth/login"| LP
NAV -->|"route:auth/signup"| SU
NAV -->|"route:auth/forgot"| FP
NAV -->|"route:main"| MS

%% UI -> ViewModel (events)
LP -->|"signIn(email,password)"| AVM
SU -->|"createUser(email,password)"| AVM
FP -->|"sendPasswordResetEmail(email)"| AVM

%% ViewModel -> SDK -> Firebase
AVM -->|"calls"| FSDK
FSDK -->|"HTTPS+SDKcalls"| FBA
FSDK -->|"TBD"| FBDB
FSDK -->|"TBD"| FBST

%% Async state updates back to UI
FBA -.->|"authStateChanged(async)"| AVM
AVM -.->|"stateFlow/liveData->recompose"| LP
AVM -.->|"stateFlow/liveData->recompose"| SU
AVM -.->|"stateFlow/liveData->recompose"| FP

%% Theme applies across UI (visual dependency)
TH -.->|"appliesTo"| MA
CL -.->|"appliesTo"| UI_LAYER
TP -.->|"appliesTo"| UI_LAYER

end

subgraph TESTS["Test Harness (non-production)"]
direction TB
UT["Unit Tests\n(app/src/test)"]:::test
IT["Instrumented/UI Tests\n(app/src/androidTest)"]:::test
UT -.->|"tests(viewmodels/models)"| AVM
UT -.->|"tests(models)"| AM
IT -.->|"uiNavigationAndScreens"| NAV
IT -.->|"uiComposeTests"| UI_LAYER
end

end

%% =========================
%% Click Events (mapped components)
%% =========================
click MA "https://github.com/bit-lords-csulb/travel-cents/blob/main/app/src/main/java/com/example/travelcents/MainActivity.kt"
click NAV "https://github.com/bit-lords-csulb/travel-cents/blob/main/app/src/main/java/com/example/travelcents/ui/TravelCentsNavigation.kt"
click AVM "https://github.com/bit-lords-csulb/travel-cents/blob/main/app/src/main/java/com/example/travelcents/ui/auth/AuthViewModel.kt"
click AM "https://github.com/bit-lords-csulb/travel-cents/blob/main/app/src/main/java/com/example/travelcents/data/AuthModel.kt"
click LP "https://github.com/bit-lords-csulb/travel-cents/blob/main/app/src/main/java/com/example/travelcents/ui/auth/LoginPage.kt"
click SU "https://github.com/bit-lords-csulb/travel-cents/blob/main/app/src/main/java/com/example/travelcents/ui/auth/SignUpPage.kt"
click FP "https://github.com/bit-lords-csulb/travel-cents/blob/main/app/src/main/java/com/example/travelcents/ui/auth/ForgotPassword.kt"
click MS "https://github.com/bit-lords-csulb/travel-cents/blob/main/app/src/main/java/com/example/travelcents/ui/main/MainScaffold.kt"
click HP "https://github.com/bit-lords-csulb/travel-cents/blob/main/app/src/main/java/com/example/travelcents/ui/main/HomePage.kt"
click CP "https://github.com/bit-lords-csulb/travel-cents/blob/main/app/src/main/java/com/example/travelcents/ui/main/CurrentPage.kt"
click CH "https://github.com/bit-lords-csulb/travel-cents/blob/main/app/src/main/java/com/example/travelcents/ui/main/ChatsPage.kt"
click NT "https://github.com/bit-lords-csulb/travel-cents/blob/main/app/src/main/java/com/example/travelcents/ui/main/NewTripPage.kt"
click SP "https://github.com/bit-lords-csulb/travel-cents/blob/main/app/src/main/java/com/example/travelcents/ui/main/SettingsPage.kt"
click TH "https://github.com/bit-lords-csulb/travel-cents/blob/main/app/src/main/java/com/example/travelcents/ui/theme/Theme.kt"
click CL "https://github.com/bit-lords-csulb/travel-cents/blob/main/app/src/main/java/com/example/travelcents/ui/theme/Color.kt"
click TP "https://github.com/bit-lords-csulb/travel-cents/blob/main/app/src/main/java/com/example/travelcents/ui/theme/Type.kt"
click GSERV "https://github.com/bit-lords-csulb/travel-cents/blob/main/app/google-services.json"
click GRADLE_APP "https://github.com/bit-lords-csulb/travel-cents/blob/main/app/build.gradle.kts"
click GRADLE_TOP "https://github.com/bit-lords-csulb/travel-cents/blob/main/build.gradle.kts"
click MANIFEST "https://github.com/bit-lords-csulb/travel-cents/blob/main/app/src/main/AndroidManifest.xml"
click UT "https://github.com/bit-lords-csulb/travel-cents/blob/main/app/src/test/java/com/example/travelcents/ExampleUnitTest.kt"
click IT "https://github.com/bit-lords-csulb/travel-cents/blob/main/app/src/androidTest/java/com/example/travelcents/ExampleInstrumentedTest.kt"

%% Note: settings + version catalog are represented in GRADLE_TOP label; add direct clicks as separate invisible anchors
SETTINGS["settings.gradle.kts"]:::hidden
CATALOG["gradle/libs.versions.toml"]:::hidden
click SETTINGS "https://github.com/bit-lords-csulb/travel-cents/blob/main/settings.gradle.kts"
click CATALOG "https://github.com/bit-lords-csulb/travel-cents/blob/main/gradle/libs.versions.toml"

%% =========================
%% Styles
%% =========================
classDef container fill:#0B4F6C,stroke:#083344,color:#E6F6FF,stroke-width:2px;
classDef entry fill:#1D4ED8,stroke:#0B2F6B,color:#FFFFFF,stroke-width:2px;
classDef nav fill:#F59E0B,stroke:#92400E,color:#1F2937,stroke-width:2px;
classDef ui fill:#60A5FA,stroke:#1E3A8A,color:#0B1220,stroke-width:1.5px;
classDef viewmodel fill:#A855F7,stroke:#5B21B6,color:#FFFFFF,stroke-width:1.5px;
classDef model fill:#22C55E,stroke:#166534,color:#052E16,stroke-width:1.5px;
classDef sdk fill:#38BDF8,stroke:#075985,color:#042F2E,stroke-width:1.5px,stroke-dasharray: 4 3;
classDef theme fill:#93C5FD,stroke:#1E40AF,color:#0B1220,stroke-width:1.25px;
classDef external fill:#9CA3AF,stroke:#374151,color:#111827,stroke-width:1.5px;
classDef build fill:#F97316,stroke:#7C2D12,color:#111827,stroke-width:1.5px;
classDef test fill:#FDE68A,stroke:#92400E,color:#111827,stroke-width:1.5px;
classDef hidden fill:#FFFFFF,stroke:#FFFFFF,color:#FFFFFF;
```
