How spacecowboy/feeder works
• User Interface Layer:
• Activities (e.g., MainActivity, AddFeedFromShareActivity, OpenLinkInDefaultActivity)
• Compose UI screens and components (found under app/src/main/java/com/nononsenseapps/feeder/ui/compose, including specific feature screens such as feed, article, navigation, settings, etc.)
• Traditional UI parts (legacy XML layouts and AndroidManifest definitions)
• Presentation / ViewModel / Business Logic Layer:
• ViewModels (e.g., MainActivityViewModel, EditFeedScreenViewModel, etc.)
• Architecture model classes in “archmodel” (Repository.kt, FeedStore, etc.) that mediate between UI and data
• Data Access and Persistence Layer:
• Room database (definitions in app/schemas and app/src/main/java/com/nononsenseapps/feeder/db/room such as AppDatabase.kt, FeedDao.kt, etc.)
• Content Provider (RSSContentProvider and its contract)
• Migrations and schema JSON files (used to evolve the database)
• Networking / Sync and External API Layer:
• Retrofit and Moshi setup for REST API calls (under app/src/main/java/com/nononsenseapps/feeder/sync, Retrofit.kt, SyncRestClient.kt)
• External service integration such as OpenAI APIs and Nostr feeds (under app/src/main/java/com/nononsenseapps/feeder/openai)
• Domain-related HTTP interceptors and rate limiters (files in the “model” folder)
• Background Processing and Job Services:
• Background tasks such as sync jobs, notification jobs, and full text synchronization (files in app/src/main/java/com/nononsenseapps/feeder/background, e.g., FeederJobService, RssSyncJob, etc.)
• Dependency Injection (DI) and Configuration Layer:
• DI configuration modules (in app/src/main/java/com/nononsenseapps/feeder/di) using Kodein DI (also visible in the org/kodein directory)
• Application initialization (FeederApplication.kt and ApplicationCoroutineScope.kt)
• Utility, Crypto, and Libraries:
• Cryptographic utilities (e.g., AesCbcWithIntegrity in crypto)
• Extensions and helper functions (Utilities, logging, error handling)
• External libraries like the bundled nostr-sdk (in app/libs) and support libraries provided via Gradle configuration
Relationships and Data Flow
• The UI layer (Activities/Compose screens) communicates with ViewModels, which in turn interact with the Repository and business logic (archmodel).
• The Repository abstracts access to the data layer where Room is used to store and retrieve feed content, and content providers expose some of that data.
• Network modules work with the Repository to fetch updates (feeds, articles) via REST APIs as well as processing background sync tasks.
• Dependency injection (DI) is used to inject ViewModels, repositories, network clients, and other dependencies across the layers.
• Background services (JobService, notifications, sync jobs) are triggered periodically or by user actions and coordinate with both the network and the database.
Architectural Patterns and Design Principles
• MVVM (Model–View–ViewModel) for a clean separation between UI and business logic.
• Repository Pattern for abstracting and unifying data operations from local (Room) and remote (network) sources.
• Dependency Injection (using Kodein) for flexible component wiring and testability.
• Layered architecture ensuring that UI, business logic, and data layers remain independent.
• Robust testing strategy (notice the extensive androidTest and test folders), which should be represented by including test harness components or noting that each layer is independently tested.
Relevant Technologies, Frameworks and Libraries
• Android SDK and Android Jetpack components (Room, Compose, LiveData/ViewModel)
• Retrofit, Moshi for networking and JSON parsing
• Kodein for DI (with compose integration)
• Gradle (Kotlin DSL) for builds
• CI/CD configurations (CircleCI, GitHub Actions, fastlane) which although not directly part of the runtime architecture, support the build and release pipelines
Instructing the Design
• Use clear labels for each component. For instance, label “UI – Activities & Compose Screens,” “ViewModel Layer,” “Repository/Business Logic,” “Room Database & Content Provider,” “Networking & API Clients,” “Background Services/Sync,” and “DI & Application Config.”
• Annotations or notes on any design patterns (like MVVM or Repository), and indicate how background processing interacts with the main application (e.g., through Job Services).