From 81e04c245f17c7f2bddb2fe0e07db67366240df6 Mon Sep 17 00:00:00 2001 From: dadachi Date: Thu, 26 Mar 2026 09:22:37 +0900 Subject: [PATCH] Add CLAUDE.md and CHANGELOG.md Add CLAUDE.md with build commands, architecture overview, and development guidance for Claude Code. Add CHANGELOG.md documenting version history (1.0.0, 2.0.0, 2.0.1). Update .gitignore with Claude-related entries. Co-Authored-By: Claude Opus 4.6 (1M context) --- .gitignore | 19 +++++++++++++++ CHANGELOG.md | 39 +++++++++++++++++++++++++++++++ CLAUDE.md | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 124 insertions(+) create mode 100644 CHANGELOG.md create mode 100644 CLAUDE.md diff --git a/.gitignore b/.gitignore index c8c6967..6156213 100644 --- a/.gitignore +++ b/.gitignore @@ -60,3 +60,22 @@ app/release/* # Ignore kotlin 2.0 compiler files (.salive: session-is-alive) # https://github.com/JetBrains/kotlin/blob/ca34e5d2fd255ed0501bae4fae3d3691dc40d375/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/compilerRunner/GradleKotlinCompilerRunner.kt#L458 /.kotlin + +# Claude +# Personal Claude Code settings +.claude/settings.local.json +.claude/CLAUDE.local.md + +# Sensitive data and generated files within skills +.claude/skills/*/.venv/ +.claude/skills/*/venv/ +.claude/skills/*/node_modules/ +.claude/skills/*/data/ +.claude/skills/*/auth_info.json +.claude/skills/*/__pycache__/ + +# Logs and temporary files +.claude/logs/ +.claude/tmp/ +.claude/*.log + diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..f33b912 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,39 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +## [2.0.1] - 2025-06-24 + +### Changed +- Updated libraries and dependencies. + +## [2.0.0] - 2025-03-10 + +### Added +- NFC features for Number Tags (ItemTags): Write Application Info to a Tag, Read a Tag, Background Tag Reading. +- Generate QR Code Image for Number Tags (ItemTags) with a Centered Number. +- Onboarding screen with background tag reading support when not signed in. + +### Changed +- Updated navigation to use the Now in Android approach with type-safe navigation. +- Updated onboarding flow. + +### Fixed +- Fixed login flow. +- Fixed bottom navigation tab color not changing. +- Fixed test failures. + +## [1.0.0] - 2024-12-07 + +### Added +- Initial release. +- 100% Kotlin and 100% Jetpack Compose. +- User authentication: Sign Up, Sign In, Sign Out, Email Confirmation, Forgot Password. +- Input validation. +- CRUD operations for Shops. +- CRUD operations for Number Tags (ItemTags). +- Hilt dependency injection. +- Retrofit2 networking with Sandwich API response handling. +- Proto DataStore for user preferences. +- Dark mode support. +- Repository tests with Robolectric. diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..7e28a99 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,66 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview + +NativeAppTemplate-Free-Android is a native Android app (100% Kotlin, 100% Jetpack Compose) for managing walk-in customer waitlists using NFC tags and QR codes. It connects to a Rails backend API at `api.nativeapptemplate.com`. Inspired by [nowinandroid](https://github.com/android/nowinandroid). + +## Build & Run Commands + +```bash +# Build debug APK +./gradlew assembleDebug + +# Run all unit tests +./gradlew test + +# Run a single test class +./gradlew testDebugUnitTest --tests "com.nativeapptemplate.nativeapptemplatefree.ui.shops.ShopListViewModelTest" + +# Run a single test method +./gradlew testDebugUnitTest --tests "com.nativeapptemplate.nativeapptemplatefree.ui.shops.ShopListViewModelTest.stateIsInitiallyLoading" + +# Dependency analysis +./gradlew buildHealth +``` + +## Modules + +- **`:app`** — Main application module. Contains all UI, data, DI, networking, and navigation code. +- **`:model`** — Shared data model classes (serializable with kotlinx.serialization). No Android framework dependencies beyond the library plugin. + +## Architecture + +MVVM layered architecture following [Android Modern App Architecture](https://developer.android.com/topic/architecture#modern-app-architecture): + +- **UI Layer** (`ui/`): Jetpack Compose screens + Hilt-injected ViewModels. Each feature has its own `navigation/` subpackage defining routes and `NavGraphBuilder` extensions. +- **Data Layer** (`data/`): Repository interfaces + `*Impl` classes backed by Retrofit API interfaces. Each domain (shop, item_tag, login) has its own `*Api.kt`, `*Repository.kt`, and `*RepositoryImpl.kt`. +- **Network Layer** (`network/`): `AuthInterceptor` for token injection, `RequestHelper` for request construction. +- **DI** (`di/modules/`): Hilt modules — `NetModule` (Retrofit/OkHttp), `DataModule` (repository bindings), `DataStoreModule`, `DispatchersModule`, `CoroutineScopesModule`. +- **DataStore** (`datastore/`): Proto DataStore for user preferences. Proto definitions live in `app/src/main/proto/`. +- **Navigation**: `NatNavHost.kt` is the top-level nav graph. Three bottom-nav sections: Shops, Scan, Settings. Each section uses nested navigation graphs via `*BaseRoute`. + +## Key Patterns + +- **API response handling**: Uses [Sandwich](https://github.com/skydoves/sandwich) library (`ApiResponse` type) for Retrofit call adaptation. +- **Dependency injection**: Hilt with `@InstallIn(SingletonComponent::class)`. Repositories are bound via `@Binds` in `DataModule`. +- **Navigation routes**: Defined as extension functions on `NavGraphBuilder` (e.g., `shopListView()`, `navigateToShopDetail()`). Routes use type-safe navigation. +- **Proto DataStore**: User preferences and NFC scan state are persisted via Protocol Buffers (lite). + +## Testing + +- Tests use JUnit 4 with `kotlinx.coroutines.test` and Robolectric. +- `MainDispatcherRule` (in `testing/util/`) replaces the main dispatcher for coroutine tests. +- Test doubles: `Test*Repository` classes (in `testing/repository/`) implement repository interfaces for ViewModel testing. +- Demo data: `demo/` package contains `DemoAssetManager` and `Demo*Repository` classes that load JSON fixtures from `app/src/test/assets/`. +- JVM toolchain: Java 17. + +## Connecting to Local API + +In `app/build.gradle.kts`, swap the debug `buildConfigField` values: +```kotlin +buildConfigField("String", "DOMAIN","\"192.168.1.21\"") +buildConfigField("String", "PORT","\"3000\"") +buildConfigField("String", "SCHEME","\"http\"") +```