Skip to content

Commit 4c3af65

Browse files
committed
Added all mds for claude
1 parent f7d32f3 commit 4c3af65

9 files changed

Lines changed: 457 additions & 0 deletions

File tree

β€Žfeature/apps/CLAUDE.mdβ€Ž

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# CLAUDE.md - Apps Feature
2+
3+
## Purpose
4+
5+
Manages installed applications. Lists all apps installed through GitHub Store, allows launching them, and checks for available updates. Primarily relevant on **Android** (apps section is hidden on Desktop).
6+
7+
## Module Structure
8+
9+
```
10+
feature/apps/
11+
β”œβ”€β”€ domain/
12+
β”‚ └── repository/AppsRepository.kt # Installed apps, launch, update check
13+
β”œβ”€β”€ data/
14+
β”‚ β”œβ”€β”€ di/SharedModule.kt # Koin: appsModule
15+
β”‚ └── repository/AppsRepositoryImpl.kt # Implementation using core InstalledAppsRepository
16+
└── presentation/
17+
β”œβ”€β”€ AppsViewModel.kt # State management for installed apps list
18+
β”œβ”€β”€ AppsState.kt # apps list, loading, error
19+
β”œβ”€β”€ AppsAction.kt # Refresh, OpenApp, CheckUpdates, clicks
20+
β”œβ”€β”€ AppsEvent.kt # One-off events
21+
β”œβ”€β”€ AppsRoot.kt # Main composable (apps list)
22+
└── components/ # App item cards, update badges
23+
```
24+
25+
## Key Interfaces
26+
27+
```kotlin
28+
interface AppsRepository {
29+
suspend fun getApps(): Flow<List<InstalledApp>>
30+
suspend fun openApp(installedApp: InstalledApp, onCantLaunchApp: () -> Unit = {})
31+
suspend fun getLatestRelease(owner: String, repo: String): GithubRelease?
32+
}
33+
```
34+
35+
## Navigation
36+
37+
Route: `GithubStoreGraph.AppsScreen` (data object, no params)
38+
39+
## Implementation Notes
40+
41+
- Uses `InstalledAppsRepository` and `SyncInstalledAppsUseCase` from core/domain
42+
- `openApp()` uses `AppLauncher` from core/domain to launch the installed app
43+
- `getLatestRelease()` checks if a newer version is available
44+
- Platform-specific: `PackageMonitor` and `Installer` handle Android package management
45+
- The apps section in the home screen bottom nav is only visible on `Platform.ANDROID`

β€Žfeature/auth/CLAUDE.mdβ€Ž

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# CLAUDE.md - Auth Feature
2+
3+
## Purpose
4+
5+
GitHub OAuth authentication using the **device flow**. Users authenticate by visiting a URL and entering a code displayed in the app. No browser redirect needed, making it suitable for both Android and Desktop.
6+
7+
## Module Structure
8+
9+
```
10+
feature/auth/
11+
β”œβ”€β”€ domain/
12+
β”‚ └── repository/AuthenticationRepository.kt # Device flow interface
13+
β”œβ”€β”€ data/
14+
β”‚ β”œβ”€β”€ di/SharedModule.kt # Koin: authModule
15+
β”‚ β”œβ”€β”€ repository/AuthenticationRepositoryImpl.kt # OAuth device flow implementation
16+
β”‚ └── network/GitHubAuthApi.kt # GitHub OAuth API endpoints
17+
└── presentation/
18+
β”œβ”€β”€ AuthenticationViewModel.kt # Manages device flow lifecycle
19+
β”œβ”€β”€ AuthenticationState.kt # Code, URL, loading, error
20+
β”œβ”€β”€ AuthenticationAction.kt # StartAuth, Cancel, etc.
21+
β”œβ”€β”€ AuthenticationEvent.kt # One-off events
22+
β”œβ”€β”€ AuthenticationRoot.kt # UI: displays code + verification URL
23+
└── components/ # Auth UI components
24+
```
25+
26+
## Key Interfaces
27+
28+
```kotlin
29+
interface AuthenticationRepository {
30+
val accessTokenFlow: Flow<String?>
31+
suspend fun startDeviceFlow(): GithubDeviceStart
32+
suspend fun awaitDeviceToken(start: GithubDeviceStart): GithubDeviceTokenSuccess
33+
}
34+
```
35+
36+
## Navigation
37+
38+
Route: `GithubStoreGraph.AuthenticationScreen` (data object, no params)
39+
40+
## Implementation Notes
41+
42+
- Uses GitHub's [device authorization flow](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/authorizing-oauth-apps#device-flow)
43+
- `startDeviceFlow()` returns a user code + verification URL to display
44+
- `awaitDeviceToken()` polls GitHub until the user completes verification
45+
- Token is stored via `TokenStore` in core/data (DataStore-backed)
46+
- `GITHUB_CLIENT_ID` must be set in `local.properties` for builds
47+
- `accessTokenFlow` is observed app-wide by `MainViewModel` for auth state

