Back to MicroDrama

How MicroDrama is built

MicroDrama is interactive fiction told through a fictional messaging app: characters write to you in real time, send photos and documents, and react to what you answer. It runs with no backend of its own — stories are signed packs downloaded once and played offline, purchases are StoreKit 2 and progress syncs through the player's own iCloud.

Version
1.2
Requires iOS
iOS 26.0
Size
6.4 MB
Category
Entertainment
First released
2026

Architecture

A Swift 6 SwiftUI app with strict concurrency over a UI-independent Swift package, plus a content toolchain and a zero-cost serving stack built around a signed PHP gateway on existing hosting.

  1. MicroDramaKit / NarrativeCore

    UI-independent package: story-pack schema, loader and validator, narrative engine, state, pacing, entitlements, credit ledger, catalogue schema and .mdpk archives with SHA-256 checks. Tested on macOS and Linux.

  2. App core

    SwiftData persistence, StoreKit 2 store and credit wallet, CloudKit progress sync and iCloud key-value store, signed content client, catalogue and pack installer, local notifications.

  3. On-device AI

    A Foundation Models intent interpreter maps typed replies to the story's options, gated by availability so every story stays playable with written choices.

  4. Content pipeline

    Python story compiler and pack tool, a StoryCheck CLI that validates and plays every path, and TypeScript workflows on GitHub Actions that draft, translate, gate and publish stories.

  5. Serving

    Stories, covers and the catalogue are served per language through a signed PHP gateway; no database, no app server, no per-user backend.

Stack

Languages

28,155lines of code · 204 source files
Swift 50.1%Python 40.3%TypeScript 8.2%PHP 0.6%

Build

UI
SwiftUI-first (with UIKit interop)
Swift
6.0
Deployment target
iOS 26.0
Tests
177 test cases

Apple frameworks

Machine learning

FoundationModels

Interface

SwiftUIUIKit

System integration

UserNotifications

State and concurrency

Observation

Data

SwiftDataCloudKit

Commerce

StoreKit

Security

CryptoKit

Local Swift packages

MicroDramaKit

Targets

App
MicroDrama

Dependencies

PackageVersionSource
abseil-cpp-binary1.2024072200.0SPM
app-check11.3.2SPM
firebase-ios-sdk12.19.2SPM
google-ads-on-device-conversion-ios-sdk3.7.0SPM
googleappmeasurement12.19.2SPM
googledatatransport10.1.1SPM
googleutilities8.1.3SPM
grpc-binary1.69.1SPM
gtm-session-fetcher5.3.1SPM
interop-ios-for-google-sdks101.0.0SPM
leveldb1.22.5SPM
nanopb2.30910.1SPM
promises2.4.1SPM

Patterns

Observation (@Observable)Swift Concurrency (async/await)Actors@MainActor isolationSwiftData modelsProtocol-oriented services (DI)NavigationStack#Preview macrosSwift TestingString CatalogsOn-device LLM (LanguageModelSession)Canvas / TimelineView renderingURLSession networkingCodable modelsStrict concurrency checking

Capabilities

iCloudiCloud key-value store

Backend and services

PHP backend

Tooling

GitHub ActionsSwift Package ManagerPrivacy manifest

Stack detected automatically from the repository on 6 Nov 2026.

Engineering highlights

Zero running cost

Content on existing hosting, purchases on device, progress in the player's own iCloud: nothing in the stack has a paid tier that can switch on by itself.

Stories as validated data

Episodes are compiled from a script format into packs, validated and auto-played through every branch before release, so broken paths never ship.

Typed replies, understood locally

Free-text answers are interpreted on device with Foundation Models; nothing the player types leaves the phone.

16 languages, downloaded on demand

Packs are split into a base and per-language parts, so each reader downloads only the language they need.

Get it on the App StoreBack to MicroDrama