# jsdwrld/airise architecture

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

- Interactive diagram: https://gitdiagram.com/jsdwrld/airise
- Repository: https://github.com/jsdwrld/airise

## Overview

##### Project type and purpose
- This is a full-stack, mobile-first health & fitness platform with a Kotlin Multiplatform (Compose) frontend (Android & iOS) and a .NET 9 RESTful backend.
- Purpose: Deliver AI-driven coaching, progress tracking, meal planning, social features, and wearable integrations.

##### File structure
- Frontend
- composeApp (commonMain, androidMain, iosMain) – shared UI, business logic, data layer
- platform-specific modules (Room database on Android, CoreData on iOS)
- network clients, DTOs, repository, cache interfaces and implementations
- generativeAi, notifications, health integrations
- Backend
- Controllers (AuthController, ChallengeController, User/*) – HTTP endpoints
- Services (AuthService, ChallengeService, UserDataService, etc.) – business logic
- Data layer (ChallengeData, ProgramData) & MongoDBService – persistence abstractions
- Models & DTOs
- Config & deployment files: appsettings.json, launchSettings.json, Azure deployment notes
- Tests: xUnit suite for backend, commonTests for frontend business logic

##### Key architectural insights from README
- Monolithic .NET API hosting multiple resource controllers
- MongoDB Atlas for core data, SupaBase for auth/real-time features
- Kotlin Multiplatform: common UI and domain code, platform adapters for Android/iOS
- External services: Google Gemini AI, Google Fit, Apple Health, email/push notifications

## Diagram (Mermaid)

```mermaid
graph TD
  subgraph "Mobile Frontend"
    subgraph "UI Layer"
      UI["UI Layer<br/>Screens & ViewModels"]:::frontend
    end
    subgraph "Shared Container"
      AppContainer["AppContainer & AppViewModel"]:::frontend
    end
    subgraph "Domain Layer"
      Repo["Repository Interfaces & UseCases"]:::frontend
      CacheIF["Cache Interfaces & Implementations"]:::frontend
    end
    subgraph "Data Layer"
      Network["Network Clients & DTOs"]:::frontend
      Supabase["SupaBase Auth & Real-time"]:::frontend
      AI["Generative AI Integration"]:::frontend
      subgraph "Health Integrations"
        HealthA["Android HealthDataProvider"]:::frontend
        HealthI["iOS HealthDataProvider & KHealthSample"]:::frontend
      end
      subgraph "Local Cache"
        Room["Android Room DB"]:::frontend
        CoreData["iOS CoreData"]:::frontend
      end
      subgraph "Notifications"
        CommonNotif["Common Notifications"]:::frontend
        AndroidNotif["Android Notifications"]:::frontend
      end
    end
    subgraph "Platform Adapters"
      AndroidEntry["MainActivity"]:::frontend
      iOSEntry["MainViewController"]:::frontend
      PlatformExt["Platform Extensions"]:::frontend
    end
    subgraph "Frontend Tests"
      TestsFE["Common Tests"]:::frontend
    end
  end

  subgraph "Backend API"
    subgraph "Controllers"
      AuthC["AuthController"]:::backend
      ChallengeC["ChallengeController"]:::backend
      UserC["User Controllers"]:::backend
    end
    subgraph "Services"
      AuthS["AuthService"]:::backend
      ChallengeS["ChallengeService"]:::backend
      UserDataS["UserDataService"]:::backend
    end
    subgraph "Data Access Layer"
      MongoDBSvc["MongoDBService"]:::backend
      ChallengeData["ChallengeData"]:::backend
      ProgramData["ProgramData"]:::backend
    end
    subgraph "Models & DTOs"
      Models["Domain Models"]:::backend
      DTOs["DTOs"]:::backend
    end
    subgraph "Configuration & Deployment"
      AppSettings["appsettings.json"]:::backend
      LaunchSettings["launchSettings.json"]:::backend
      Program["Program.cs"]:::backend
    end
    subgraph "Backend Tests"
      TestsBE["Backend Tests"]:::backend
    end
  end

  subgraph "Datastores"
    MongoDB["MongoDB Atlas"]:::datastore
    SupaBaseStore["SupaBase (Auth & Real-time)"]:::datastore
  end

  subgraph "External Services"
    Gemini["Google Gemini AI"]:::external
    GoogleFit["Google Fit"]:::external
    AppleHealth["Apple Health"]:::external
    NotificationsExt["Email & Push Notification Providers"]:::external
  end

  %% Frontend flows
  UI -->|"uses"| AppContainer
  AppContainer -->|"invokes"| Repo
  Repo -->|"fetches via"| Network
  Network -->|"HTTP calls to"| AuthC
  AuthC -->|"calls"| AuthS
  AuthS -->|"accesses"| MongoDBSvc
  MongoDBSvc -->|"stores/retrieves"| MongoDB

  AppContainer -->|"syncs auth"| Supabase
  AppContainer -->|"requests"| AI
  AI -->|"calls"| Gemini
  AppContainer -->|"reads/writes"| Room
  AppContainer -->|"reads/writes"| CoreData
  AppContainer -->|"schedules"| CommonNotif
  CommonNotif -->|"platform events"| AndroidNotif
  AppContainer -->|"platform init"| AndroidEntry
  AppContainer -->|"platform init"| iOSEntry

  %% Backend flows
  ChallengeC -->|"calls"| ChallengeS
  ChallengeS -->|"accesses"| ChallengeData
  ChallengeData -->|"persists"| MongoDB
  UserC -->|"calls"| UserDataS
  UserDataS -->|"accesses"| ProgramData
  ProgramData -->|"persists"| MongoDB
  AuthS -->|"publishes events"| NotificationsExt

  %% External / datastore connections
  AuthC -->|"uses"| SupaBaseStore
  Supabase -->|"realtime updates"| SupaBaseStore
  HealthA -->|"sync with"| GoogleFit
  HealthI -->|"sync with"| AppleHealth

  %% Tests
  TestsFE --> UI
  TestsBE --> AuthS

  %% Click Events
  click UI "https://github.com/jsdwrld/airise/tree/main/Frontend/composeApp/src/commonMain/kotlin/com/teamnotfound/airise"
  click AppContainer "https://github.com/jsdwrld/airise/blob/main/Frontend/composeApp/src/commonMain/kotlin/com/teamnotfound/airise/AppContainer.kt"
  click Repo "https://github.com/jsdwrld/airise/tree/main/Frontend/composeApp/src/commonMain/kotlin/com/teamnotfound/airise/data/repository"
  click CacheIF "https://github.com/jsdwrld/airise/tree/main/Frontend/composeApp/src/commonMain/kotlin/com/teamnotfound/airise/data/cache"
  click Network "https://github.com/jsdwrld/airise/tree/main/Frontend/composeApp/src/commonMain/kotlin/com/teamnotfound/airise/data/network/clients"
  click Supabase "https://github.com/jsdwrld/airise/blob/main/Frontend/composeApp/src/commonMain/kotlin/com/teamnotfound/airise/data/supabase/Supabase.kt"
  click AI "https://github.com/jsdwrld/airise/blob/main/Frontend/composeApp/src/commonMain/kotlin/com/teamnotfound/airise/generativeAi/GeminiApi.kt"
  click HealthA "https://github.com/jsdwrld/airise/blob/main/Frontend/composeApp/src/androidMain/kotlin/com/teamnotfound/airise/health/HealthDataProvider.kt"
  click HealthI "https://github.com/jsdwrld/airise/blob/main/Frontend/composeApp/src/iosMain/kotlin/com/teamnotfound/airise/health/HealthDataProvider.kt"
  click Room "https://github.com/jsdwrld/airise/tree/main/Frontend/composeApp/src/androidMain/kotlin/com/teamnotfound/airise/room"
  click CommonNotif "https://github.com/jsdwrld/airise/tree/main/Frontend/composeApp/src/commonMain/kotlin/com/teamnotfound/airise/notifications"
  click AndroidNotif "https://github.com/jsdwrld/airise/tree/main/Frontend/composeApp/src/androidMain/kotlin/com/teamnotfound/airise/notifications"
  click AndroidEntry "https://github.com/jsdwrld/airise/blob/main/Frontend/composeApp/src/androidMain/kotlin/com/teamnotfound/airise/MainActivity.kt"
  click iOSEntry "https://github.com/jsdwrld/airise/blob/main/Frontend/composeApp/src/iosMain/kotlin/com/teamnotfound/airise/MainViewController.kt"
  click TestsFE "https://github.com/jsdwrld/airise/tree/main/Frontend/composeApp/src/commonTest/kotlin"
  click AuthC "https://github.com/jsdwrld/airise/blob/main/Backend/Controllers/AuthController.cs"
  click ChallengeC "https://github.com/jsdwrld/airise/blob/main/Backend/Controllers/ChallengeController.cs"
  click UserC "https://github.com/jsdwrld/airise/tree/main/Backend/Controllers/User"
  click AuthS "https://github.com/jsdwrld/airise/blob/main/Backend/Services/AuthService.cs"
  click ChallengeS "https://github.com/jsdwrld/airise/blob/main/Backend/Services/ChallengeService.cs"
  click UserDataS "https://github.com/jsdwrld/airise/blob/main/Backend/Services/UserDataService.cs"
  click MongoDBSvc "https://github.com/jsdwrld/airise/blob/main/Backend/Services/MongoDBService.cs"
  click ChallengeData "https://github.com/jsdwrld/airise/blob/main/Backend/Data/ChallengeData.cs"
  click ProgramData "https://github.com/jsdwrld/airise/blob/main/Backend/Data/ProgramData.cs"
  click Models "https://github.com/jsdwrld/airise/tree/main/Backend/Model"
  click DTOs "https://github.com/jsdwrld/airise/tree/main/Backend/Model/DTOs"
  click AppSettings "https://github.com/jsdwrld/airise/blob/main/Backend/appsettings.json"
  click LaunchSettings "https://github.com/jsdwrld/airise/blob/main/Backend/Properties/launchSettings.json"
  click Program "https://github.com/jsdwrld/airise/blob/main/Backend/Program.cs"
  click TestsBE "https://github.com/jsdwrld/airise/blob/main/Tests/AiRiseBackend.Tests"

  classDef frontend fill:#a8e6cf,stroke:#379683,color:#05386b
  classDef backend fill:#cbe4f9,stroke:#4682b4,color:#0b3d91
  classDef datastore fill:#ffd3b6,stroke:#ff8b94,color:#bf2e2e
  classDef external fill:#ffaaa5,stroke:#ff6f69,color:#790000
```
