# aossie-org/monumento architecture

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

- Interactive diagram: https://gitdiagram.com/aossie-org/monumento
- Repository: https://github.com/aossie-org/monumento

## Overview

##### Main Components

a) Client Layer:
- Mobile Apps (iOS/Android)
- Web Application
- Desktop Application

b) Core Application Layers:
- Presentation Layer (lib/presentation/)
- Application Layer (lib/application/) - BLoC Pattern
- Domain Layer (lib/domain/)
- Data Layer (lib/data/)

c) External Services:
- Firebase Authentication
- Firebase Firestore
- Firebase Storage
- Google Cloud Services (People API)
- Geoapify API
- AR Integration Components

##### Architecture Pattern Representation

Clean Architecture pattern with concentric circles:
- Outer circle: Infrastructure (Firebase, External APIs)
- Middle circles: Data & Application layers
- Inner circle: Domain layer (Entities & Repository Interfaces)

##### Key Flows to Highlight

a) Authentication Flow:
- Google Sign-in
- Email/Password authentication
- User session management

b) Monument Interaction Flow:
- Monument discovery
- AR visualization
- Check-ins
- Social interactions

c) Social Features Flow:
- Posts
- Comments
- User following
- Notifications

##### Component Relationships

- Data flow (→)
- Dependencies (⟶)
- API calls (- - ->)
- Event streams (⇢)

##### Technical Details

a) Architecture Patterns:
- BLoC Pattern implementation
- Repository Pattern
- Clean Architecture boundaries

b) Key Technologies:
- Flutter/Dart
- Firebase services
- ML components (TFLite models)
- AR integration

##### Specific Implementation Notes

Specialized components for:
- Monument data management
- AR visualization
- Social networking features
- Location services
- ML model integration

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        MA[Flutter App]:::frontend
    end

    subgraph "Clean Architecture"
        subgraph Presentation
            PL[Presentation Layer]
            click PL "https://github.com/AOSSIE-Org/Monumento/tree/develop/lib/presentation/"
            Auth_UI[Authentication UI]
            click Auth_UI "https://github.com/AOSSIE-Org/Monumento/tree/develop/lib/presentation/authentication/"
            Mon_UI[Monument UI]
            click Mon_UI "https://github.com/AOSSIE-Org/Monumento/tree/develop/lib/presentation/popular_monuments/"
            Feed_UI[Feed UI]
            click Feed_UI "https://github.com/AOSSIE-Org/Monumento/tree/develop/lib/presentation/feed/"
            Prof_UI[Profile UI]
            click Prof_UI "https://github.com/AOSSIE-Org/Monumento/tree/develop/lib/presentation/profile_screen/"
        end

        subgraph Application
            AL[Application Layer]
            click AL "https://github.com/AOSSIE-Org/Monumento/tree/develop/lib/application/"
            Auth_Bloc[Authentication BLoC]
            click Auth_Bloc "https://github.com/AOSSIE-Org/Monumento/tree/develop/lib/application/authentication/"
            Mon_Bloc[Monument BLoC]
            click Mon_Bloc "https://github.com/AOSSIE-Org/Monumento/tree/develop/lib/application/popular_monuments/"
            Feed_Bloc[Feed BLoC]
            click Feed_Bloc "https://github.com/AOSSIE-Org/Monumento/tree/develop/lib/application/feed/"
            Prof_Bloc[Profile BLoC]
            click Prof_Bloc "https://github.com/AOSSIE-Org/Monumento/tree/develop/lib/application/profile/"
            Notif_Bloc[Notifications BLoC]
            click Notif_Bloc "https://github.com/AOSSIE-Org/Monumento/tree/develop/lib/application/notifications/"
        end

        subgraph Domain
            DL[Domain Layer]
            click DL "https://github.com/AOSSIE-Org/Monumento/tree/develop/lib/domain/"
            Entities[Domain Entities]
            click Entities "https://github.com/AOSSIE-Org/Monumento/tree/develop/lib/domain/entities/"
        end

        subgraph "Data Layer"
            DataL[Data Layer]
            click DataL "https://github.com/AOSSIE-Org/Monumento/tree/develop/lib/data/"
            Models[Data Models]
            click Models "https://github.com/AOSSIE-Org/Monumento/tree/develop/lib/data/models/"
            Auth_Repo[Authentication Repository]
            click Auth_Repo "https://github.com/AOSSIE-Org/Monumento/blob/develop/lib/data/repositories/firebase_authentication_repository.dart"
            Mon_Repo[Monument Repository]
            click Mon_Repo "https://github.com/AOSSIE-Org/Monumento/blob/develop/lib/data/repositories/firebase_monument_repository.dart"
            Social_Repo[Social Repository]
            click Social_Repo "https://github.com/AOSSIE-Org/Monumento/blob/develop/lib/data/repositories/firebase_social_repository.dart"
        end
    end

    subgraph "External Services"
        Firebase[Firebase Services]
        Auth[Authentication]
        Firestore[Firestore]
        Storage[Storage]
        GCP[Google Cloud People API]
        Geo[Geoapify API]
    end

    subgraph "ML & AR"
        ML[ML Models]
        click ML "https://github.com/AOSSIE-Org/Monumento/tree/develop/assets/ml/"
        AR[AR Integration]
        TF_Asia[Asia TFLite]
        click TF_Asia "https://github.com/AOSSIE-Org/Monumento/blob/develop/assets/ml/asia.tflite"
        TF_Europe[Europe TFLite]
        click TF_Europe "https://github.com/AOSSIE-Org/Monumento/blob/develop/assets/ml/europe.tflite"
    end

    MA --> PL
    PL --> AL
    AL --> DL
    DL --> DataL
    DataL --> Firebase
    DataL --> Geo
    DataL --> GCP
    ML --> AR
    AR --> PL

    classDef frontend fill:#3498db
    classDef core fill:#2ecc71
    classDef external fill:#e67e22
    classDef data fill:#9b59b6
    classDef auth fill:#f1c40f
    classDef ml fill:#1abc9c

    class MA frontend
    class PL,AL,DL,DataL core
    class Firebase,Auth,Firestore,Storage,GCP,Geo external
    class Models,Auth_Repo,Mon_Repo,Social_Repo data
    class Auth_UI,Auth_Bloc auth
    class ML,AR,TF_Asia,TF_Europe ml
```
