# tab-jesus/appuniversidad architecture

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

- Interactive diagram: https://gitdiagram.com/tab-jesus/appuniversidad
- Repository: https://github.com/tab-jesus/appuniversidad

## Overview

1. **Project shape**
   - This is a single-module Android app (`app/`) built with Kotlin and Gradle Kotlin DSL.
   - The repo is organized as a classic native Android app: app code, XML resources, manifest, Firebase config, and unit/instrumentation tests.

2. **Core purpose**
   - The app is for managing university data and associated campuses/sedes.
   - The architecture centers on two data domains: `Universidad` and `Sede`, with Firebase as the persistence backend.

3. **Domain model layer**
   - `models/Universidad.kt` and `models/Sede.kt` define the app’s primary data objects.
   - These models form the contract between UI forms and the Firebase data store, so they are the main schema boundary in the app.

4. **Data access layer**
   - `data/FirebaseRepository.kt` is the main backend integration point.
   - Its role is to isolate Firebase operations from the UI, acting as the repository boundary for create/read/update/delete-style workflows and any realtime sync logic.

5. **UI layer**
   - `ui/UniversidadesActivity.kt` is the only concrete screen implementation visible in the tree.
   - The app appears to use Activity-based navigation rather than a fragment-heavy or Compose architecture.
   - Layout files suggest separate screens for login, main entry, and university management.

6. **Screen and resource mapping**
   - `activity_login.xml`, `activity_main.xml`, and `activity_universidades.xml` define the visible app surfaces.
   - This implies a flow where users authenticate, land in a main/home screen, and then manage university records from the dedicated universities screen.

7. **Firebase integration boundary**
   - `google-services.json` is committed in the app module, which indicates Firebase is a required runtime dependency rather than an optional integration.
   - The README states Firebase Authentication and Realtime Database are used, so the backend boundary is cloud auth plus realtime persistence, not a custom API server.

8. **Configuration and app runtime**
   - `AndroidManifest.xml` is the central place for app entrypoints, permissions, and component registration.
   - Because the README mentions GPS and sensors, the manifest likely carries location-related permissions and possibly activity declarations that shape runtime access to device hardware.

9. **Geolocation and sensor behavior**
   - The README describes GPS capture and accelerometer-based “shake to clear” behavior, but no dedicated `services/` package appears in the file tree.
   - Architecturally, that means sensor and location handling are either embedded in the activity layer or not yet present in this snapshot; for a diagram, treat them as expected device-side inputs feeding the sede-registration flow.

10. **Data flow**
    - User input enters via XML-backed Activities.
    - The UI transforms input into `Universidad` or `Sede` models.
    - Those models pass through `FirebaseRepository`, which writes/reads Firebase data.
    - Firebase then acts as the system of record and sync source for the app.

11. **Persistence and session**
    - The README mentions Firebase Auth plus local session persistence via `SharedPreferences`.
    - Even though no explicit preferences helper appears in the tree, this indicates a split between remote identity state and lightweight local session state.

12. **Testing and quality gates**
    - There is one instrumented test and one unit test scaffold under `src/androidTest` and `src/test`.
    - This suggests the repo has standard Android test structure, but no extensive test architecture is visible yet.

13. **Build and dependency boundary**
    - Gradle wrapper files and `libs.versions.toml` show a version-managed build setup.
    - `build.gradle.kts` at both root and app level define the dependency graph, including Android/Firebase tooling and whatever UI/runtime libraries the app uses.

14. **Important architectural note for diagrams**
    - The real visible boundary in this repo is small: UI Activities -> model objects -> Firebase repository -> Firebase backend, with device sensors/location acting as an input source for sede metadata.
    - The README describes a richer system than the visible code tree, so if you draw the architecture, distinguish between implemented components and described-but-not-present modules.

Main entry points: [`app/build.gradle.kts`](https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/app/build.gradle.kts) (App module), [`app/src/main/java/com/example/appuniversidades/ui/UniversidadesActivity.kt`](https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/app/src/main/java/com/example/appuniversidades/ui/UniversidadesActivity.kt) (UniversidadesActivity), [`app/src/main/java/com/example/appuniversidades/data/FirebaseRepository.kt`](https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/app/src/main/java/com/example/appuniversidades/data/FirebaseRepository.kt) (Firebase repo), [`app/src/main/AndroidManifest.xml`](https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/app/src/main/AndroidManifest.xml) (Manifest)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_g_app["Android app"]
  node_n_module["App module<br/>android-module<br/>[build.gradle.kts]"]
  node_n_manifest["Manifest"]
end

subgraph group_g_domain["Domain"]
  node_n_universidad["Universidad<br/>domain model<br/>[Universidad.kt]"]
  node_n_sede["Sede<br/>domain model<br/>[Sede.kt]"]
end

subgraph group_g_data["Data access"]
  node_n_repo["Firebase repo"]
end

