app/: Android application (Jetpack Compose UI, navigation, settings).feature-chat/: Chat feature UI and related Compose components (includessrc/main/assets/).data/: Room database, repositories, models, and skill/matching logic.network/: Networking layer (OkHttp, API clients).core/: Shared utilities and small cross-module helpers.- Sources live in
*/src/main/java/…; resources inapp/src/main/res/…. - Tests (currently minimal) live in
app/src/test/…andapp/src/androidTest/….
Use the Gradle wrapper from the repo root (Windows: gradlew.bat, macOS/Linux: ./gradlew):
./gradlew :app:assembleDebug— build a debug APK../gradlew :app:installDebug— install on a connected device/emulator../gradlew testDebugUnitTest— run JVM unit tests../gradlew connectedDebugAndroidTest— run instrumentation + Compose UI tests../gradlew lint— run Android Lint checks.
Dependencies are managed via the version catalog: gradle/libs.versions.toml.
- Kotlin + Compose, 4-space indentation, no tabs. Prefer Android Studio’s default Kotlin formatter.
@Composablefunctions usePascalCase(e.g.,SkillScreen); non-UI functions usecamelCase.- Types use
PascalCase; constants useUPPER_SNAKE_CASE. - Keep module namespaces consistent (e.g.,
com.tchat.wanxiaotinapp,com.tchat.dataindata).
- Unit tests: JUnit4 in
app/src/test. - Instrumentation/UI: AndroidX test runner + Espresso/Compose UI tests in
app/src/androidTest. - Name tests
*Test.ktand mirror production package paths (e.g.,app/src/test/java/com/tchat/…).
- Commit messages in history are short and action-focused (often starting with
修复…,更新…,添加…); follow the same style and keep commits scoped. - PRs should include: what/why, steps to verify, and screenshots for UI changes (phone + tablet where applicable). Link related issues when available.
- Never commit API keys or personal tokens. Use in-app provider settings or local-only files (e.g.,
local.properties,~/.gradle/gradle.properties). - Ensure
local.propertiespoints to a valid Android SDK installation before building.