How zeppyx13/snapwake-expo works
SnapWake is an alarm app whose wake-up flow requires the user to scan a configured object. Users create or edit alarms, then the app supports waking through object detection and presents a wake result; authentication and account features support that experience. The sampled API client also exposes subscriptions, custom alarm sounds, logs, and gamification/leaderboard operations, so these remain visible as product capabilities. The Android alarm implementation is represented separately: available excerpts establish only a limited relationship within it, so unverified native dispatch links are omitted.
Main entry points: scan.tsx Object scan · api.ts API client · [id].tsx Create and edit alarms · use-auth.tsx Authentication state
Components 23
Account and engagement
- Sign in and register
src/app/(auth)/register.tsx - Authentication state
src/hooks/use-auth.tsx - Profile and plans
src/app/(tabs)/profile.tsx - Leaderboard
src/app/leaderboard.tsx - Gamification mapping
src/utils/gamification.ts
Alarm setup
- Alarm form
src/components/alarm/AlarmForm.tsx - Create and edit alarms
src/app/edit-alarm/[id].tsx - Sound selection
src/components/alarm/AlarmSoundSelector.tsx - Alarm data types
src/types/alarm.ts - Alarm conversion
src/utils/alarm.ts
Wake experience
- Object scan
src/app/scan.tsx - Detection status
src/components/DetectionStatusCard.tsx - Math challenge
src/components/MathChallengeCard.tsx - Wake result storage
src/utils/storage.ts - Wake result screen
src/app/wake-result.tsx - Alarm history
src/app/(tabs)/history.tsx
Services and platform
- API client
src/services/api.ts - SnapWake backend
- Native alarm bridge
src/native/native-alarm.ts - Android alarm module
android/app/src/main/java/com/anonymous/SnapWake/nativealarm/NativeAlarmModule.kt - Alarm ringing service
android/app/src/main/java/com/anonymous/SnapWake/nativealarm/NativeAlarmRingingService.kt - Native alarm constants
android/app/src/main/java/com/anonymous/SnapWake/nativealarm/NativeAlarmConstants.kt
Other components
- User
Connections 25
- User → Sign in and register: signs in
src/app/(auth)/register.tsx - Sign in and register → Authentication state: uses auth state
src/app/(auth)/register.tsx - Authentication state → API client: authenticates
src/hooks/use-auth.tsx - Authentication state → Wake result storage: persists credentials
src/hooks/use-auth.tsx - User → Create and edit alarms: configures alarm
src/app/edit-alarm/[id].tsx - Create and edit alarms → Alarm form: renders form
src/app/edit-alarm/[id].tsx - Create and edit alarms → API client: loads and saves
src/app/edit-alarm/[id].tsx - Create and edit alarms → Alarm conversion: converts alarm
src/app/edit-alarm/[id].tsx - Alarm form → Sound selection: offers sound selection
src/components/alarm/AlarmForm.tsx - Sound selection → API client: manages custom sounds
src/components/alarm/AlarmSoundSelector.tsx - Alarm conversion → Alarm data types: uses alarm types
src/utils/alarm.ts - User → Object scan: completes wake scan
src/app/scan.tsx - Object scan → Detection status: shows detection status
src/app/scan.tsx - Object scan → Math challenge: presents challenge
src/app/scan.tsx - Object scan → API client: submits wake data
src/app/scan.tsx - Object scan → Native alarm bridge: uses alarm bridge
src/app/scan.tsx - Object scan → Wake result storage: saves wake result
src/utils/storage.ts - Wake result storage → Wake result screen: hands off result
src/utils/storage.ts - User → Alarm history: views history
- User → Profile and plans: views account
- User → Leaderboard: views rankings
- Profile and plans → Gamification mapping: formats statistics
src/app/(tabs)/profile.tsx - API client → Gamification mapping: normalizes responses
src/services/api.ts - API client → SnapWake backend: sends HTTP requests
src/services/api.ts - Alarm ringing service → Native alarm constants: uses constants
android/app/src/main/java/com/anonymous/SnapWake/nativealarm/NativeAlarmRingingService.kt