subgraph group_g_ui["UI"]
  node_n_login_layout["Login screen<br/>layout<br/>[activity_login.xml]"]
  node_n_main_layout["Main screen<br/>layout<br/>[activity_main.xml]"]
  node_n_univ_layout["Universities screen<br/>layout"]
  node_n_univ_activity["UniversidadesActivity"]
end

subgraph group_g_runtime["Runtime inputs"]
  node_n_firebase_auth(("Firebase Auth<br/>external auth"))
  node_n_firebase_db[("Realtime DB<br/>external backend")]
  node_n_location(("GPS data<br/>device input"))
  node_n_sensors(("Shake input<br/>device input"))
  node_n_session(("Session state<br/>local prefs"))
end

subgraph group_g_build["Build"]
  node_n_google_services["Firebase config<br/>firebase-config"]
  node_n_build_root["Build setup<br/>gradle build<br/>[build.gradle.kts]"]
  node_n_versions["Version catalog<br/>dependency catalog<br/>[libs.versions.toml]"]
  node_n_settings["Settings"]
end

subgraph group_g_test["Tests"]
  node_n_tests_unit["Unit tests<br/>test scaffold<br/>[ExampleUnitTest.kt]"]
  node_n_tests_android["Instrumented tests<br/>test scaffold"]
end

node_n_build_root -->|"configures"| node_n_module
node_n_settings -->|"includes"| node_n_module
node_n_versions -->|"versions"| node_n_build_root
node_n_module -->|"packages"| node_n_manifest
node_n_module -->|"ships"| node_n_login_layout
node_n_module -->|"ships"| node_n_main_layout
node_n_module -->|"ships"| node_n_univ_layout
node_n_module -->|"contains"| node_n_univ_activity
node_n_univ_activity -->|"uses"| node_n_universidad
node_n_univ_activity -->|"uses"| node_n_sede
node_n_univ_activity -->|"calls"| node_n_repo
node_n_repo -->|"persists"| node_n_universidad
node_n_repo -->|"persists"| node_n_sede
node_n_repo -->|"authenticates"| node_n_firebase_auth
node_n_repo -->|"syncs"| node_n_firebase_db
node_n_google_services -->|"binds"| node_n_firebase_auth
node_n_google_services -->|"binds"| node_n_firebase_db
node_n_manifest -->|"permits"| node_n_location
node_n_manifest -->|"permits"| node_n_sensors
node_n_main_layout -->|"restores"| node_n_session
node_n_login_layout -->|"signs in"| node_n_firebase_auth
node_n_univ_activity -->|"captures"| node_n_location
node_n_univ_activity -->|"listens"| node_n_sensors
node_n_tests_unit -.->|"checks"| node_n_repo
node_n_tests_android -.->|"drives"| node_n_univ_activity

