How emanuelmath/meet4learn works
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: MainScreen.kt Screens · AuthRepository.kt Repos · CourseRepositoryImpl.kt Repo impls · AppContainer.kt AppContainer
Components 20
App shell
Android entry points and dependency composition root
- MainActivity · Launch activity for the Compose UI.
app/src/main/java/com/example/meet4learn/MainActivity.kt - App · Application class used at process startup.
app/src/main/java/com/example/meet4learn/Meet4LearnApplication.kt - AppContainer · 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 · Central route and screen graph for the app.
app/src/main/java/com/example/meet4learn/ui/navigation/Meet4LearnNavHost.kt - Screen · Route names and navigation destinations.
app/src/main/java/com/example/meet4learn/ui/navigation/Screen.kt - Splash VM · Startup state and routing logic.
app/src/main/java/com/example/meet4learn/ui/viewmodels/SplashViewModel.kt - Auth VM · Login and registration state management.
app/src/main/java/com/example/meet4learn/ui/viewmodels/LoginViewModel.kt - Dashboard VM · Main dashboard state and course entry points.
app/src/main/java/com/example/meet4learn/ui/viewmodels/DashboardViewModel.kt - Course VMs · Course description, details, and my-courses state.
app/src/main/java/com/example/meet4learn/ui/viewmodels/CourseDetailsViewModel.kt - Profile VM · Student profile state and updates.
app/src/main/java/com/example/meet4learn/ui/viewmodels/StudentProfileViewModel.kt - Video VM · Call token and join flow for video sessions.
app/src/main/java/com/example/meet4learn/ui/viewmodels/VideoCallViewModel.kt - Screens · Login, dashboard, course, payment, profile, calendar, password, and call screens.
app/src/main/java/com/example/meet4learn/ui/screens/MainScreen.kt - Components · 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 · 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 · 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 · Login and student registration orchestration.
app/src/main/java/com/example/meet4learn/domain/usecase/LoginStudentUseCase.kt
Data
DTOs, mappers, and repository implementations
- DTOs · Remote request/response shapes including LiveKit token payloads.
app/src/main/java/com/example/meet4learn/data/dto/LiveKitTokenRequest.kt - Mappers · DTO-to-domain and domain-to-DTO transformations.
app/src/main/java/com/example/meet4learn/data/mappers/CourseMapper.kt - Repo impls · 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 · External real-time calling backend used by the video-call flow.
Connections 27
- 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.