β€Žfeature/details/CLAUDE.mdβ€Ž

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# CLAUDE.md - Details Feature
2+
3+
## Purpose
4+
5+
Repository detail screen. Displays full info for a GitHub repository including owner profile, stats, releases with download links, readme rendering, and installation/update flow. This is the most complex feature module (~27 presentation files).
6+
7+
## Module Structure
8+
9+
```
10+
feature/details/
11+
β”œβ”€β”€ domain/
12+
β”‚ β”œβ”€β”€ model/
13+
β”‚ β”‚ β”œβ”€β”€ ReleaseCategory.kt # Release filtering categories
14+
β”‚ β”‚ └── RepoStats.kt # Stars, forks, open issues
15+
β”‚ └── repository/DetailsRepository.kt # Repo, releases, readme, stats, user profile
16+
β”œβ”€β”€ data/
17+
β”‚ β”œβ”€β”€ di/SharedModule.kt # Koin: detailsModule
18+
β”‚ β”œβ”€β”€ repository/DetailsRepositoryImpl.kt # API calls + readme localization
19+
β”‚ β”œβ”€β”€ readme/ReadmeLocalizationHelper.kt # Find readme in user's language
20+
β”‚ β”œβ”€β”€ dto/ # Network DTOs
21+
β”‚ └── mappers/ # DTO β†’ domain model mappers
22+
└── presentation/
23+
β”œβ”€β”€ DetailsViewModel.kt # State management for detail screen
24+
β”œβ”€β”€ DetailsState.kt # Repo, releases, readme, download progress, etc.
25+
β”œβ”€β”€ DetailsAction.kt # Load, download, install, favourite, star, etc.
26+
β”œβ”€β”€ DetailsEvent.kt # Navigation, toast events
27+
β”œβ”€β”€ DetailsRoot.kt # Main composable
28+
β”œβ”€β”€ model/
29+
β”‚ β”œβ”€β”€ DownloadStage.kt # Download progress tracking
30+
β”‚ β”œβ”€β”€ InstallLogItem.kt # Installation log entries
31+
β”‚ └── LogResult.kt # Log result types
32+
β”œβ”€β”€ components/
33+
β”‚ β”œβ”€β”€ AppHeader.kt # App icon, name, developer
34+
β”‚ β”œβ”€β”€ SmartInstallButton.kt # Context-aware install/update/open button
35+
β”‚ β”œβ”€β”€ StatItem.kt # Individual stat display
36+
β”‚ β”œβ”€β”€ VersionPicker.kt # Release version selector
37+
β”‚ └── sections/
38+
β”‚ β”œβ”€β”€ About.kt # Description & topics
39+
β”‚ β”œβ”€β”€ Header.kt # Top header section
40+
β”‚ β”œβ”€β”€ Logs.kt # Installation/download logs
41+
β”‚ β”œβ”€β”€ Owner.kt # Repository owner info
42+
β”‚ β”œβ”€β”€ Stats.kt # Stars, forks, issues
43+
β”‚ └── WhatsNew.kt # Release changelog
44+
β”œβ”€β”€ states/ErrorState.kt # Error display composable
45+
└── utils/
46+
β”œβ”€β”€ LocalTopbarLiquidState.kt
47+
β”œβ”€β”€ LogResultAsText.kt # Log result formatting
48+
β”œβ”€β”€ MarkdownImageTransformer.kt # Transform relative image URLs
49+
β”œβ”€β”€ MarkdownUtils.kt # Markdown preprocessing
50+
β”œβ”€β”€ SystemArchitecture.kt # Platform architecture detection
51+
└── isLiquidFrostAvailable.kt
52+
```
53+
54+
## Key Interfaces
55+
56+
```kotlin
57+
interface DetailsRepository {
58+
suspend fun getRepositoryById(id: Long): GithubRepoSummary
59+
suspend fun getRepositoryByOwnerAndName(owner: String, name: String): GithubRepoSummary
60+
suspend fun getLatestPublishedRelease(owner: String, repo: String, defaultBranch: String): GithubRelease?
61+
suspend fun getAllReleases(owner: String, repo: String, defaultBranch: String): List<GithubRelease>
62+
suspend fun getReadme(owner: String, repo: String, defaultBranch: String): Triple<ReadmeContent, LanguageCode?, ReadmePath>?
63+
suspend fun getRepoStats(owner: String, repo: String): RepoStats
64+
suspend fun getUserProfile(username: String): GithubUserProfile
65+
}
66+
```
67+
68+
## Navigation
69+
70+
Route: `GithubStoreGraph.DetailsScreen(repositoryId: Long, owner: String, repo: String)`
71+
72+
Can be reached via repo ID or owner+name (for deep links). Falls back to owner+name lookup if `repositoryId == -1`.
73+
74+
## Implementation Notes
75+
76+
- Readme supports localization: `ReadmeLocalizationHelper` tries to find readme in user's language first
77+
- Markdown rendering uses `multiplatform-markdown-renderer` with custom `MarkdownImageTransformer` for relative URLs
78+
- Download flow tracks stages via `DownloadStage` (idle β†’ downloading β†’ installing β†’ done)
79+
- `SmartInstallButton` changes behavior based on installed/update-available/not-installed state
80+
- Version picker allows selecting specific releases for download
81+
- Integrates with `FavouritesRepository`, `StarredRepository`, `InstalledAppsRepository` from core
82+
- Uses `Downloader` and `Installer` interfaces from core/domain for platform-specific download/install
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# CLAUDE.md - Developer Profile Feature
2+
3+
## Purpose
4+
5+
Displays a GitHub developer/user profile. Shows user info (avatar, bio, stats), their repositories with filtering and sorting, and follower/following counts. Reached by clicking on a developer's name from any repository card.
6+
7+
## Module Structure
8+
9+
```
10+
feature/dev-profile/
11+
β”œβ”€β”€ domain/
12+
β”‚ β”œβ”€β”€ model/
13+
β”‚ β”‚ β”œβ”€β”€ DeveloperProfile.kt # User profile data model
14+
β”‚ β”‚ β”œβ”€β”€ DeveloperRepository.kt # User's repository model
15+
β”‚ β”‚ β”œβ”€β”€ RepoFilterType.kt # Filter: All, Sources, Forks, etc.
16+
β”‚ β”‚ └── RepoSortType.kt # Sort: Stars, Name, Updated, etc.
17+
β”‚ └── repository/DeveloperProfileRepository.kt # Profile + repos
18+
β”œβ”€β”€ data/
19+
β”‚ β”œβ”€β”€ di/SharedModule.kt # Koin: devProfileModule
20+
β”‚ β”œβ”€β”€ repository/DeveloperProfileRepositoryImpl.kt
21+
β”‚ β”œβ”€β”€ dto/ # Network DTOs
22+
β”‚ └── mappers/ # DTO β†’ domain model mappers
23+
└── presentation/
24+
β”œβ”€β”€ DeveloperProfileViewModel.kt # Profile loading, repo filtering/sorting
25+
β”œβ”€β”€ DeveloperProfileState.kt # profile, repos, filters, loading
26+
β”œβ”€β”€ DeveloperProfileAction.kt # Load, filter, sort, click actions
27+
β”œβ”€β”€ DeveloperProfileEvent.kt # One-off events
28+
β”œβ”€β”€ DeveloperProfileRoot.kt # Main composable
29+
└── components/ # Profile header, repo list, filter controls
30+
```
31+
32+
## Key Interfaces
33+
34+
```kotlin
35+
interface DeveloperProfileRepository {
36+
suspend fun getDeveloperProfile(username: String): Result<DeveloperProfile>
37+
suspend fun getDeveloperRepositories(username: String): Result<List<DeveloperRepository>>
38+
}
39+
```
40+
41+
## Navigation
42+
43+
Route: `GithubStoreGraph.DeveloperProfileScreen(username: String)`
44+
45+
## Implementation Notes
46+
47+
- Profile and repos are fetched in parallel on load
48+
- Client-side filtering by `RepoFilterType` (All, Sources, Forks) and sorting by `RepoSortType` (Stars, Name, Updated)
49+
- Both API calls return `Result<T>` for error handling
50+
- Reached from repository cards throughout the app (home, search, details, favourites, starred)

