# emanuelmath/meet4learn architecture

> Architecture diagram of the GitHub repository emanuelmath/meet4learn, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/emanuelmath/meet4learn
- Repository: https://github.com/emanuelmath/meet4learn

## Overview

1. **Project scope**
   - This repository is an Android app module for **Meet4Learn**, built in **Kotlin** with **Jetpack Compose**-style UI structure and a standard Android Gradle setup.
   - The README mentions a future/related website, but the checked-in code here is the **mobile client only**.

2. **Top-level architecture**
   - The app follows a clear **presentation / domain / data** layering.
   - UI screens and view models sit in `ui/`.
   - Business-facing abstractions and models live in `domain/`.
   - Network/API-facing DTOs, mappers, and repository implementations live in `data/`.

3. **Application entry and dependency wiring**
   - `MainActivity` is the Android entry point for the UI.
   - `Meet4LearnApplication` plus `di/AppContainer` provide manual dependency wiring rather than a full DI framework.
   - Factory classes for view models indicate dependencies are injected into screens through explicit constructors/factories.

4. **Presentation layer**
   - `ui/screens` contains the feature screens: login/register, splash, dashboard, course browsing/details, my courses, user profile, payments, transaction history, calendar, password, and video call.
   - `ui/components` holds reusable UI pieces like the top bar, bottom bar, and login-specific components.
   - `ui/navigation` centralizes screen routing through `Meet4LearnNavHost` and `Screen`, which likely define the app’s navigation graph and route names.

5. **State management**
   - Each major screen has a paired `ViewModel` and `UiState` class in `ui/viewmodels`.
   - This suggests the app uses unidirectional state flow: the screen observes state, the view model loads data and handles events, and the UI renders accordingly.
   - Separate factory classes for each view model reinforce that the presentation layer is organized per feature.

6. **Domain layer**
   - `domain/models` defines the app’s core business entities: `Course`, `Module`, `Enrollment`, `Profile`, `ChatMessage`, and `SavedPaymentMethod`.
   - `domain/repositories` defines interfaces for app capabilities such as auth, courses, enrollments, profile, chat messages, payment methods, and calls.
   - `domain/usecase` currently includes login and student registration use cases, which encapsulate higher-level auth workflows.

7. **Data layer and remote boundary**
   - `data/dto` contains transport shapes used to communicate with an external backend or service.
   - `data/mappers` translate between DTOs and domain models, keeping the UI and domain isolated from wire-format details.
   - `data/repositories/*Impl` are concrete implementations of the domain repository interfaces, acting as the bridge to remote APIs or services.

8. **Likely backend-dependent features**
   - The presence of token request/response DTOs for **LiveKit** indicates video calling relies on an external real-time communication service.
   - `CallRepository` and `VideoCallViewModel` suggest a dedicated call flow that likely fetches a token before joining a session.
   - Chat, courses, enrollments, profile, and payment methods are all modeled as remote-backed features rather than purely local state.

9. **Feature flows**
   - Authentication flows: splash → login/register → main dashboard.
   - Course flows: dashboard and course description/details screens feed into enrollment and “my courses”.
   - Payment flows: payment screen, card screen, and transaction history imply course purchase or subscription support.
   - Communication flows: chat message handling and a video-call screen support live learning sessions.

10. **Utility and shared concerns**
   - `ui/utils` contains shared helpers for course formatting and date handling, used across multiple screens.
   - Theming is centralized in `ui/theme`, with custom colors, typography, and fonts under `res/`.
   - This keeps visual styling and presentation formatting reusable across the Compose UI.

11. **Testing and Android packaging**
   - `src/test` and `src/androidTest` exist for unit and instrumentation tests, though only template tests are currently present.
   - The Android manifest and resource folders indicate a standard single-app packaging model with launcher assets, fonts, and app-wide configuration.

12. **How to draw the architecture**
   - A good diagram would show: **UI screens → ViewModels → domain repository interfaces / use cases → data repository implementations → DTOs/mappers → backend services**.
   - Highlight the special external integration for **LiveKit** in the call path.
   - Treat `AppContainer`/application startup as the dependency composition root feeding the view model factories and repository implementations.

