# dacoder91/dam_m13_grupo22 architecture

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

- Interactive diagram: https://gitdiagram.com/dacoder91/dam_m13_grupo22
- Repository: https://github.com/dacoder91/dam_m13_grupo22

## Overview

##### Project type and purpose
- DogGo is a full-stack mobile application for Android devices.
- Purpose: allow dog owners to manage profiles, discover and review dog parks, find related services (veterinarians, groomers), social-network functionality for meetups, and lost-pet notifications.

##### File structure
- Although only top-level files (.gitattributes, LICENSE, README.md) are shown, the README states the use of:
- Kotlin for application code
- Jetpack Compose for UI
- Firebase for backend services

##### README for additional insights
- Key Firebase services implied: Authentication, Firestore (or Realtime Database), Cloud Storage (for images), Cloud Functions (server-side logic), Cloud Messaging (notifications).
- External services: Google Maps / Geolocation API for park discovery.

a. Main components:
- Android Client
– UI Layer (Jetpack Compose)
– Domain Layer (business logic)
– Data Layer (repositories, network & local)
- Firebase Backend
– Auth Service
– Firestore Database
– Cloud Storage
– Cloud Functions
– Cloud Messaging
- External Geo/Maps API
b. Relationships and interactions:
- Client UI → Domain → Data Layer → Firebase services
- Client requests Maps API for park locations
- Firebase Cloud Functions trigger on database writes (e.g., lost-pet posting)
- Cloud Messaging pushes notifications to client
c. Architectural patterns / design principles:
- MVVM (Model-View-ViewModel) or Clean Architecture to separate UI, domain, and data concerns
- Repository pattern abstracts data sources (Firebase vs local cache)
- Event-driven functions for server-side tasks
d. Relevant technologies:
- Jetpack Compose (UI)
- Kotlin Coroutines / Flow (async data streams)
- Firebase Auth, Firestore, Storage, Functions, Messaging
- Google Maps SDK for Android

##### Elements
- Another for Firebase backend
- A third for external services (Maps API)
- Rectangles for services
- Clouds for external systems

##### Detailed breakdown of components
- Android Client (left side)
- Jetpack Compose UI
- ViewModel layer (handles user actions & state)
- Repository layer (defines interfaces for data operations)
- Local cache (optional, e.g., Room)
- Firebase Backend (center)
- Authentication Service (user sign-in/sign-up)
- Firestore (profiles, parks, reviews, posts)
- Cloud Storage (images)
- Cloud Functions (on-write triggers for notifications, lost posts)
- Cloud Messaging (push notifications)
- External Services (right side)
- Google Maps / Geolocation API (park locations & geocoding)

Guidance for drawing:
1. Three vertical lanes: Client | Firebase | External API
2. Components in their lanes, grouping by layer (UI, domain, data)
- UI → ViewModel → Repository → Firestore
- Repository → Maps API
- Firestore → Cloud Function → Cloud Messaging → Client

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Subgraphs for layers
    subgraph "Android Client"
        direction TB
        UI["Jetpack Compose UI"]:::client
        VM["ViewModel (Kotlin, Coroutines/Flow)"]:::client
        Repo["Repository Layer"]:::client
        Cache["Local Cache (Room)"]:::client
    end

    subgraph "Firebase Backend"
        direction TB
        Auth["Authentication Service"]:::backend
        Firestore["Firestore Database"]:::backend
        Storage["Cloud Storage"]:::backend
        Functions["Cloud Functions"]:::backend
        Messaging["Cloud Messaging"]:::backend
        Docs["Project Documentation"]:::docs
    end

    subgraph "External Services"
        direction TB
        Maps["Google Maps / Geolocation API"]:::external
    end

    %% Connections within client
    UI -->|"user actions"| VM
    VM -->|"data operations"| Repo
    Repo -->|"cache read/write"| Cache

    %% Client to Firebase
    Repo -->|"AUTH requests"| Auth
    Repo -->|"READ/WRITE data"| Firestore
    Repo -->|"UPLOAD/GET images"| Storage

    %% Client to External
    Repo -->|"GET parks (location data)"| Maps
    Maps -->|"location response"| Repo

    %% Firebase internal flows
    Firestore -->|"onWrite trigger"| Functions
    Functions -->|"invoke push"| Messaging
    Messaging -->|"push notification"| VM

    %% Documentation click event
    click Docs "https://github.com/dacoder91/dam_m13_grupo22/blob/main/README.md"

    %% Styles
    classDef client fill:#E8F5E9,stroke:#2E7D32,stroke-width:2px
    classDef backend fill:#E3F2FD,stroke:#1565C0,stroke-width:2px
    classDef external fill:#FFF3E0,stroke:#EF6C00,stroke-width:2px
    classDef docs fill:#F3E5F5,stroke:#6A1B9A,stroke-width:2px
```