β€Žfeature/favourites/CLAUDE.mdβ€Ž

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# CLAUDE.md - Favourites Feature
2+
3+
## Purpose
4+
5+
Displays the user's locally saved favorite repositories. This is a **presentation-only** feature with no domain or data layer -- it uses `FavouritesRepository` from `core/domain` directly.
6+
7+
## Module Structure
8+
9+
```
10+
feature/favourites/
11+
└── presentation/
12+
β”œβ”€β”€ FavouritesViewModel.kt # Observes favourites, handles remove
13+
β”œβ”€β”€ FavouritesState.kt # favourites list, loading
14+
β”œβ”€β”€ FavouritesAction.kt # RemoveFavourite, click actions
15+
β”œβ”€β”€ FavouritesRoot.kt # Main composable (list of favourites)
16+
β”œβ”€β”€ model/FavouriteRepository.kt # UI model for display
17+
β”œβ”€β”€ mappers/FavouriteRepositoryMapper.kt # Domain β†’ UI model mapper
18+
└── components/FavouriteRepositoryItem.kt # Individual favourite card
19+
```
20+
21+
## Key Dependencies
22+
23+
- `FavouritesRepository` (from `core/domain`) - CRUD operations for favourites
24+
- Favourites are stored locally in Room database (`FavoriteRepoDao` in `core/data`)
25+
26+
## Navigation
27+
28+
Route: `GithubStoreGraph.FavouritesScreen` (data object, no params)
29+
30+
## Implementation Notes
31+
32+
- No network calls -- all data is local (Room database)
33+
- Uses a presentation-layer `FavouriteRepository` UI model mapped from the domain `FavoriteRepo`
34+
- Adding to favourites happens in other features (home, details, search); this feature only displays and removes
35+
- The Koin module for this feature is registered in `composeApp/.../app/di/ViewModelsModule.kt` since there's no `data/di/` layer

