# stasolejnik/elektron architecture

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

- Interactive diagram: https://gitdiagram.com/stasolejnik/elektron
- Repository: https://github.com/stasolejnik/elektron

## Overview

eLektron is an Android school-day companion for ZSE Bydgoszcz. A student chooses a class and groups, then views locally cached timetable, substitutions, announcements, and transit; background synchronization refreshes school data, while settings, notifications, widgets, and lesson-note reminders support daily use. The README documents the product capabilities and data providers. Internal edges are limited to relationships visible in excerpts or the source index; links involving unsampled screens and subsystems are shown as unverified where useful.

Main entry points: [`app/src/main/kotlin/pl/zse/bydgoszcz/elektron/presentation/transit/TransitViewModel.kt`](https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/presentation/transit/TransitViewModel.kt) (Transit screens), [`app/src/main/kotlin/pl/zse/bydgoszcz/elektron/domain/sync/SyncCoordinator.kt`](https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/domain/sync/SyncCoordinator.kt) (Sync coordinator), [`app/src/main/kotlin/pl/zse/bydgoszcz/elektron/ElektronActivity.kt`](https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/ElektronActivity.kt) (App shell), [`app/src/main/kotlin/pl/zse/bydgoszcz/elektron/data/repository/TimetableRepositoryImpl.kt`](https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/data/repository/TimetableRepositoryImpl.kt) (Timetable repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Student experience"]
  node_app["App shell"]
  node_setup["Class setup<br/>[SetupViewModel.kt]"]
  node_dashboard["Dashboard"]
  node_timetable["Timetable"]
  node_notes["Lesson notes"]
end

subgraph group_schooldata["School data"]
  node_substitutions["Substitutions"]
  node_announcements["Announcements"]
  node_school_sources["School sources"]
  node_timetable_repo["Timetable repository"]
end

subgraph group_transit["Transit"]
  node_transit_ui["Transit screens"]
  node_transit_journey["Journey search"]
  node_transit_live["Live transit"]
end

subgraph group_runtime["Sync and storage"]
  node_sync["Sync coordinator<br/>[SyncCoordinator.kt]"]
  node_worker["Sync worker<br/>[SyncWorker.kt]"]
  node_database[("Local database<br/>[AppDatabase.kt]")]
  node_settings["Settings"]
end

subgraph group_support["Notifications and extras"]
  node_widgets["Widgets and tile"]
  node_notifications["Notifications"]
  node_push["FCM push"]
  node_updates["In-app updates"]
end

node_student(("Student"))
node_bus["BUSearch"]
node_map["OpenStreetMap"]
node_github["GitHub releases"]

node_student -.->|"opens"| node_app
node_app -.->|"offers setup"| node_setup
node_student -.->|"views"| node_dashboard
node_student -.->|"views"| node_timetable
node_student -.->|"views"| node_substitutions
node_student -.->|"reads"| node_announcements
node_student -.->|"checks trips"| node_transit_ui
node_student -.->|"adds notes"| node_notes
node_timetable_repo -->|"fetches timetable"| node_school_sources
node_timetable_repo -->|"reads and writes"| node_database
node_worker -->|"runs sync"| node_sync
node_sync -->|"coordinates sync"| node_timetable_repo
node_sync -->|"emits alerts"| node_notifications
node_push -->|"requests sync"| node_sync
node_push -->|"uses sink"| node_notifications
node_transit_ui -.->|"searches journeys"| node_transit_journey
node_transit_ui -.->|"shows live data"| node_transit_live
node_transit_journey -.->|"gets journeys"| node_bus
node_transit_live -.->|"gets live vehicles"| node_bus
node_transit_ui -.->|"shows map"| node_map
node_student -.->|"uses shortcuts"| node_widgets
node_app -.->|"reads preferences"| node_settings
node_updates -->|"checks releases"| node_github

click node_app "https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/ElektronActivity.kt"
click node_setup "https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/presentation/setup/SetupViewModel.kt"
click node_dashboard "https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/presentation/dashboard/DashboardViewModel.kt"
click node_timetable "https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/presentation/timetable/TimetableViewModel.kt"
click node_substitutions "https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/presentation/substitutions/SubstitutionsViewModel.kt"
click node_announcements "https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/presentation/announcements/AnnouncementsViewModel.kt"
click node_school_sources "https://github.com/stasolejnik/elektron/tree/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/data/remote/sources"
click node_timetable_repo "https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/data/repository/TimetableRepositoryImpl.kt"
click node_transit_ui "https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/presentation/transit/TransitViewModel.kt"
click node_transit_journey "https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/data/repository/TransitJourneyRepository.kt"
click node_transit_live "https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/data/repository/TransitLiveRepository.kt"
click node_sync "https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/domain/sync/SyncCoordinator.kt"
click node_worker "https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/work/SyncWorker.kt"
click node_database "https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/data/local/AppDatabase.kt"
click node_settings "https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/data/repository/SettingsRepositoryImpl.kt"
click node_widgets "https://github.com/stasolejnik/elektron/tree/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/widget"
click node_notifications "https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/work/LocalNotificationSink.kt"
click node_push "https://github.com/stasolejnik/elektron/blob/main/app/src/gms/kotlin/pl/zse/bydgoszcz/elektron/work/ElektronFirebaseMessagingService.kt"
click node_updates "https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/data/update/UpdateRepositoryImpl.kt"
click node_notes "https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/presentation/timetable/LessonNotesViewModel.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_app,node_setup,node_dashboard,node_timetable,node_notes toneBlue
class node_substitutions,node_announcements,node_school_sources,node_timetable_repo toneAmber
class node_transit_ui,node_transit_journey,node_transit_live toneMint
class node_sync,node_worker,node_database,node_settings toneRose
class node_widgets,node_notifications,node_push,node_updates,node_student,node_bus,node_map,node_github toneIndigo
```

## Components

### Student experience

- [App shell](https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/ElektronActivity.kt): `app/src/main/kotlin/pl/zse/bydgoszcz/elektron/ElektronActivity.kt`
- [Class setup](https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/presentation/setup/SetupViewModel.kt): `app/src/main/kotlin/pl/zse/bydgoszcz/elektron/presentation/setup/SetupViewModel.kt`
- [Dashboard](https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/presentation/dashboard/DashboardViewModel.kt): `app/src/main/kotlin/pl/zse/bydgoszcz/elektron/presentation/dashboard/DashboardViewModel.kt`
- [Timetable](https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/presentation/timetable/TimetableViewModel.kt): `app/src/main/kotlin/pl/zse/bydgoszcz/elektron/presentation/timetable/TimetableViewModel.kt`
- [Lesson notes](https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/presentation/timetable/LessonNotesViewModel.kt): `app/src/main/kotlin/pl/zse/bydgoszcz/elektron/presentation/timetable/LessonNotesViewModel.kt`

### School data

- [Substitutions](https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/presentation/substitutions/SubstitutionsViewModel.kt): `app/src/main/kotlin/pl/zse/bydgoszcz/elektron/presentation/substitutions/SubstitutionsViewModel.kt`
- [Announcements](https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/presentation/announcements/AnnouncementsViewModel.kt): `app/src/main/kotlin/pl/zse/bydgoszcz/elektron/presentation/announcements/AnnouncementsViewModel.kt`
- [School sources](https://github.com/stasolejnik/elektron/tree/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/data/remote/sources): `app/src/main/kotlin/pl/zse/bydgoszcz/elektron/data/remote/sources`
- [Timetable repository](https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/data/repository/TimetableRepositoryImpl.kt): `app/src/main/kotlin/pl/zse/bydgoszcz/elektron/data/repository/TimetableRepositoryImpl.kt`

### Transit

- [Transit screens](https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/presentation/transit/TransitViewModel.kt): `app/src/main/kotlin/pl/zse/bydgoszcz/elektron/presentation/transit/TransitViewModel.kt`
- [Journey search](https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/data/repository/TransitJourneyRepository.kt): `app/src/main/kotlin/pl/zse/bydgoszcz/elektron/data/repository/TransitJourneyRepository.kt`
- [Live transit](https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/data/repository/TransitLiveRepository.kt): `app/src/main/kotlin/pl/zse/bydgoszcz/elektron/data/repository/TransitLiveRepository.kt`

### Sync and storage

- [Sync coordinator](https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/domain/sync/SyncCoordinator.kt): `app/src/main/kotlin/pl/zse/bydgoszcz/elektron/domain/sync/SyncCoordinator.kt`
- [Sync worker](https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/work/SyncWorker.kt): `app/src/main/kotlin/pl/zse/bydgoszcz/elektron/work/SyncWorker.kt`
- [Local database](https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/data/local/AppDatabase.kt): `app/src/main/kotlin/pl/zse/bydgoszcz/elektron/data/local/AppDatabase.kt`
- [Settings](https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/data/repository/SettingsRepositoryImpl.kt): `app/src/main/kotlin/pl/zse/bydgoszcz/elektron/data/repository/SettingsRepositoryImpl.kt`

### Notifications and extras

- [Widgets and tile](https://github.com/stasolejnik/elektron/tree/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/widget): `app/src/main/kotlin/pl/zse/bydgoszcz/elektron/widget`
- [Notifications](https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/work/LocalNotificationSink.kt): `app/src/main/kotlin/pl/zse/bydgoszcz/elektron/work/LocalNotificationSink.kt`
- [FCM push](https://github.com/stasolejnik/elektron/blob/main/app/src/gms/kotlin/pl/zse/bydgoszcz/elektron/work/ElektronFirebaseMessagingService.kt): `app/src/gms/kotlin/pl/zse/bydgoszcz/elektron/work/ElektronFirebaseMessagingService.kt`
- [In-app updates](https://github.com/stasolejnik/elektron/blob/main/app/src/main/kotlin/pl/zse/bydgoszcz/elektron/data/update/UpdateRepositoryImpl.kt): `app/src/main/kotlin/pl/zse/bydgoszcz/elektron/data/update/UpdateRepositoryImpl.kt`

### Other components

- **Student**
- **BUSearch**
- **OpenStreetMap**
- **GitHub releases**

## Connections

- Student → App shell: opens
- App shell → Class setup: offers setup
- Student → Dashboard: views
- Student → Timetable: views
- Student → Substitutions: views
- Student → Announcements: reads
- Student → Transit screens: checks trips
- Student → Lesson notes: adds notes
- Timetable repository → School sources: fetches timetable (evidence: `app/src/main/kotlin/pl/zse/bydgoszcz/elektron/data/repository/TimetableRepositoryImpl.kt`)
- Timetable repository → Local database: reads and writes (evidence: `app/src/main/kotlin/pl/zse/bydgoszcz/elektron/data/repository/TimetableRepositoryImpl.kt`)
- Sync worker → Sync coordinator: runs sync (evidence: `app/src/main/kotlin/pl/zse/bydgoszcz/elektron/work/SyncWorker.kt`)
- Sync coordinator → Timetable repository: coordinates sync (evidence: `app/src/main/kotlin/pl/zse/bydgoszcz/elektron/domain/sync/SyncCoordinator.kt`)
- Sync coordinator → Notifications: emits alerts (evidence: `app/src/main/kotlin/pl/zse/bydgoszcz/elektron/domain/sync/SyncCoordinator.kt`)
- FCM push → Sync coordinator: requests sync (evidence: `app/src/gms/kotlin/pl/zse/bydgoszcz/elektron/work/ElektronFirebaseMessagingService.kt`)
- FCM push → Notifications: uses sink (evidence: `app/src/gms/kotlin/pl/zse/bydgoszcz/elektron/work/ElektronFirebaseMessagingService.kt`)
- Transit screens → Journey search: searches journeys
- Transit screens → Live transit: shows live data
- Journey search → BUSearch: gets journeys
- Live transit → BUSearch: gets live vehicles
- Transit screens → OpenStreetMap: shows map
- Student → Widgets and tile: uses shortcuts
- App shell → Settings: reads preferences
- In-app updates → GitHub releases: checks releases (evidence: `app/src/main/kotlin/pl/zse/bydgoszcz/elektron/data/update/UpdateRepositoryImpl.kt`)
