# team-aipaca/aipaca_app architecture

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

- Interactive diagram: https://gitdiagram.com/team-aipaca/aipaca_app
- Repository: https://github.com/team-aipaca/aipaca_app

## Overview

##### Main Architecture Components

a) Presentation Layer (UI)
- MVVM pattern implementation with:
- Views (Views folder)
- ViewModels (ViewModels folder)
- Models (Models folder)
- AppShell as the navigation container

b) Core Services Layer
- Database Service (Data/DatabaseService.cs)
- API Configuration (Data/ApiConfigManager.cs)
- Resource Management (Localization, Configurations)

c) Platform-Specific Layer
- Android
- iOS
- MacCatalyst
- Windows
- Tizen

##### Component Relationships

a) Data Flow
- ViewModels ↔ Models
- ViewModels ↔ Services
- Services ↔ External API
- Database Service ↔ Local Storage

b) Navigation Flow
- AppShell ↔ Main Pages
- Pages ↔ Popups

##### Specific Implementation Details

Create sections for:

a) Feature Modules
- Account Management (Views/Account)
- Settings Management (Views/Settings)
- Challenge System
- Robot Interface
- Record Tracking

b) Cross-Cutting Concerns
- Localization (Resources/Localization)
- Configuration Management
- Converters

**┌─────────────────────────────────────────┐**
- UI Layer                   │
- (Views, ViewModels, XAML Components)   │
- ┤
- Business Logic Layer          │
- (Services, Models, Configuration)    │
- ┤
- Cross-Platform Layer            │
- (.NET MAUI Framework Components)     │
- ┤
- Platform-Specific Layer         │
- (Android, iOS, Windows, macOS, Tizen)   │
- ┘

##### Important Details

- MVVM binding relationships
- Multi-language support system
- API configuration flow
- Demonstrate the database interaction pattern
- Platform-specific implementation points

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef ui fill:#a8d1f0,stroke:#000
    classDef service fill:#90EE90,stroke:#000
    classDef platform fill:#FFE5B4,stroke:#000
    classDef model fill:#DDA0DD,stroke:#000
    classDef resource fill:#F0E68C,stroke:#000

    %% Legend
    subgraph Legend
        UI[UI Components]:::ui
        SVC[Services]:::service
        PLT[Platform-Specific]:::platform
        MDL[Models]:::model
        RES[Resources]:::resource
    end

    %% Main Application Structure
    subgraph MainApp
        %% UI Layer
        subgraph UILayer
            Views["Views"]:::ui
            ViewModels["ViewModels"]:::ui
            AppShell["AppShell"]:::ui
            
            %% Feature Modules
            subgraph Features
                Account["Account Management"]:::ui
                Settings["Settings Management"]:::ui
                Challenge["Challenge System"]:::ui
                Robot["Robot Interface"]:::ui
                Record["Record Tracking"]:::ui
            end
        end

        %% Core Services Layer
        subgraph Services
            DBService["Database Service"]:::service
            ApiConfig["API Configuration"]:::service
        end

        %% Models Layer
        subgraph DataModels
            Models["Models"]:::model
        end

        %% Resources
        subgraph Resources
            Localization["Localization"]:::resource
            Config["Configuration"]:::resource
            Converters["Converters"]:::resource
            Styles["Styles"]:::resource
            Images["Images"]:::resource
            Fonts["Fonts"]:::resource
        end

        %% Platform Layer
        subgraph Platforms
            Android["Android"]:::platform
            iOS["iOS"]:::platform
            MacCatalyst["MacCatalyst"]:::platform
            Windows["Windows"]:::platform
            Tizen["Tizen"]:::platform
        end
    end

    %% Relationships
    AppShell --> Views
    Views --> ViewModels
    ViewModels --> Models
    ViewModels --> Services
    DBService --> Models
    ApiConfig --> Services

    %% Component Mappings
    click Views "https://github.com/Team-AIpaca/AIpaca_App/tree/main/AIpaca_App/Views/"
    click ViewModels "https://github.com/Team-AIpaca/AIpaca_App/tree/main/AIpaca_App/ViewModels/"
    click Models "https://github.com/Team-AIpaca/AIpaca_App/tree/main/AIpaca_App/Models/"
    click AppShell "https://github.com/Team-AIpaca/AIpaca_App/blob/main/AIpaca_App/AppShell.xaml"
    click DBService "https://github.com/Team-AIpaca/AIpaca_App/blob/main/AIpaca_App/Data/DatabaseService.cs"
    click ApiConfig "https://github.com/Team-AIpaca/AIpaca_App/blob/main/AIpaca_App/Data/ApiConfigManager.cs"
    click Android "https://github.com/Team-AIpaca/AIpaca_App/tree/main/AIpaca_App/Platforms/Android/"
    click iOS "https://github.com/Team-AIpaca/AIpaca_App/tree/main/AIpaca_App/Platforms/iOS/"
    click MacCatalyst "https://github.com/Team-AIpaca/AIpaca_App/tree/main/AIpaca_App/Platforms/MacCatalyst/"
    click Windows "https://github.com/Team-AIpaca/AIpaca_App/tree/main/AIpaca_App/Platforms/Windows/"
    click Tizen "https://github.com/Team-AIpaca/AIpaca_App/tree/main/AIpaca_App/Platforms/Tizen/"
    click Account "https://github.com/Team-AIpaca/AIpaca_App/tree/main/AIpaca_App/Views/Account/"
    click Settings "https://github.com/Team-AIpaca/AIpaca_App/tree/main/AIpaca_App/Views/Settings/"
    click Challenge "https://github.com/Team-AIpaca/AIpaca_App/blob/main/AIpaca_App/Views/ChallengePage.xaml"
    click Robot "https://github.com/Team-AIpaca/AIpaca_App/blob/main/AIpaca_App/Views/RobotPage.xaml"
    click Record "https://github.com/Team-AIpaca/AIpaca_App/blob/main/AIpaca_App/Views/RecordPage.xaml"
    click Localization "https://github.com/Team-AIpaca/AIpaca_App/tree/main/AIpaca_App/Resources/Localization/"
    click Config "https://github.com/Team-AIpaca/AIpaca_App/tree/main/AIpaca_App/Resources/Config/"
    click Converters "https://github.com/Team-AIpaca/AIpaca_App/tree/main/AIpaca_App/Converters/"
    click Styles "https://github.com/Team-AIpaca/AIpaca_App/tree/main/AIpaca_App/Resources/Styles/"
    click Images "https://github.com/Team-AIpaca/AIpaca_App/tree/main/AIpaca_App/Resources/Images/"
    click Fonts "https://github.com/Team-AIpaca/AIpaca_App/tree/main/AIpaca_App/Resources/Fonts/"
```
