Add React Native mobile app support with shared core library architecture#49
Draft
kenichiro-kimura with Copilot wants to merge 4 commits into
Draft
Add React Native mobile app support with shared core library architecture#49kenichiro-kimura with Copilot wants to merge 4 commits into
kenichiro-kimura with Copilot wants to merge 4 commits into
Conversation
Co-authored-by: kenichiro-kimura <39895593+kenichiro-kimura@users.noreply.github.com>
…ile app foundation Co-authored-by: kenichiro-kimura <39895593+kenichiro-kimura@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] React Nativeを使用したAndroid/iOSモバイルアプリ対応
Add React Native mobile app support with shared core library architecture
Jul 27, 2025
…convert to ElectronWireguardConfig feat: Enhance ConfigManager with Electron app and path imports chore: Update TypeScript module resolution in tsconfig.json feat: Add Metro configuration for mobile package to support workspace root fix: Modify mobile package.json scripts and dependencies for better compatibility
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements comprehensive React Native mobile app support for the SORACOM Button application, enabling Android and iOS functionality while achieving ~80% code sharing with the existing Electron desktop app through a shared core library architecture.
Problem Solved
The original application was limited to desktop platforms (Windows/Mac) using Electron. This implementation extends support to mobile platforms (Android/iOS) while maximizing code reuse and maintaining feature parity across all platforms.
Solution Architecture
Monorepo Structure with Shared Core
Shared Core Library (
@soracom-button/core)Extracted platform-agnostic business logic into a reusable library:
Platform-Specific Adapters
Each platform implements the core interfaces:
Electron Desktop:
electron-storefor persistent configurationdgrammodule for network communicationlibsoratunnative library for WireGuardReact Native Mobile:
AsyncStoragefor configuration persistencereact-native-udpfor network communicationKey Features Implemented
Cross-Platform Functionality
Mobile-Specific Enhancements
Code Examples
Shared Business Logic Usage
Platform Adapter Implementation
Development Workflow
The monorepo structure enables efficient cross-platform development:
Benefits Achieved
Backward Compatibility
All existing Electron desktop functionality is preserved:
This implementation demonstrates a successful strategy for extending desktop applications to mobile platforms while maintaining code quality, consistency, and developer productivity.
This pull request was created as a result of the following prompt from Copilot chat.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.