β€Žfeature/home/CLAUDE.mdβ€Ž

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# CLAUDE.md - Home Feature
2+
3+
## Purpose
4+
5+
Main discovery screen of the app. Displays repositories in three categories: **Trending**, **Hot Releases**, and **Most Popular**. Supports infinite-scroll pagination and integrates with installed apps, favourites, and starred status.
6+
7+
## Module Structure
8+
9+
```
10+
feature/home/
11+
β”œβ”€β”€ domain/
12+
β”‚ β”œβ”€β”€ model/HomeCategory.kt # Enum: TRENDING, HOT_RELEASE, MOST_POPULAR
13+
β”‚ └── repository/HomeRepository.kt # Paginated flows per category
14+
β”œβ”€β”€ data/
15+
β”‚ β”œβ”€β”€ di/SharedModule.kt # Koin: homeModule
16+
β”‚ β”œβ”€β”€ repository/HomeRepositoryImpl.kt # GitHub API calls with caching & pagination
17+
β”‚ β”œβ”€β”€ data_source/CachedRepositoriesDataSource.kt # Per-category cache (7-day expiry)
18+
β”‚ β”œβ”€β”€ dto/ # Network DTOs
19+
β”‚ └── mappers/ # DTO β†’ domain model mappers
20+
└── presentation/
21+
β”œβ”€β”€ HomeViewModel.kt # State management, pagination logic
22+
β”œβ”€β”€ HomeState.kt # repos, isLoading, category, hasMorePages, etc.
23+
β”œβ”€β”€ HomeAction.kt # Refresh, Retry, LoadMore, SwitchCategory, clicks
24+
β”œβ”€β”€ HomeEvent.kt # OnScrollToListTop
25+
β”œβ”€β”€ HomeRoot.kt # Main composable (staggered grid + filter chips)
26+
β”œβ”€β”€ components/HomeFilterChips.kt # Category filter chip row
27+
β”œβ”€β”€ locals/LocalHomeTopBarLiquid.kt
28+
└── utils/HomeCategoryMapper.kt # Map HomeCategory to display strings
29+
```
30+
31+
## Key Interfaces
32+
33+
```kotlin
34+
interface HomeRepository {
35+
fun getTrendingRepositories(page: Int): Flow<PaginatedDiscoveryRepositories>
36+
fun getHotReleaseRepositories(page: Int): Flow<PaginatedDiscoveryRepositories>
37+
fun getMostPopular(page: Int): Flow<PaginatedDiscoveryRepositories>
38+
}
39+
```
40+
41+
## ViewModel Dependencies
42+
43+
`HomeViewModel` depends on: `HomeRepository`, `InstalledAppsRepository`, `Platform`, `SyncInstalledAppsUseCase`, `FavouritesRepository`, `StarredRepository`, `GitHubStoreLogger`
44+
45+
## Navigation
46+
47+
Route: `GithubStoreGraph.HomeScreen` (data object, no params)
48+
49+
## Implementation Notes
50+
51+
- Uses `Semaphore` in `HomeRepositoryImpl` for concurrent request control
52+
- Cache is per-category with 7-day TTL in `CachedRepositoriesDataSource`
53+
- Pagination uses `nextPageIndex` tracking; deduplicates by `fullName`
54+
- Apps section visibility is platform-dependent (`Platform.ANDROID` only)
55+
- Observes installed apps, favourites, and starred repos reactively to update status badges
56+
- State uses `onStart` + `stateIn(WhileSubscribed)` for lazy initialization

