# peterfriese/makeitso architecture

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

- Interactive diagram: https://gitdiagram.com/peterfriese/makeitso
- Repository: https://github.com/peterfriese/makeitso

## Overview

##### Project Type & Purpose
- This is a sample multi-platform (iOS and macOS) SwiftUI app that demonstrates how to integrate Firebase for Authentication and Cloud Firestore. Although there’s a “backend” folder in the code tree, the README and overall structure emphasize the frontend client and Firebase integration as the primary components.
- The project is structured as a mobile client application (full-stack in the sense of client and cloud service integration) rather than a traditional backend server–driven application.

##### File Structure
- Top-Level Components:
- code: Contains all source code divided into backend and frontend.
- Under code/frontend/MakeItSo:
- There is a configuration folder with separate Firebase configurations for Development and Production suggesting environment-specific setups.
- The project is organized with clear separation into Shared components, Features (like Authentication and ReminderList), and utilities, following an approach similar to the MVVM design typical in SwiftUI apps.
- Multiple schemes are defined that target different platforms (iOS/macOS) and build configurations (DEV/PROD).
- The “backend” directory exists (with its own .gitignore) but no further details in the README indicate heavy server-side logic, suggesting it might be minimal, a placeholder, or for demonstration purposes.

##### Key Components
A. Frontend (Mobile Client Application):
- iOS and macOS Clients: Represent these as two deployment targets within the MakeItSo project.
- Shared UI Components & Features:
- Authentication Module: Services (e.g., AuthenticationService.swift), views, and view models.
- ReminderList Module: Models, Repositories, ViewModels, and Views.
- Common, Extensions, and Utilities that aid across features.
- Configuration: Separate folders and files for Firebase integration (for Development and Production) which configure connection settings and authentication flow.

B. External Services:
- Firebase: Position Firebase as an external dependency, covering:
- Cloud Firestore (as the database)
- Firebase Authentication (specifically Anonymous Authentication)
- Data flow where the app consumes Firebase services (authorization, data retrieval, updates) through the service layer.

C. (Optionally) Backend:

##### Relationships & Data Flow
- If including the backend folder, you might show it as an optional block whose interactions with the frontend are less prominent (or used for specific tasks).

##### Architectural Patterns and Design Principles
- A clear separation between Presentation (SwiftUI Views), Business Logic (ViewModels, Services), and Data (Models, Repositories).
- Environment-specific configurations (DEV vs. PROD) which indicate a separation of concerns in managing different Firebase projects.
- Integration with external services using well-defined APIs or SDK wrappers (Firebase functionality).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Mobile Client Application
    subgraph "Frontend Mobile Client Application"
        direction TB
        FMApp["MakeItSo App"]:::frontend
        click FMApp "https://github.com/peterfriese/makeitso/tree/main/code/frontend/MakeItSo"
        
        schemes["iOS/macOS Deployment Targets"]:::frontend
        click schemes "https://github.com/peterfriese/makeitso/tree/main/code/frontend/MakeItSo/MakeItSo.xcodeproj/xcshareddata/xcschemes"
        FMApp --> schemes

        shared["Shared UI Components & Common Utilities"]:::shared
        click shared "https://github.com/peterfriese/makeitso/tree/main/code/frontend/MakeItSo/Shared"
        FMApp --> shared

        subgraph "Features"
            direction TB
            authModule["Authentication Module"]:::feature
            click authModule "https://github.com/peterfriese/makeitso/tree/main/code/frontend/MakeItSo/Shared/Features/Authentication"

            authService["Authentication Service"]:::service
            click authService "https://github.com/peterfriese/makeitso/blob/main/code/frontend/MakeItSo/Shared/Features/Authentication/Services/AuthenticationService.swift"
            authModule --> authService

            reminderModule["ReminderList Module"]:::feature
            click reminderModule "https://github.com/peterfriese/makeitso/tree/main/code/frontend/MakeItSo/Shared/Features/ReminderList"

            reminderModel["Reminder Model"]:::model
            click reminderModel "https://github.com/peterfriese/makeitso/blob/main/code/frontend/MakeItSo/Shared/Features/ReminderList/Models/Reminder.swift"

            reminderRepo["Reminders Repository"]:::service
            click reminderRepo "https://github.com/peterfriese/makeitso/blob/main/code/frontend/MakeItSo/Shared/Features/ReminderList/Repositories/RemindersRepository.swift"
            
            reminderModule --> reminderModel
            reminderModule --> reminderRepo

            shared --> authModule
            shared --> reminderModule
        end

        config["Firebase Configuration"]:::config
        click config "https://github.com/peterfriese/makeitso/tree/main/code/frontend/MakeItSo/Configuration/Firebase"

        subgraph "Firebase Environment Config"
            direction TB
            devConfig["Development"]:::config
            click devConfig "https://github.com/peterfriese/makeitso/tree/main/code/frontend/MakeItSo/Configuration/Firebase/Development"
            prodConfig["Production"]:::config
            click prodConfig "https://github.com/peterfriese/makeitso/tree/main/code/frontend/MakeItSo/Configuration/Firebase/Production"
            config --> devConfig
            config --> prodConfig
        end
    end

    %% External Services
    subgraph "External Services"
        direction TB
        firebaseAuth["Firebase Authentication"]:::firebase
        firebaseFS["Firebase Cloud Firestore"]:::firebase
    end

    %% Backend Placeholder
    subgraph "Backend"
        direction TB
        backend["Backend Placeholder"]:::backend
        click backend "https://github.com/peterfriese/makeitso/tree/main/code/backend"
    end

    %% Connections between Frontend features and External Services
    authService -->|"calls"| firebaseAuth
    reminderRepo -->|"queries"| firebaseFS

    %% Configuration influences external services
    config --- firebaseAuth
    config --- firebaseFS

    %% Optional connection from Frontend shared components to Backend placeholder
    shared --- backend

    %% Legend (for explanatory purposes)
    subgraph "Legend"
        direction TB
        L1["Rectangles: Modules/Components"]:::frontend
        L2["Cylinder: External Databases"]:::firebase
        L3["Cloud: External Cloud Services"]:::firebase
    end

    %% Styles
    classDef frontend fill:#AED6F1,stroke:#2471A3,stroke-width:2px;
    classDef shared fill:#ABEBC6,stroke:#1E8449,stroke-width:2px;
    classDef feature fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef service fill:#FAD7A0,stroke:#BA4A00,stroke-width:2px;
    classDef model fill:#D2B4DE,stroke:#6C3483,stroke-width:2px;
    classDef config fill:#F5CBA7,stroke:#AF601A,stroke-width:2px;
    classDef firebase fill:#F5B7B1,stroke:#922B21,stroke-width:2px;
    classDef backend fill:#D6EAF8,stroke:#1B4F72,stroke-width:2px;
```
