Configuration Management
Relevant source files
The following files were used as context for generating this wiki page:
Configuration in the Sovereign Communications (SC) project is managed through a series of dedicated files, reflecting the monorepo architecture that separates concerns for the core library, web application, and various testing frameworks. This modular approach allows for tailored settings for different environments (development, testing, production) and platforms (Web, Android, iOS).
The configuration landscape covers build-time settings, runtime parameters, and extensive testing configurations for unit, integration, end-to-end (E2E), and mutation testing.
Configuration File Overview
This diagram shows the different domains of configuration management within the project and their corresponding files.
Testing Configuration
The project utilizes a sophisticated testing infrastructure, with dedicated configuration files for each type of test.
Sources: tests/README.md, E2E_IMPLEMENTATION_SUMMARY.md
End-to-End Testing (Playwright)
E2E tests are managed by Playwright, configured via playwright.config.ts. This setup enables testing across multiple browsers and orchestrates cross-platform tests.
| Key | Description |
|---|---|
testDir | Specifies the directory containing E2E test files, such as tests/e2e/. |
projects | Defines test configurations for different browsers, including chromium, firefox, and webkit. |
webServer | A command to start the development server before tests run, ensuring the application is available. |
use | Contains common properties for all tests, such as baseURL and trace options for debugging. |
Sources: tests/README.md, E2E_IMPLEMENTATION_SUMMARY.md
Mobile End-to-End Testing (Appium)
Cross-platform mobile testing is configured in appium.config.ts. It uses Appium to drive the Android and iOS applications, allowing Playwright tests to interact with them.
The diagram below illustrates the flow for mobile E2E tests.
Sources: E2E_IMPLEMENTATION_SUMMARY.md
The configuration specifies capabilities for each mobile platform.
| Platform | Key | Description |
|---|---|---|
| Server | host | The hostname for the Appium server (e.g., localhost). |
port | The port for the Appium server (e.g., 4723). | |
| Android | platformName | Identifies the platform as 'Android'. |
automationName | Specifies the driver, UiAutomator2. | |
deviceName | The name of the emulator to use, e.g., 'Android Emulator'. | |
app | Path to the Android application package (.apk). | |
autoGrantPermissions | Automatically grants all requested permissions at install time. | |
| iOS | platformName | Identifies the platform as 'iOS'. |
automationName | Specifies the driver, XCUITest. | |
deviceName | The name of the simulator to use, e.g., 'iPhone 15'. | |
app | Path to the iOS application bundle (.app). |
Sources: E2E_IMPLEMENTATION_SUMMARY.md
Mutation Testing (Stryker)
Mutation testing is configured in stryker.config.js to assess the quality of the tests by introducing small changes (mutations) into the source code and verifying that tests fail.
| Key | Description |
|---|---|
mutator | Defines which parts of the code to mutate. |
reporters | Specifies the output formats for the mutation testing report (e.g., html, clear-text). |
testRunner | The command to run the test suite (e.g., jest). |
coverageAnalysis | Determines whether to mutate only code covered by tests. |
Sources: tests/README.md
Application and Build Configuration
Production Environment Variables
For production deployments, the project uses a .env.production file to manage sensitive or environment-specific variables. These are loaded during the build process.
| Variable | Description | Example Value |
|---|---|---|
VITE_SENTRY_DSN | The Data Source Name for integrating with the Sentry error tracking service. | https://... |
VITE_ENVIRONMENT | Specifies the deployment environment. | production |
VITE_API_ENDPOINT | The base URL for an external API, if any. | https://api.sovereign.com |
VITE_MAX_FILE_SIZE | The maximum allowed file size for uploads, in bytes. | 104857600 |
VITE_RATE_LIMIT_MESSAGES_PER_MINUTE | The number of messages a user can send per minute to prevent spam. | 60 |
Sources: V1_PRODUCTION_IMPLEMENTATION_PLAN.md
Build and Runtime Configuration
web/vite.config.ts: This file configures the Vite build tool for the web application. It is used to define settings like the development server port and production build optimizations.web/src/config.ts: This file likely holds runtime configuration for the web application, such as feature flags or public API keys.core/src/config-manager.ts: As part of the shared core library, this file is intended to manage configuration settings that are common across all platforms (Web, Android, iOS).
Sources: CONTRIBUTING.md, V1_COMPLETE_TASK_LIST.md
Summary
The configuration management strategy for Sovereign Communications is robust and tailored to its complex, multi-platform nature. By using separate, tool-specific configuration files, the project maintains a clean separation of concerns between application logic, testing, and build processes. This modularity is essential for managing the different requirements of the web, Android, and iOS platforms while sharing a common core library.