β€Žfeature/search/CLAUDE.mdβ€Ž

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# CLAUDE.md - Search Feature
2+
3+
## Purpose
4+
5+
Repository search with advanced filters. Users can search GitHub repositories by query and filter by platform (Android, Windows, macOS, Linux), programming language, and sort order. Supports paginated results.
6+
7+
## Module Structure
8+
9+
```
10+
feature/search/
11+
β”œβ”€β”€ domain/
12+
β”‚ β”œβ”€β”€ model/
13+
β”‚ β”‚ β”œβ”€β”€ SearchPlatform.kt # All, Android, Windows, macOS, Linux
14+
β”‚ β”‚ β”œβ”€β”€ ProgrammingLanguage.kt # Language filter options
15+
β”‚ β”‚ └── SortBy.kt # Sort options (stars, updated, etc.)
16+
β”‚ └── repository/SearchRepository.kt # Filtered, paginated search
17+
β”œβ”€β”€ data/
18+
β”‚ β”œβ”€β”€ di/SharedModule.kt # Koin: searchModule
19+
β”‚ β”œβ”€β”€ repository/SearchRepositoryImpl.kt # GitHub search API integration
20+
β”‚ β”œβ”€β”€ dto/ # Network DTOs
21+
β”‚ └── mappers/ # DTO β†’ domain model mappers
22+
└── presentation/
23+
β”œβ”€β”€ SearchViewModel.kt # Search state, filter management, pagination
24+
β”œβ”€β”€ SearchState.kt # query, results, filters, loading state
25+
β”œβ”€β”€ SearchAction.kt # Search, filter changes, load more, clicks
26+
β”œβ”€β”€ SearchEvent.kt # One-off events
27+
β”œβ”€β”€ SearchRoot.kt # Main composable with search bar + filter dropdowns
28+
└── components/ # Filter UI components
29+
```
30+
31+
## Key Interfaces
32+
33+
```kotlin
34+
interface SearchRepository {
35+
fun searchRepositories(
36+
query: String,
37+
searchPlatform: SearchPlatform,
38+
language: ProgrammingLanguage,
39+
sortBy: SortBy,
40+
page: Int
41+
): Flow<PaginatedDiscoveryRepositories>
42+
}
43+
```
44+
45+
## Navigation
46+
47+
Route: `GithubStoreGraph.SearchScreen` (data object, no params)
48+
49+
## Implementation Notes
50+
51+
- Platform filter maps to GitHub topic searches (e.g., `android` topic for Android platform)
52+
- Language filter maps to GitHub's `language:` qualifier
53+
- Search results use the same `PaginatedDiscoveryRepositories` model as home feature
54+
- Debounce/throttle applied to search queries to avoid excessive API calls
55+
- Integrates with favourites and starred status from core repositories

0 commit comments

Comments
Β (0)