Main entry points: [`app/src/main/java/com/example/meet4learn/ui/screens/MainScreen.kt`](https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/ui/screens/MainScreen.kt) (Screens), [`app/src/main/java/com/example/meet4learn/domain/repositories/AuthRepository.kt`](https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/domain/repositories/AuthRepository.kt) (Repos), [`app/src/main/java/com/example/meet4learn/data/repositories/CourseRepositoryImpl.kt`](https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/data/repositories/CourseRepositoryImpl.kt) (Repo impls), [`app/src/main/java/com/example/meet4learn/di/AppContainer.kt`](https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/di/AppContainer.kt) (AppContainer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app_shell["App shell"]
  node_main_activity["MainActivity<br/>android entrypoint<br/>[MainActivity.kt]"]
  node_application["App"]
  node_container["AppContainer<br/>composition root<br/>[AppContainer.kt]"]
end

subgraph group_presentation["Presentation"]
  node_nav_host["NavHost<br/>navigation shell"]
  node_screen_routes["Screen<br/>route catalog<br/>[Screen.kt]"]
  node_splash_vm["Splash VM<br/>state holder<br/>[SplashViewModel.kt]"]
  node_auth_vm["Auth VM<br/>state holder<br/>[LoginViewModel.kt]"]
  node_dashboard_vm["Dashboard VM<br/>state holder"]
  node_course_vm["Course VMs<br/>state holders"]
  node_profile_vm["Profile VM<br/>state holder"]
  node_video_vm["Video VM<br/>state holder"]
  node_screens["Screens<br/>[MainScreen.kt]"]
  node_components["Components<br/>ui primitives"]
end

subgraph group_domain["Domain"]
  node_domain_models[("Models<br/>domain entities<br/>[Course.kt]")]
  node_domain_repos["Repos<br/>[AuthRepository.kt]"]
  node_use_cases["Use cases<br/>auth workflows"]
end

subgraph group_data["Data"]
  node_dto_boundary["DTOs<br/>wire models"]
  node_mappers["Mappers<br/>translation layer<br/>[CourseMapper.kt]"]
  node_repo_impls["Repo impls<br/>data access"]
end

subgraph group_external["External"]
  node_livekit(("LiveKit<br/>rtc service"))
end

node_application -->|"starts"| node_main_activity
node_application -->|"creates"| node_container
node_container -->|"provides"| node_repo_impls
node_container -->|"provides"| node_use_cases
node_main_activity -->|"hosts"| node_nav_host
node_nav_host -->|"uses"| node_screen_routes
node_nav_host -->|"renders"| node_screens
node_screens -->|"composes"| node_components
node_screens -->|"observes"| node_splash_vm
node_screens -->|"observes"| node_auth_vm
node_screens -->|"observes"| node_dashboard_vm
node_screens -->|"observes"| node_course_vm
node_screens -->|"observes"| node_profile_vm
node_screens -->|"observes"| node_video_vm
node_splash_vm -->|"calls"| node_use_cases
node_auth_vm -->|"calls"| node_use_cases
node_dashboard_vm -->|"depends on"| node_domain_repos
node_course_vm -->|"depends on"| node_domain_repos
node_profile_vm -->|"depends on"| node_domain_repos
node_video_vm -->|"depends on"| node_domain_repos
node_domain_repos -->|"returns"| node_domain_models
node_repo_impls -->|"maps to"| node_dto_boundary
node_repo_impls -->|"uses"| node_mappers
node_mappers -->|"produces"| node_domain_models
node_repo_impls -->|"implements"| node_domain_repos
node_video_vm -->|"requests token"| node_livekit
node_dto_boundary -.->|"integrates"| node_livekit

click node_main_activity "https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/MainActivity.kt"
click node_application "https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/Meet4LearnApplication.kt"
click node_container "https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/di/AppContainer.kt"
click node_nav_host "https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/ui/navigation/Meet4LearnNavHost.kt"
click node_screen_routes "https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/ui/navigation/Screen.kt"
click node_splash_vm "https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/ui/viewmodels/SplashViewModel.kt"
click node_auth_vm "https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/ui/viewmodels/LoginViewModel.kt"
click node_dashboard_vm "https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/ui/viewmodels/DashboardViewModel.kt"
click node_course_vm "https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/ui/viewmodels/CourseDetailsViewModel.kt"
click node_profile_vm "https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/ui/viewmodels/StudentProfileViewModel.kt"
click node_video_vm "https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/ui/viewmodels/VideoCallViewModel.kt"
click node_screens "https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/ui/screens/MainScreen.kt"
click node_components "https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/ui/components/Meet4LearnTopBar.kt"
click node_domain_models "https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/domain/models/Course.kt"
click node_domain_repos "https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/domain/repositories/AuthRepository.kt"
click node_use_cases "https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/domain/usecase/LoginStudentUseCase.kt"
click node_dto_boundary "https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/data/dto/LiveKitTokenRequest.kt"
click node_mappers "https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/data/mappers/CourseMapper.kt"
click node_repo_impls "https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/data/repositories/CourseRepositoryImpl.kt"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main_activity,node_application,node_container toneBlue
class node_nav_host,node_screen_routes,node_splash_vm,node_auth_vm,node_dashboard_vm,node_course_vm,node_profile_vm,node_video_vm,node_screens,node_components toneAmber
class node_domain_models,node_domain_repos,node_use_cases toneMint
class node_dto_boundary,node_mappers,node_repo_impls toneRose
class node_livekit toneIndigo
```

## Components

### App shell

Android entry points and dependency composition root

- [MainActivity](https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/MainActivity.kt): android entrypoint · Launch activity for the Compose UI. · `app/src/main/java/com/example/meet4learn/MainActivity.kt`
- [App](https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/Meet4LearnApplication.kt): android application · Application class used at process startup. · `app/src/main/java/com/example/meet4learn/Meet4LearnApplication.kt`
- [AppContainer](https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/di/AppContainer.kt): composition root · Manual dependency wiring for repositories and view models. · `app/src/main/java/com/example/meet4learn/di/AppContainer.kt`

### Presentation

Compose UI, navigation, screens, and state holders

- [NavHost](https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/ui/navigation/Meet4LearnNavHost.kt): navigation shell · Central route and screen graph for the app. · `app/src/main/java/com/example/meet4learn/ui/navigation/Meet4LearnNavHost.kt`
- [Screen](https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/ui/navigation/Screen.kt): route catalog · Route names and navigation destinations. · `app/src/main/java/com/example/meet4learn/ui/navigation/Screen.kt`
- [Splash VM](https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/ui/viewmodels/SplashViewModel.kt): state holder · Startup state and routing logic. · `app/src/main/java/com/example/meet4learn/ui/viewmodels/SplashViewModel.kt`
- [Auth VM](https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/ui/viewmodels/LoginViewModel.kt): state holder · Login and registration state management. · `app/src/main/java/com/example/meet4learn/ui/viewmodels/LoginViewModel.kt`
- [Dashboard VM](https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/ui/viewmodels/DashboardViewModel.kt): state holder · Main dashboard state and course entry points. · `app/src/main/java/com/example/meet4learn/ui/viewmodels/DashboardViewModel.kt`
- [Course VMs](https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/ui/viewmodels/CourseDetailsViewModel.kt): state holders · Course description, details, and my-courses state. · `app/src/main/java/com/example/meet4learn/ui/viewmodels/CourseDetailsViewModel.kt`
- [Profile VM](https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/ui/viewmodels/StudentProfileViewModel.kt): state holder · Student profile state and updates. · `app/src/main/java/com/example/meet4learn/ui/viewmodels/StudentProfileViewModel.kt`
- [Video VM](https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/ui/viewmodels/VideoCallViewModel.kt): state holder · Call token and join flow for video sessions. · `app/src/main/java/com/example/meet4learn/ui/viewmodels/VideoCallViewModel.kt`
- [Screens](https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/ui/screens/MainScreen.kt): compose screens · Login, dashboard, course, payment, profile, calendar, password, and call screens. · `app/src/main/java/com/example/meet4learn/ui/screens/MainScreen.kt`
- [Components](https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/ui/components/Meet4LearnTopBar.kt): ui primitives · Reusable top bar, bottom bar, and login UI pieces. · `app/src/main/java/com/example/meet4learn/ui/components/Meet4LearnTopBar.kt`

### Domain

Business models, repository contracts, and use cases

- [Models](https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/domain/models/Course.kt): domain entities · Core business objects such as courses, enrollments, profiles, chat messages, and payment methods. · `app/src/main/java/com/example/meet4learn/domain/models/Course.kt`
- [Repos](https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/domain/repositories/AuthRepository.kt): repository contracts · Abstract app capabilities for auth, courses, enrollments, profile, chat, payments, modules, and calls. · `app/src/main/java/com/example/meet4learn/domain/repositories/AuthRepository.kt`
- [Use cases](https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/domain/usecase/LoginStudentUseCase.kt): auth workflows · Login and student registration orchestration. · `app/src/main/java/com/example/meet4learn/domain/usecase/LoginStudentUseCase.kt`

### Data

DTOs, mappers, and repository implementations

- [DTOs](https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/data/dto/LiveKitTokenRequest.kt): wire models · Remote request/response shapes including LiveKit token payloads. · `app/src/main/java/com/example/meet4learn/data/dto/LiveKitTokenRequest.kt`
- [Mappers](https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/data/mappers/CourseMapper.kt): translation layer · DTO-to-domain and domain-to-DTO transformations. · `app/src/main/java/com/example/meet4learn/data/mappers/CourseMapper.kt`
- [Repo impls](https://github.com/emanuelmath/meet4learn/blob/main/app/src/main/java/com/example/meet4learn/data/repositories/CourseRepositoryImpl.kt): data access · Concrete repository implementations that bridge domain contracts to remote services. · `app/src/main/java/com/example/meet4learn/data/repositories/CourseRepositoryImpl.kt`

### External

Remote services and platform boundaries

- **LiveKit**: rtc service · External real-time calling backend used by the video-call flow.

## Connections

- App → MainActivity: starts · Application startup leads into the launcher activity.
- App → AppContainer: creates · Application owns the dependency composition root.
- AppContainer → Repo impls: provides · Repository implementations are built and shared from the container.
- AppContainer → Use cases: provides · Use cases are wired through the app container.
- MainActivity → NavHost: hosts · The activity hosts the app navigation shell.
- NavHost → Screen: uses · Navigation resolves destinations through route definitions.
- NavHost → Screens: renders · Navigation selects which screen composables appear.
- Screens → Components: composes · Screens reuse shared top bar, bottom bar, and login UI pieces.
- Screens → Splash VM: observes · Splash screen reads startup state from its view model.
- Screens → Auth VM: observes · Login and register flows are driven by auth state.
- Screens → Dashboard VM: observes · Dashboard and browse flows consume dashboard state.
- Screens → Course VMs: observes · Course detail, description, and my-courses screens use course state.
- Screens → Profile VM: observes · Profile-related screens consume profile state.
- Screens → Video VM: observes · Call screen uses the video-call state holder.
- Splash VM → Use cases: calls · Startup and auth routing depend on use-case orchestration.
- Auth VM → Use cases: calls · Login and register screens execute auth workflows through use cases.
- Dashboard VM → Repos: depends on · Dashboard state is backed by repository contracts.
- Course VMs → Repos: depends on · Course flows read and update through domain repositories.
- Profile VM → Repos: depends on · Profile state is sourced from repository interfaces.
- Video VM → Repos: depends on · Video call flow uses the call repository contract.
- Repos → Models: returns · Repository APIs expose domain entities.
- Repo impls → DTOs: maps to · Implementations translate between network payloads and app data.
- Repo impls → Mappers: uses · Repository implementations use mappers to cross the boundary.
- Mappers → Models: produces · Mappers materialize domain entities from DTOs.
- Repo impls → Repos: implements · Concrete data layer classes satisfy the repository contracts.
- Video VM → LiveKit: requests token · The call flow obtains RTC tokens from the LiveKit-backed boundary.
- DTOs → LiveKit: integrates · LiveKit token request/response types model the external call service.
