How androiddevnotes/awesome-android-kotlin-apps works
This project is a Kotlin-based command line tool (packaged as a JAR) that generates or updates the “Awesome Android Kotlin Apps” README file. In effect, it curates data (from a local JSON file and via GitHub API calls) and converts or aggregates that data into a markdown file that lists Android apps built with Kotlin. Its architecture follows a layered design that separates concerns into an application (or “presentation”) layer, a domain/core layer, and a data layer. In addition, dependency injection (the “di” package) is used to wire modules such as networking (NetworkModule), JSON parsing (MoshiModule), and repository implementations.
Main Application Layer
• Component: App.kt – acts as the entry point that ties the various components together.
• Component: Tasks (the “tasks/convert” package) – for example, MarkdownToJsonConvertor that handles conversion operations.
• Flow: The application starts by invoking the main application process which coordinates data collection, conversion, and generation of the README.
Domain / Core Layer
• Component: ReadMeGenerator.kt – the central business logic responsible for generating/updating the markdown README.
• Component: Utility classes such as DateTimeUtils.kt that help process and format data.
• Flow: This layer encapsulates algorithms that merge local input, GitHub API data, and conversion logic to create the curated output.
Data Layer
• Local Data:
– Files such as input_data.json and classes in data/local (e.g. InputProjectCategory.kt and Project.kt) that load and parse input.
• Remote Data:
– GitHub API integration implemented in data/remote (e.g. GitHubApi.kt, GetRepoResponse.kt) to fetch additional repository data.
• Repository Implementations:
– Classes in data/repo (e.g. GitHubRepo.kt, InputDataRepo.kt, ReadMeRepo.kt) that combine local and remote data sources and abstract data access.
• Flow: The repositories abstract the data sources, and the ReadMeGenerator calls into these repositories to collect necessary project data.
Dependency Injection (DI) / Configuration Layer
• Component: AppComponent.kt, together with modules provided in di/modules (NetworkModule.kt, MoshiModule.kt)
• Purpose: These components provide a central configuration for wiring together the network, JSON serialization, and repository dependencies.
• Flow: The DI container is bootstrapped at application startup (likely from App.kt) and is used throughout to inject necessary objects into the domain and data layers.
External Systems & Infrastructure
• External GitHub API – used by the remote data components.
• Local Files:
– The “input_data.json” file and other configuration files (gpm.json) serve as local inputs to the data layer.
• Build and Deployment Artifacts:
– Although not part of the runtime logic, the Gradle build files (build.gradle, settings.gradle, gradlew, etc.) indicate that the project is managed via Gradle and can be built into “awesome-android-kotlin-apps.main.jar”.
– At the top (or left) show the App layer (App.kt, Tasks).
– In the middle, show the Domain/Core layer (ReadMeGenerator, utilities).
– At the bottom (or right), show the Data layer (local data sources, GitHub API integration, and repository classes).
– Include a separate DI/Configuration section that delivers services to all layers.
– From App.kt to the DI/Configuration layer to indicate injection and instantiation.
– From App.kt to ReadMeGenerator in the Domain layer.
– From ReadMeGenerator to the various repositories in the Data layer.
– From repositories to both Local File System (for input JSON) and the external GitHub API.
– Optionally, show the conversion task as an operation that transforms Markdown to JSON (or vice versa) invoked within the process.
– Include names for each module (e.g., “ReadMe Generator”, “GitHub Repository”, “Local Data Loader”, “DI Container with Network & Moshi Modules”) clearly.
• Architectural Patterns:
– Emphasize the separation of concerns (data retrieval, business logic, output generation).
– Note the use of repository pattern in the Data layer.
– Mark the integration of dependency injection for loose coupling.
– Mention how the conversion tasks and utility functions are integrated to process and format data.
Happy diagramming!