click node_n_module "https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/app/build.gradle.kts"
click node_n_manifest "https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/app/src/main/AndroidManifest.xml"
click node_n_login_layout "https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/app/src/main/res/layout/activity_login.xml"
click node_n_main_layout "https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/app/src/main/res/layout/activity_main.xml"
click node_n_univ_layout "https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/app/src/main/res/layout/activity_universidades.xml"
click node_n_univ_activity "https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/app/src/main/java/com/example/appuniversidades/ui/UniversidadesActivity.kt"
click node_n_universidad "https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/app/src/main/java/com/example/appuniversidades/models/Universidad.kt"
click node_n_sede "https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/app/src/main/java/com/example/appuniversidades/models/Sede.kt"
click node_n_repo "https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/app/src/main/java/com/example/appuniversidades/data/FirebaseRepository.kt"
click node_n_google_services "https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/app/google-services.json"
click node_n_tests_unit "https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/app/src/test/java/com/example/appuniversidades/ExampleUnitTest.kt"
click node_n_tests_android "https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/app/src/androidTest/java/com/example/appuniversidades/ExampleInstrumentedTest.kt"
click node_n_build_root "https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/build.gradle.kts"
click node_n_versions "https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/gradle/libs.versions.toml"
click node_n_settings "https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/settings.gradle.kts"

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_n_module,node_n_manifest,node_n_tests_unit,node_n_tests_android toneBlue
class node_n_universidad,node_n_sede toneAmber
class node_n_repo toneMint
class node_n_login_layout,node_n_main_layout,node_n_univ_layout,node_n_univ_activity toneRose
class node_n_firebase_auth,node_n_firebase_db,node_n_location,node_n_sensors,node_n_session toneIndigo
class node_n_google_services,node_n_build_root,node_n_versions,node_n_settings toneTeal
```

## Components

### Android app

Single-module Android application code and resources

- [App module](https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/app/build.gradle.kts): android-module · Single Android application module containing code, resources, and manifest · `app/build.gradle.kts`
- [Manifest](https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/app/src/main/AndroidManifest.xml): android-manifest · App entrypoints, permissions, and component registration · `app/src/main/AndroidManifest.xml`

### Domain

Primary data models for university and campus records

- [Universidad](https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/app/src/main/java/com/example/appuniversidades/models/Universidad.kt): domain model · Primary university record schema · `app/src/main/java/com/example/appuniversidades/models/Universidad.kt`
- [Sede](https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/app/src/main/java/com/example/appuniversidades/models/Sede.kt): domain model · Primary campus or branch record schema · `app/src/main/java/com/example/appuniversidades/models/Sede.kt`

### Data access

Firebase-backed repository boundary

- [Firebase repo](https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/app/src/main/java/com/example/appuniversidades/data/FirebaseRepository.kt): repository · Backend integration boundary for CRUD and sync operations · `app/src/main/java/com/example/appuniversidades/data/FirebaseRepository.kt`

### UI

Activity-based screens and their XML layouts

- [Login screen](https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/app/src/main/res/layout/activity_login.xml): layout · Login surface defined in XML · `app/src/main/res/layout/activity_login.xml`
- [Main screen](https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/app/src/main/res/layout/activity_main.xml): layout · Primary landing surface defined in XML · `app/src/main/res/layout/activity_main.xml`
- [Universities screen](https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/app/src/main/res/layout/activity_universidades.xml): layout · University management surface defined in XML · `app/src/main/res/layout/activity_universidades.xml`
- [UniversidadesActivity](https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/app/src/main/java/com/example/appuniversidades/ui/UniversidadesActivity.kt): activity · Concrete screen implementation for university management · `app/src/main/java/com/example/appuniversidades/ui/UniversidadesActivity.kt`

### Runtime inputs

External services and device capabilities used by the app

- **Firebase Auth**: external auth · Cloud authentication backend used by the app
- **Realtime DB**: external backend · Cloud data store and sync source
- **GPS data**: device input · Location input used when capturing campus metadata
- **Shake input**: device input · Accelerometer-driven clear/reset behavior described in the README
- **Session state**: local prefs · Lightweight local session persistence via SharedPreferences

### Build

Gradle and Firebase build/runtime wiring

- [Firebase config](https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/app/google-services.json): firebase-config · Firebase project wiring required at runtime · `app/google-services.json`
- [Build setup](https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/build.gradle.kts): gradle build · Root Gradle configuration and dependency wiring · `build.gradle.kts`
- [Version catalog](https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/gradle/libs.versions.toml): dependency catalog · Centralized library and plugin versions · `gradle/libs.versions.toml`
- [Settings](https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/settings.gradle.kts): gradle settings · Project/module inclusion and build settings · `settings.gradle.kts`

### Tests

Standard Android unit and instrumented test scaffolds

- [Unit tests](https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/app/src/test/java/com/example/appuniversidades/ExampleUnitTest.kt): test scaffold · Standard JVM test scaffold · `app/src/test/java/com/example/appuniversidades/ExampleUnitTest.kt`
- [Instrumented tests](https://github.com/tab-jesus/appuniversidad/blob/defaul-branch/app/src/androidTest/java/com/example/appuniversidades/ExampleInstrumentedTest.kt): test scaffold · Standard Android instrumentation test scaffold · `app/src/androidTest/java/com/example/appuniversidades/ExampleInstrumentedTest.kt`

## Connections

- Build setup → App module: configures · Root build drives the Android module build
- Settings → App module: includes · Project settings include the app module
- Version catalog → Build setup: versions · Shared dependency and plugin version source
- App module → Manifest: packages · Module contains the app manifest
- App module → Login screen: ships · Module ships the login screen layout
- App module → Main screen: ships · Module ships the main screen layout
- App module → Universities screen: ships · Module ships the university management layout
- App module → UniversidadesActivity: contains · Activity implementation lives in the app module
- UniversidadesActivity → Universidad: uses · Screen maps form data into university records
- UniversidadesActivity → Sede: uses · Screen maps form data into campus records
- UniversidadesActivity → Firebase repo: calls · UI delegates persistence to the repository boundary
- Firebase repo → Universidad: persists · Repository reads and writes university entities
- Firebase repo → Sede: persists · Repository reads and writes campus entities
- Firebase repo → Firebase Auth: authenticates · Repository participates in Firebase authentication flows
- Firebase repo → Realtime DB: syncs · Repository stores and retrieves data from Realtime Database
- Firebase config → Firebase Auth: binds · Firebase project configuration binds auth services
- Firebase config → Realtime DB: binds · Firebase project configuration binds database services
- Manifest → GPS data: permits · Manifest shapes access to location capabilities
- Manifest → Shake input: permits · Manifest and runtime shape sensor access
- Main screen → Session state: restores · Main flow reflects persisted local session state
- Login screen → Firebase Auth: signs in · Login surface feeds authentication
- UniversidadesActivity → GPS data: captures · Campus data flow may include GPS-derived metadata
- UniversidadesActivity → Shake input: listens · Activity may react to shake gestures for clearing state
- Unit tests → Firebase repo: checks · Unit test scaffold can validate core logic boundaries
- Instrumented tests → UniversidadesActivity: drives · Instrumentation scaffold targets activity-level behavior
