Modular, async-first Relux architecture for SwiftUI. Split into small domain packages (Auth, Notes) to demonstrate scaling from MVP to large apps while keeping builds fast and boundaries clear.
Read this doc then continue at: PROJECT_GUIDE.md for workspace layout, patterns, and conventions.
| Concept | Description |
|---|---|
| Unidirectional data flow | Relux — Redux/Flux-inspired, Swift Concurrency-native, no functional purism |
| Strict modularization | Models, interfaces, implementations, UI, test-support as separate products within domain boundaries |
| Horizontal dependencies | Interface/Implementation split flattens dependency graph; optimizaed isolated recompilation (fast incremental builds) |
| Domain side effects | Sagas and Flows handle async operations within a domain (API calls, persistence, etc.) |
| Cross-domain coordination | Orchestrator sagas handle domain-to-domain communication |
| Service-oriented architecture | Services encapsulated within domain modules; manage API, networking, persistence behind protocols |
| Layered testing | Saga, reducer, service tested in isolation; shared test infrastructure |
| Swift 6 concurrency | Actor-isolation, strict sendability, structured async throughout |
| Simpe Async-first DI | SwiftIoC provides async module resolution, async app entry points; implementations swappable at registration |
<Domain>Models Pure data types, no dependencies
<Domain>ReluxInt Actions, effects, state/router protocols
<Domain>ServiceInt Service protocols
<Domain>ServiceImpl Concrete service implementations
<Domain>ReluxImpl State, reducer, saga, module wiring
<Domain>TestSupport Mocks, stubs for testing
<Domain>UI SwiftUI views (imports interfaces only)
IoC wiring: SwiftIoC registers routers, services, modules. Swap implementations by changing registration only.
# Clone
git clone <repo-url>
cd relux-sample
# Open in Xcode
open relux_sample.xcodeproj
# Build & run
# Select relux_sample scheme → Run (Cmd+R)
# Run tests
# Product → Test (Cmd+U)| Document | Purpose |
|---|---|
PROJECT_GUIDE.md |
Entry point — layout, conventions, setup |
RELUX_MODULAR.md |
Domain decomposition pattern |
RELUX_ORCHESTRATION.md |
Cross-domain coordination |
RELUX_FLOW_VS_SAGA.md |
When to return results vs fire-and-forget |
TESTING_STRATEGY.md |
Discrete layer testing approach |
TEST_INFRASTRUCTURE.md |
Shared test utilities |
DOMAIN_TEST_SUPPORT.md |
Per-domain mocks and stubs |
- Shared infrastructure:
Packages/TestInfrastructure— Relux logger extensions, async helpers, common mocks - Domain support:
<Domain>TestSupport— domain-specific mocks/stubs - Strategy: Test saga, reducer, service in isolation; optional smoke tests for wiring
- Alexis Grigorev
- Ivan Oparin
- Artem Grishchenko