This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
# Build the project
./gradlew build
# Install debug APK to connected device/emulator
./gradlew installDebug
# Run unit tests
./gradlew test
# Run instrumented (on-device) tests
./gradlew connectedAndroidTest
# Clean build artifacts
./gradlew cleanThis is an Android app (Kotlin + Jetpack Compose) that generates random motivational "Pep Talks" with 104,000+ combinations. It follows MVVM with a Repository pattern.
Data Layer (app/src/main/java/com/example/peptalkgenerator/data/):
- Room database backed by a pre-populated SQLite file at
app/src/main/assets/database/pepTalks.db - Two entities:
Phrase(source phrases by type) andPepTalk(saved/favorited talks) PepTalkRepositoryis the single data access point — it orchestrates talk generation by selecting 4 random phrases (greeting + first + second + ending) fromPhraseDaoand saving them viaPepTalkDao- Database is initialized in
PepTalkApplicationusingcreateFromAsset
ViewModel Layer (model/):
- One ViewModel per screen, injected via
ViewModelProvider.Factorydefined inPepTalkApplication - State exposed as
StateFlow/Flowcollected in Compose
UI Layer (ui/):
- Jetpack Compose with Material3
PepTalkApp.ktsets up the scaffold, drawer, and nav hostNavGraph.ktdefines all routes and passes ViewModels to screens- Navigation uses a
DrawerState-based navigation drawer (Home, New Pep Talk, Favorites)
- User taps "New Pep Talk" →
PepTalkScreenViewModelcallsrepository.generatePepTalk() - Repository queries 4 random phrases by type from
PhraseDao, combines them, and inserts the result viaPepTalkDao - ViewModel exposes the current talk as
StateFlow<PepTalk?>, UI recomposes
- Language: Kotlin
- UI: Jetpack Compose + Material3
- Database: Room 2.5.2 (KSP annotation processing)
- Async: Coroutines +
Flow - Navigation: Navigation Compose
- Min SDK: 24 | Target/Compile SDK: 33 | Java: 21