How alexisl61/rpc_express works
Project Type & Purpose
• This is an open‐source, cross-platform client application built with Flutter. Its main function is to allow users to manually select in-game activities (for games like Sea of Thieves, Helldivers 2, and The Finals) so that rich presence information is displayed on their Discord profiles.
• The README emphasizes that it does not auto-detect game activities; instead, users choose activities and groups via the app’s UI, which then communicates with Discord.
Main Components
a. User Interface (Frontend):
– Represent the Flutter UI layer that spans multiple platforms (Android, iOS, web, macOS, Windows, Linux).
– Highlight the separation into sub-modules/pages for each game:
• Helldivers UI (e.g., activity selection, difficulty, planet selection)
• Sea of Thieves UI (e.g., activity, ship selection, company logos)
• The Finals UI (e.g., gamemode and group selection)
– Include common UI components (atoms, molecules, organisms) as part of the MVVM architecture; these are visible in directories (lib/components).
b. Business Logic & MVVM Structure:
– Show the MVVM (Model-View-ViewModel) pattern used throughout the project.
– Identify key modules:
• ViewModels – pages/view models for home screens, activity selections, etc.
• Models – classes for game activities, translations, user data, and groups.
• View Events & Event Observers – modules to handle navigation and dialogs based on user interactions.
c. Data Access Layer:
– Repositories: Represent the API repository classes which abstract the data fetching logic.
– API Services: Components for handling remote or local API data (refer to files under lib/services and api/v1) that supply updated activity lists and translations.
– Transformers: Show the existence of transformation classes converting raw data from JSON into the application’s model classes.
d. Assets & External Resources:
– Represent the static assets (images, fonts, SVGs) that provide the visual content for different game UIs present under the assets directory.
– API JSON files: Note that there are local JSON files for activities and translations inside the “api” directory, which serve as sources for in-app data.
– Discord Integration: Include a component that represents the Discord Rich Presence update functionality, which uses an external Discord RPC integration service.
e. Platform-Specific Native Code:
– For each supported platform, show a node representing the native integration. The “rpc_express” directory contains Android, iOS, macOS, Windows, Linux, and web folders. These components handle platform-specific configuration and integration (such as launching the Flutter engine and handling native plugins).
Relationships & Data Flows
– From the user interacting with the UI (View) to the corresponding ViewModel.
– From ViewModels to Services and Repositories that fetch or cache data (activities, translations).
– Show transformers processing API JSON data before feeding it into Models.
– Connect the processed data to UI components for rendering.
– Illustrate the pathway from user actions leading to API Service calls that update Discord’s status through the Discord integration.
• That configuration and build scripts (such as GitHub workflows and platform-specific build files) support continuous integration/deployment.
Architectural Patterns & Key Technologies
• MVVM Pattern: Emphasize separation via model, view-model, and view.
• Flutter: Central technology behind the cross-platform user interface.
• JSON-based API Data: Local JSON files (under api/v1) for activities & translations.
• Repository Pattern: Abstracts the data access and retrieval via API services.
• Integration with Discord RPC: External service for updating rich presence.
• Usage of version control and CI/CD via GitHub workflows.
• A block for “User Interface” (with subcomponents for each game and common UI elements).
• A block for “ViewModels & Business Logic” (representing the MVVM layer).
• A block for “Repositories & Services” (including API service calls, Discord service, and transformation layers).
• A block for “Data Sources” (representing local JSON files found under api/v1 and assets directories).
• A block for “Platform-Specific Wrapper/Native Layer” (covering Android, iOS, web, etc.).
• Notes on how GitHub workflows and configuration files support automated builds and releases.