https://github.com/vkrychun/stem-examples-swift
Native iOS apps generated by AI from StemJSON, rendered by StemRuntimeSDK.
https://github.com/vkrychun/stem-examples-swift
ai declarative-ui demo examples firebase ios stemjson swift swiftui uikit
Last synced: 7 days ago
JSON representation
Native iOS apps generated by AI from StemJSON, rendered by StemRuntimeSDK.
- Host: GitHub
- URL: https://github.com/vkrychun/stem-examples-swift
- Owner: vkrychun
- License: mit
- Created: 2026-04-17T19:16:21.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2026-05-08T14:58:54.000Z (about 1 month ago)
- Last Synced: 2026-05-08T17:28:05.224Z (about 1 month ago)
- Topics: ai, declarative-ui, demo, examples, firebase, ios, stemjson, swift, swiftui, uikit
- Language: Swift
- Homepage: https://stemjson.com
- Size: 2.49 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# StemJSON Examples
**Native iOS UI/UX, generated by AI.** A set of runnable iOS demos that show **StemJSON** in practice — the new JSON-based language AI writes, rendered as native SwiftUI by **StemRuntimeSDK**.
## The idea
Every module in this repo was produced through AI-assisted authoring — human-designed prompts, human selection among candidate outputs, and human editorial curation of the final JSON. [StemJSON](https://github.com/vkrychun/StemJSON/blob/main/spec/v1.0.md) is a declarative JSON DSL designed to be *written by an LLM* and rendered as native SwiftUI by [StemRuntimeSDK](https://github.com/vkrychun/stem-runtime-swift). No web views, no React Native, no JavaScript bridge.
Point an AI at the [LLM spec](https://github.com/vkrychun/StemJSON/blob/main/spec/v1.0-ai.md) (or the [full spec](https://github.com/vkrychun/StemJSON/blob/main/spec/v1.0.md) for human context). Ask for the UI/UX you want. Drop the output into this workspace. Run it.
## Demos at a glance
| Project | What it is |
|---|---|
| [**StemQuickStart**](StemQuickStart/) | ~20 lines of Swift. Counter + text binding. Copy this to start. |
| [**StemSwiftUI**](StemSwiftUI/) | Full showcase — every module type rendered modally. |
| [**StemUIKit**](StemUIKit/) | Same modules, UIKit host. |
| [**StemHome**](StemHome/) ⭐ | Native SwiftUI + StemJSON **mixed in the same app** with bidirectional state. |
### ⭐ Start with StemHome
The demo that answers: **can AI-generated UI coexist with hand-written SwiftUI in the same app?** Yes — and this shows how.
Native SwiftUI tabs alongside an LLM-generated StemJSON module, sharing state bidirectionally. Tap a native toggle → the JSON module receives it via `onCustom` and updates declaratively. Change JSON state → the native view reads it back through `runtime.subscribe` and re-renders. `runtime.trigger()` from Swift, `runtime.subscribe()` back — no bridge, no serialization per call, no polling.
The point: **you don't have to choose.** Let the AI generate the feature surface; keep the critical paths in the Swift code you wrote. Both live in the same screen, backed by the same state.
For a per-module breakdown — what each JSON demonstrates and any external setup — see [`StemJSON/MODULES.md`](StemJSON/MODULES.md).
## Run it
```bash
git clone https://github.com/vkrychun/stem-examples-swift.git
cd stem-examples-swift
open StemExamples.xcworkspace
```
In Xcode: pick a scheme, set your signing team (empty by default), run on a simulator or device. **iOS 18+**.
> Note: on physical devices, the freeware tier of StemRuntimeSDK displays a small "Powered by StemJSON" notice on rendered surfaces. This is removable under the paid SDK licence; see the [StemRuntimeSDK EULA](https://github.com/vkrychun/stem-runtime-swift/blob/main/LICENSE).
## Firebase (optional, for Messenger)
1. Create a Firebase project at [console.firebase.google.com](https://console.firebase.google.com), enable Firestore.
2. Drop `GoogleService-Info.plist` into `StemSwiftUI/StemSwiftUI/` (already `.gitignore`d) — **or** paste project ID + API key into the Messenger settings sheet at runtime.
Other demos have no external dependencies.
## Learn more
- [**StemJSON spec**](https://github.com/vkrychun/StemJSON/blob/main/spec/v1.0.md) — human-readable language specification.
- [**StemJSON — LLM reference**](https://github.com/vkrychun/StemJSON/blob/main/spec/v1.0-ai.md) — condensed reference optimised for LLM prompts.
- [**StemRuntimeSDK**](https://github.com/vkrychun/stem-runtime-swift) — the Swift runtime that renders it.
## License
The example code in this repository — Swift sources and JSON modules — is released under the [MIT License](LICENSE). Copy, adapt, ship.
The two projects this repo links against are governed by their own licenses:
- [**StemJSON specification**](https://github.com/vkrychun/StemJSON) — OWFa 1.0 with an additional attribution requirement.
- [**StemRuntimeSDK**](https://github.com/vkrychun/stem-runtime-swift) — its own End-User License Agreement.
If you redistribute or adapt the JSON modules in a product that implements StemJSON, the spec's attribution requirement still applies (see the [StemJSON LICENSE](https://github.com/vkrychun/StemJSON/blob/main/LICENSE)).
---
*StemJSON specification created by Vasyl Krychun — https://stemjson.com*
"StemJSON", "StemRuntimeSDK", "StemRuntime", and the StemJSON logo are trademarks of Vasyl Krychun. See the [StemJSON trademark policy](https://github.com/vkrychun/StemJSON/blob/main/TRADEMARK_POLICY.md) for permitted uses.