How saydullin/bsuir_schedule works
Project Overview and Purpose
• This project is an Android application designed to display schedules for BSUIR University students and teachers. It supports multiple schedule types (teachers, students, exams), custom subject additions, history tracking, sharing capabilities, and various settings (language, theme, auto update, etc.).
• The app also includes rich features like local notifications, app widgets, and an offline database for managing schedule data.
Main Architectural Layers and Components
a. Presentation Layer (UI)
• Activities, Fragments, and Dialogs (located in app/src/main/java/com/bsuir/bsuirschedule/presentation) provide the user interface.
• ViewModels (in app/src/main/java/com/bsuir/bsuirschedule/presentation/viewModels) that interact with the UI logic.
• Adapters, Views, and Widgets (e.g., app/src/main/java/com/bsuir/bsuirschedule/presentation/adapters, widgets, and views) handle visual rendering and user input.
• Android Services, Receivers, and Workers (in the service, receiver, and worker folders) manage background tasks such as schedule updates, notifications, and widget updates.
b. Domain Layer (Business Logic)
• Use Cases (in app/src/main/java/com/bsuir/bsuirschedule/domain/usecase) encapsulate the business logic like fetching schedules, updating schedule history, and applying custom schedule settings.
• Domain Models (in app/src/main/java/com/bsuir/bsuirschedule/domain/models) represent the key entities for schedule, teacher, faculty, etc.
• Schedule Management components (managers in app/src/main/java/com/bsuir/bsuirschedule/domain/manager) handle schedule building, updating, and related business rules.
c. Data Layer (Data Access and Repositories)
• API Services (located under app/src/main/java/com/bsuir/bsuirschedule/api) implemented with Retrofit (e.g., RetrofitBuilder.kt and various Get…Service.kt files) handle network requests.
• Local Database and DAOs (in app/src/main/java/com/bsuir/bsuirschedule/data/db) manage on-device persistence using Room (from the database entities, dao, and migration folders). JSON schema files in app/schemas hint at keeping database versions.
• Repositories (both in the data layer and mirrored in the domain layer under repository folders) abstract data fetching and caching, integrating both remote API and local DB sources.
d. Dependency Injection (DI)
• DI modules (located in app/src/main/java/com/bsuir/bsuirschedule/di) such as AppModule, DataModule, and DomainModule manage dependency injection, ensuring decoupling and testability.
e. External Components/Services
• Notification components (in app/src/main/java/com/bsuir/bsuirschedule/notification) handle schedule notifications.
• Widget components (in app/src/main/java/com/bsuir/bsuirschedule/presentation/widgets) provide app widget functionality.
• Android-specific components such as AndroidManifest, Gradle build scripts, and resource files under app/src/main/res contributing to overall application packaging and configuration.
• At the top, show the Presentation/UI layer which includes Activities, Fragments, ViewModels, and Widgets.
• An “Infrastructure” block that houses the Dependency Injection (DI) containers used by all layers.
• Integrations with external components such as:
Architectural Patterns and Design Principles
• The project follows a layered, clean architecture pattern separating presentation, domain, and data responsibilities.
• MVVM (Model-View-ViewModel) appears in the presentation layer with ViewModels interacting with Domain use cases.
• Use of dependency injection promotes loose coupling.
• The repository pattern abstracts data sources, enabling interchangeability between remote and local data.
• The architecture supports extensibility with clearly separated responsibilities.