Skip to main content

What is Prism?

Prism is a full-stack Swift ecosystem built entirely on Apple frameworks — zero third-party dependencies. 10 modules covering everything from SwiftUI components and state management to HTTP servers, ML/AI, and native platform APIs.

UI & Design System

100+ SwiftUI components, design tokens, theming, charts, forms, and accessibility.

Architecture

Composable state management with stores, reducers, effects, middleware, and navigation.

Server

HTTP server, routing, database, GraphQL, MCP, WebSocket rooms, middleware, and cron.

Intelligence

On-device ML, Apple Intelligence, NLP, RAG pipelines, and structured output parsing.

Hello World

import Prism

struct CounterFeature: PrismReducer {
    struct State: Sendable, Equatable { var count = 0 }
    enum Action: Sendable { case increment, decrement }

    func reduce(into state: inout State, action: Action) -> PrismEffect<Action> {
        switch action {
        case .increment: state.count += 1
        case .decrement: state.count -= 1
        }
        return .none
    }
}

struct CounterView: View {
    let store: PrismStore<CounterFeature.State, CounterFeature.Action>

    var body: some View {
        VStack {
            Text("\(store.state.count)")
                .prismTypography(.headlineLarge)
            HStack {
                PrismButton("-", variant: .outlined) { store.send(.decrement) }
                PrismButton("+", variant: .filled) { store.send(.increment) }
            }
        }
    }
}
No configuration files, no boilerplate, no dependency resolution. Just Swift.

Why Prism?

Zero Dependencies

No SwiftNIO, no Alamofire, no third-party anything. Your Package.resolved stays clean. Your builds stay fast.

Swift 6.3 Native

Built from the ground up with strict concurrency. Actors, Sendable, structured concurrency — designed for it.

Full-Stack Ecosystem

10 modules spanning server, client, architecture, networking, ML, and platform APIs. One framework, one import.

How does Prism compare?

FeaturePrismTCARaw SwiftUI
State ManagementPrismStore — composable, middleware, time-travelComposableArchitectureManual ObservableObject
UI Components100+ built-in, design tokens, themingNoneNone
HTTP ClientBuilt-in, type-safe endpoints, cache, retryNoneURLSession
Storage6 backends, encryption, compression, migrationNoneUserDefaults / SwiftData
SecurityBiometrics, keychain, cert pinning, JWTNoneManual
ML/AICoreML, Apple Intelligence, RAGNoneNone
GamificationChallenges, streaks, leaderboardsNoneNone
Dependencies03+0

The Ecosystem

Prism is organized into 10 focused modules that work together or independently:
ModuleRole
PrismUI100+ SwiftUI components, 4 themes, design tokens
PrismArchitectureStore, reducer, middleware, router (UDF)
PrismNetworkHTTP client, WebSocket, endpoints, cache, retry
PrismFoundationEntities, logging, analytics, locale, resources
PrismSecurityBiometrics, keychain, encryption, cert pinning, JWT
PrismStorageUserDefaults, Disk, Memory, SwiftData, Keychain
PrismIntelligenceCoreML, Apple Intelligence, LLM, RAG, NLP
PrismGamificationChallenges, streaks, badges, leaderboards
PrismCapabilitiesStoreKit, HealthKit, CloudKit, Camera, NFC
PrismVideoVideo download, media entities

Real Examples

A todo app with PrismArchitecture, PrismUI components, and PrismStorage:
import Prism

struct TodoFeature: PrismReducer {
    struct State: Sendable, Equatable {
        var todos: [Todo] = []
        var input = ""
    }

    enum Action: Sendable {
        case addTodo, updateInput(String), toggleTodo(UUID), loaded([Todo])
    }

    let storage = PrismDefaultsStore(suite: "com.app.todos")

    func reduce(into state: inout State, action: Action) -> PrismEffect<Action> {
        switch action {
        case .addTodo:
            let todo = Todo(title: state.input)
            state.todos.append(todo)
            state.input = ""
            return .run { _ in try storage.save(state.todos, forKey: "todos") }
        case .updateInput(let text):
            state.input = text
        case .toggleTodo(let id):
            state.todos[id: id]?.isDone.toggle()
            return .run { _ in try storage.save(state.todos, forKey: "todos") }
        case .loaded(let todos):
            state.todos = todos
        }
        return .none
    }
}

struct TodoListView: View {
    let store: PrismStore<TodoFeature.State, TodoFeature.Action>

    var body: some View {
        PrismCard {
            ForEach(store.state.todos) { todo in
                PrismListItem(todo.title, trailing: {
                    PrismCheckbox(isOn: todo.isDone) {
                        store.send(.toggleTodo(todo.id))
                    }
                })
            }
            HStack {
                PrismTextField("New todo", text: Binding(
                    get: { store.state.input },
                    set: { store.send(.updateInput($0)) }
                ))
                PrismButton("Add", variant: .filled) {
                    store.send(.addTodo)
                }
            }
        }
    }
}

What Can You Build?

Native iOS/macOS Apps

Full-featured apps with PrismUI components, PrismArchitecture state management, and PrismNetwork.

REST APIs

JSON APIs with routing, validation, authentication, rate limiting, and database persistence.

Real-Time Apps

Chat, live dashboards, collaborative tools using WebSocket rooms, SSE, and the event bus.

ML-Powered Features

On-device classification, sentiment analysis, RAG pipelines, and Apple Intelligence.

GraphQL & MCP Servers

GraphQL schemas with playground, MCP servers exposing tools to AI assistants.

Gamified Experiences

Challenges, streaks, badges, leaderboards, and AI-powered motivational messages.

Next Steps

1

Install Prism

Add Prism to your Swift package — server, client, or both. Installation guide
2

Build Something

Follow the quickstart — choose iOS App or Server API. Quickstart