# alewwh1104/proyecto_ppm architecture

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

- Interactive diagram: https://gitdiagram.com/alewwh1104/proyecto_ppm
- Repository: https://github.com/alewwh1104/proyecto_ppm

## Overview

##### Project Nature and Purpose
- This project is an Android application focused on managing wishlists. It allows users to create, edit, and manage personalized wishlists.
- It employs the MVVM architectural pattern, modern UI with Jetpack Compose, API consumption via Retrofit, and user/data management using Firebase.

##### Key Components
a. Presentation Layer (UI):
- The UI resides under app/src/main/java with dedicated packages for different screens:
– Account views (SignIn_Screen, SignUp_Screen, Home_Screen, UserAccount_Screen)
– Catalog screens (Category_Screen, Products_Screen, AddItem_Screen, etc.)
– Guest views (Guest_Screen, AboutWish_Screen, ViewGuestList_Screen)
– WishLists views (MainLists_Screen, AddList_Screen, EventCard, ListCard, ItemCard)
- Navigation is implemented in the navigation package (AppNavigation, NavigationState) to manage transitions between these screens.

b. Domain/Logic Layer (ViewModels & Business Logic):
- MVVM is the primary pattern. ViewModel classes such as CategoryViewModel link UI components to underlying data and logic.

c. Data Layer:
- Networking: The networking package contains classes like WishAPI and WishWebService that manage REST API calls using Retrofit.
- Data Responses: The networking/response package defines response data models (e.g., WishResponse, Constants).
- Repositories: The ui/catalogs/repository package (CategoryRepository) acts as a data manager that abstracts away data source details (API calls, Firebase reads/writes).

d. External Services:
- Firebase: Utilized for user registration and managing lists/products. Though not directly visible in the file tree, Firebase integration is a key dependency.
- Retrofit: Used for consuming REST APIs to fetch product or category data.

##### Architectural Patterns and Design Principles
- MVVM is clearly adopted for separation of concerns between UI (Views), ViewModel (logic and UI state management), and data sources (repository/API).
- The project leverages modern declarative UI practices with Jetpack Compose.
- A modular design is apparent in the file structure (separated directories for UI components, navigation, networking, and theming).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer (UI)"
        A["UI: Account Screens"]
        B["UI: Catalog Screens"]
        C["UI: Guest Screens"]
        D["UI: WishLists Screens"]
    end

    %% Navigation Component
    subgraph "Navigation"
        E["Navigation: AppNavigation"]
    end

    %% Domain/Logic Layer
    subgraph "Domain/Logic Layer (ViewModel)"
        F["ViewModel: CategoryViewModel"]
    end

    %% Data Layer
    subgraph "Data Layer"
        G["Repository: CategoryRepository"]
        H["Networking: WishAPI/WishWebService"]
        I["Response Models: Constants/WishResponse"]
    end

    %% External Services
    subgraph "External Services"
        J["Firebase"]
        K["Retrofit"]
    end

    %% Connections from UI to Navigation
    A -->|"navigates"| E
    B -->|"navigates"| E
    C -->|"navigates"| E
    D -->|"navigates"| E

    %% Connection from Navigation to ViewModel
    E -->|"triggers"| F

    %% Connection within Domain and Data Layers
    F -->|"fetches"| G
    G -->|"calls"| H
    H -->|"returns"| I

    %% External Service integrations
    A -->|"authenticates"| J
    G -->|"managesLists"| J
    H -->|"apiCalls"| K

    %% Click Events for Component Mapping
    click A "https://github.com/alewwh1104/proyecto_ppm/tree/main/app/src/main/java/com/wishify/proyecto_ppm/ui/account/view"
    click B "https://github.com/alewwh1104/proyecto_ppm/tree/main/app/src/main/java/com/wishify/proyecto_ppm/ui/catalogs/view"
    click C "https://github.com/alewwh1104/proyecto_ppm/tree/main/app/src/main/java/com/wishify/proyecto_ppm/ui/guest"
    click D "https://github.com/alewwh1104/proyecto_ppm/tree/main/app/src/main/java/com/wishify/proyecto_ppm/ui/wishLists/view"
    click E "https://github.com/alewwh1104/proyecto_ppm/tree/main/app/src/main/java/com/wishify/proyecto_ppm/navigation"
    click F "https://github.com/alewwh1104/proyecto_ppm/blob/main/app/src/main/java/com/wishify/proyecto_ppm/ui/catalogs/viewmodel/CategoryViewModel.kt"
    click G "https://github.com/alewwh1104/proyecto_ppm/blob/main/app/src/main/java/com/wishify/proyecto_ppm/ui/catalogs/repository/CategoryRepository.kt"
    click H "https://github.com/alewwh1104/proyecto_ppm/tree/main/app/src/main/java/com/wishify/proyecto_ppm/networking"
    click I "https://github.com/alewwh1104/proyecto_ppm/tree/main/app/src/main/java/com/wishify/proyecto_ppm/networking/response"

    %% Styles
    classDef ui fill:#a0c4ff,stroke:#000,stroke-width:2px;
    classDef viewModel fill:#caffbf,stroke:#000,stroke-width:2px;
    classDef data fill:#ffd6a5,stroke:#000,stroke-width:2px;
    classDef external fill:#d6a4ff,stroke:#000,stroke-width:2px;

    class A,B,C,D,E ui;
    class F viewModel;
    class G,H,I data;
    class J,K external;
```
