← ღია კოდის კატალოგი

Relux Sample

A sample project showcasing the use of Relux — a Redux-inspired, async-first architecture written purely in Swift.

ნახვა GitHub-ზე

Relux SwiftUI Sample

Swift 6.0+ Platform

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.


What’s Inside

ConceptDescription
Unidirectional data flowRelux: Redux/Flux-inspired, Swift Concurrency-native, no functional purism
Strict modularizationModels, interfaces, implementations, UI, test-support as separate products within domain boundaries
Horizontal dependenciesInterface/Implementation split flattens dependency graph; optimizaed isolated recompilation (fast incremental builds)
Domain side effectsSagas and Flows handle async operations within a domain (API calls, persistence, etc.)
Cross-domain coordinationOrchestrator sagas handle domain-to-domain communication
Service-oriented architectureServices encapsulated within domain modules; manage API, networking, persistence behind protocols
Layered testingSaga, reducer, service tested in isolation; shared test infrastructure
Swift 6 concurrencyActor-isolation, strict sendability, structured async throughout
Simpe Async-first DISwiftIoC provides async module resolution, async app entry points; implementations swappable at registration

Architecture Snapshot

<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.


Quick Start

# 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)

Documentation

DocumentPurpose
PROJECT_GUIDE.mdEntry point: layout, conventions, setup
RELUX_MODULAR.mdDomain decomposition pattern
RELUX_ORCHESTRATION.mdCross-domain coordination
RELUX_FLOW_VS_SAGA.mdWhen to return results vs fire-and-forget
TESTING_STRATEGY.mdDiscrete layer testing approach
TEST_INFRASTRUCTURE.mdShared test utilities
DOMAIN_TEST_SUPPORT.mdPer-domain mocks and stubs

Testing

  • 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

Maintainers

  • Alexis Grigorev
  • Ivan Oparin
  • Artem Grishchenko

The Relux stack

This package is part of the Relux stack: the Relux unidirectional data-flow architecture for Swift 6, a family of modules around it, and agent-ready testing tools. The stack is how we build MVPs fast on agentic rails and then scale them into enterprise-grade apps: Tuist workspaces, strict modularization, and a UDF architecture proven in production for years. Browse the full picture in the Relux Works open-source catalog.

About Relux Works

This project is part of the open-source ecosystem of Relux Works, an AI-native software development studio. We build fixed-price MVPs, rescue vibe-coded apps, run local AI inference, and train teams to work with coding agents. Much of the infrastructure behind that work is open source.

MIT License

Copyright (c) 2025 Swift Relux: Alexis Grigorev, Artem Grishchenko, Ivan Oparin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.