How lingion/sleepy works
Sleepy is an offline-first Android timetable app. The main workflow is to open a timetable view, inspect courses for the selected week, and manage timetable data; users can also import through a school system or file/text preview before committing, then export or display schedules in widgets. The graph includes timetable persistence, import/export, settings, widgets, and reminders as distinct product capabilities. Unsampled subsystem links are omitted or marked unverified; relationships shown are supported by the README or indexed source references.
Main entry points: ScheduleRepository.kt Schedule repository · AppDatabase.kt Room database · ImportSheet.kt Import preview · MainActivity.kt App entry
Components 28
App and schedules
- App entry
app/src/main/java/com/lingion/sleepy/MainActivity.kt - Navigation
app/src/main/java/com/lingion/sleepy/ui/nav/SleepyNavHost.kt - Schedule views
app/src/main/java/com/lingion/sleepy/ui/screen/schedule/ScheduleViewModel.kt - Course editing
app/src/main/java/com/lingion/sleepy/ui/screen/edit/AddCourseScreen.kt - Timetable management
app/src/main/java/com/lingion/sleepy/ui/screen/manage/ManagementPage.kt - Dialog actions
app/src/main/java/com/lingion/sleepy/ui/component/DialogActionButtons.kt
Import and export
- Import preview
app/src/main/java/com/lingion/sleepy/ui/screen/imports/ImportSheet.kt - School login
app/src/main/java/com/lingion/sleepy/ui/screen/imports/JwWebViewLoginScreen.kt - School parsers
app/src/main/java/com/lingion/sleepy/data/jw/JwParserRegistry.kt - Format parsers
app/src/main/java/com/lingion/sleepy/data/parser/ScheduleParser.kt - Schedule export
app/src/main/java/com/lingion/sleepy/data/parser/ScheduleExporter.kt
Schedule data
- Schedule repository
app/src/main/java/com/lingion/sleepy/data/repository/ScheduleRepository.kt - Room database
app/src/main/java/com/lingion/sleepy/data/AppDatabase.kt - Course records
app/src/main/java/com/lingion/sleepy/data/entity/CourseEntity.kt - Timetable records
app/src/main/java/com/lingion/sleepy/data/entity/TimeTableEntity.kt - Period tables
app/src/main/java/com/lingion/sleepy/data/entity/PeriodTableEntity.kt - Undo and redo
app/src/main/java/com/lingion/sleepy/data/undo/UndoManager.kt - Period calculations
app/src/main/java/com/lingion/sleepy/util/TimeTableUtils.kt
Widgets and reminders
- Widget updates
app/src/main/java/com/lingion/sleepy/widget/WidgetUpdater.kt - Schedule widgets
app/src/main/java/com/lingion/sleepy/widget/TodayWidget.kt - Course reminders
app/src/main/java/com/lingion/sleepy/widget/notification/CourseNotificationScheduler.kt - Live course card
app/src/main/java/com/lingion/sleepy/widget/notification/FluidCloudService.kt
Settings and calendar
- App preferences
app/src/main/java/com/lingion/sleepy/util/AppPrefs.kt - System calendar
app/src/main/java/com/lingion/sleepy/data/calendar/SystemCalendarManager.kt
Other components
- Student
- Android calendar
- School system
- Device user
Connections 27
- Student → App entry: opens
README.md - App entry → Navigation: hosts
app/src/main/java/com/lingion/sleepy/MainActivity.kt - Navigation → Schedule views: routes
- Navigation → Timetable management: routes
app/src/main/java/com/lingion/sleepy/MainActivity.kt - Timetable management → Import preview: opens import
- Timetable management → Course editing: opens editor
app/src/main/java/com/lingion/sleepy/MainActivity.kt - School login → School system: requests schedule
README.md - School login → School parsers: parses response
- Import preview → Format parsers: parses pasted data
README.md - Import preview → Schedule repository: commits confirmed import
- Import preview → School login: starts school import
README.md - Schedule export → Device user: shares export
README.md - Schedule views → Schedule repository: observes schedules
app/src/main/java/com/lingion/sleepy/ui/screen/schedule/ScheduleViewModel.kt - Schedule repository → Room database: reads and writes
app/src/main/java/com/lingion/sleepy/data/repository/ScheduleRepository.kt - Room database → Course records: stores
app/src/main/java/com/lingion/sleepy/data/AppDatabase.kt - Room database → Timetable records: stores
app/src/main/java/com/lingion/sleepy/data/AppDatabase.kt - Room database → Period tables: stores
app/src/main/java/com/lingion/sleepy/data/AppDatabase.kt - Schedule repository → Undo and redo: captures edits
app/src/main/java/com/lingion/sleepy/data/repository/ScheduleRepository.kt - Schedule views → Period calculations: resolves periods
app/src/main/java/com/lingion/sleepy/ui/screen/schedule/ScheduleViewModel.kt - Schedule repository → Widget updates: notifies changes
app/src/main/java/com/lingion/sleepy/data/repository/ScheduleRepository.kt - Widget updates → Schedule widgets: refreshes
- Schedule repository → Course reminders: reschedules reminders
app/src/main/java/com/lingion/sleepy/data/repository/ScheduleRepository.kt - Course reminders → Live course card: starts service
app/src/main/java/com/lingion/sleepy/widget/notification/FluidCloudService.kt - App entry → App preferences: reads settings
app/src/main/java/com/lingion/sleepy/MainActivity.kt - System calendar → Android calendar: imports and exports events
- System calendar → Room database: records imports
app/src/main/java/com/lingion/sleepy/data/calendar/SystemCalendarManager.kt - Dialog actions → Student: confirms actions