How tarik-b/pokechu works
Project type and purpose
• This is a two‐part system:
a) A Python‐based data parser/exporter that fetches and processes Pokémon data from Poképedia and PokéAPI and writes out a local SQLite DB, Kotlin enum files, XML string resources, and image assets.
b) An Android mobile app (Kotlin, MVVM, Room) that bundles those generated assets (db.sqlite, enums, XML, images) and presents a spoiler‐free Pokédex UI.
Main components
• Parser Service (Python)
– Input: external sources (Poképedia pages, PokéAPI REST endpoints)
– Process: parser.main → parsing modules → exporter modules
– Output: parser_output folder containing
• db.sqlite (SQLite database)
• Kotlin enum source files
• XML string resource files (localized values-en, values-fr)
• Downloaded image assets
• Artifact Storage
– File system folder (“parser_output/”) or CI storage for passing assets to Android build
• Android App (Kotlin, Gradle project “pokechu”)
– Build system: Gradle module “app”
– Assets:
• app/src/main/assets/db.sqlite
• app/src/main/res/values-*/ (XML resources)
• app/src/main/assets/images/*
– Data Layer:
• Room Database (Database.kt, Entities, DAOs)
• DataRepository classes (Pokemon, Regions, Evolutions, Preferences)
• Managers (SettingsManager, LocalizationManager)
– Domain Layer:
• ViewModel classes (ViewModelPokemonList, ViewModelDetails, etc.)
– Presentation Layer:
• UI Components: Activities, Fragments, RecyclerViews, Compose screens
• Utility classes (AssetUtils, UIUtils)
– External Libraries: GraphView, Localization, Leonids, LivePreferences, FastScroll, CollapsingAvatarToolbarSample
Relationships and data flows
• Parser Service → (exports) → Artifact Storage
• Artifact Storage → (ingested by) → Android Build & Packaging
• At runtime:
• UI Layer ← ViewModels ← Repositories ← Room DB (db.sqlite) & SharedPreferences
• UI Layer interacts with Managers for theme, localization, settings
• ViewModels expose LiveData/Flows to UI
• Configuration: Gradle build scripts orchestrate resource merging and asset bundling
Architectural patterns and design principles
• Parser: modular Python code (parsing vs. exporting), single‐responsibility modules
• Android app: MVVM pattern
• Separation of concerns:
– Data repositories handle raw data access
– ViewModels mediate between repositories and UI
– Activities/Fragments/Compose handle rendering and user interaction
• Dependency injection (via ApplicationExecutors or manual wiring)
• Room ORM for strongly‐typed database access
• Localization strategy: separate data language (XML resources) from app UI language
Detail capture
• Top‐level folder as a component in the parser (parser/parsing vs. parser/export)
• Configuration artifacts (build.gradle, settings.gradle) at the boundary between parser outputs and Android inputs
• Don’t overload with every individual file—focus on modules and their relationships