How mrpapermoon/sharethebutton works
Share the Button is a Compose Multiplatform app whose Android host lets a guest create a personalized button, save it locally, and publish an invitation. The invitation screen presents a link and QR code, with copy and Android sharing actions. Room stores buttons and Preferences DataStore stores the guest session; publication uses a build-selected backend. Incoming invitations, QR scanning, and adding received buttons are documented as unfinished. The main workflow and platform branches are documented in the README; unsampled screen implementations are represented by their exact source directories.
Main entry points: ButtonRepositoryImpl.kt Button repository · share Invitation screen · create Button wizard · ButtonRemoteDataSource.kt Invitation source
Components 21
App host
- Android host
app/src/main/java/mrpapermoon/customebutton/CustomButtonActivity.kt - System clipboard
shared/src/androidMain/kotlin/mrpapermoon/customebutton/repository/AndroidClipboardRepository.kt - Android share sheet
shared/src/androidMain/kotlin/mrpapermoon/customebutton/usecase/AndroidShareInvitationUseCase.kt - QR generator
shared/src/androidMain/kotlin/mrpapermoon/customebutton/qr/ZxingQrGenerator.kt
User experience
- Screen navigation
shared/src/commonMain/kotlin/mrpapermoon/customebutton/CustomeButtonNavigation.kt - Guest entry
shared/src/commonMain/kotlin/mrpapermoon/customebutton/ui/welcome - Button list
shared/src/commonMain/kotlin/mrpapermoon/customebutton/ui/home - Button wizard
shared/src/commonMain/kotlin/mrpapermoon/customebutton/ui/create - Button draft
shared/src/commonMain/kotlin/mrpapermoon/customebutton/ui/create/draft - Invitation screen
shared/src/commonMain/kotlin/mrpapermoon/customebutton/ui/share
Application services
- Button model
shared/src/commonMain/kotlin/mrpapermoon/customebutton/entity/SharedButton.kt - Button repository
shared/src/commonMain/kotlin/mrpapermoon/customebutton/data/ButtonRepositoryImpl.kt - Guest session
shared/src/commonMain/kotlin/mrpapermoon/customebutton/data/SessionRepositoryImpl.kt - Share invitation
shared/src/commonMain/kotlin/mrpapermoon/customebutton/usecase/ShareInvitationUseCase.kt
Local persistence
- Button database
shared/src/commonMain/kotlin/mrpapermoon/customebutton/data/database/ButtonDatabase.kt - Session preferences
shared/src/commonMain/kotlin/mrpapermoon/customebutton/storage/LightDataStorage.kt
Invitation backends
- Invitation source
shared/src/commonMain/kotlin/mrpapermoon/customebutton/data/ButtonRemoteDataSource.kt - Debug local backend
app/src/debug/kotlin/mrpapermoon/customebutton/data/StubButtonRemoteDataSource.kt - Firestore backend
shared/src/commonMain/kotlin/mrpapermoon/customebutton/data/FirestoreButtonDataSource.kt
Other components
- Guest user
- Firebase services
Connections 21
- Guest user → Android host: opens app
- Android host → Screen navigation: hosts screens
app/src/main/java/mrpapermoon/customebutton/CustomButtonActivity.kt - Screen navigation → Guest entry: routes to
- Guest user → Guest entry: enters as guest
- Guest user → Button wizard: creates button
- Button wizard → Button draft: edits draft
- Button wizard → Button repository: saves button
- Button list → Button repository: observes buttons
- Button repository → Button database: reads and writes
- Guest entry → Guest session: checks session
- Guest session → Session preferences: reads and writes
shared/src/commonMain/kotlin/mrpapermoon/customebutton/data/SessionRepositoryImpl.kt - Button repository → Invitation source: publishes button
shared/src/commonMain/kotlin/mrpapermoon/customebutton/data/ButtonRepositoryImpl.kt - Invitation source → Debug local backend: selects in debug
app/src/debug/kotlin/mrpapermoon/customebutton/data/StubButtonRemoteDataSource.kt - Invitation source → Firestore backend: selects in release
- Firestore backend → Firebase services: uses services
- Button repository → Invitation screen: returns token
- Guest user → Invitation screen: views invitation
- Invitation screen → Share invitation: requests sharing
shared/src/commonMain/kotlin/mrpapermoon/customebutton/ui/share/ShareButtonViewModel.kt - Invitation screen → QR generator: renders QR
- Guest user → System clipboard: copies link
- Guest user → Android share sheet: sends link