Documentation Index
Fetch the complete documentation index at: https://docs.prism.byescaleira.com/llms.txt
Use this file to discover all available pages before exploring further.
What is Prism?
Prism is a server-side Swift framework that does something no other framework does: it ships with zero third-party dependencies. Every feature — from HTTP routing to WebSocket support, from SQLite databases to GraphQL engines — is built entirely on Apple’s own frameworks: Network.framework, Foundation, SQLite3, CryptoKit, and Compression. This isn’t a toy. Prism includes 36+ production-ready modules covering everything you need to build modern server applications.Hello World in Prism
Why Prism?
Zero Dependencies
No SwiftNIO, no AsyncHTTPClient, no third-party anything. Your
Package.resolved stays clean. Your builds stay fast. Your attack surface stays small.Swift 6.3 Native
Built from the ground up with strict concurrency. Actors,
Sendable, structured concurrency — not retrofitted, but designed for it.Batteries Included
36+ modules out of the box. Database, sessions, GraphQL, MCP, WebSocket rooms, cron jobs, file uploads — all native.
How does Prism compare?
| Feature | Prism | Vapor | Hummingbird |
|---|---|---|---|
| Third-party deps | 0 | 20+ | 10+ |
| HTTP layer | Network.framework | SwiftNIO | SwiftNIO |
| Database | Built-in SQLite | Fluent (separate) | Custom |
| GraphQL | Built-in | Third-party | Third-party |
| MCP Server | Built-in | None | None |
| WebSocket Rooms | Built-in | Third-party | Manual |
| Swift 6 concurrency | Native actors | Partial | Partial |
Key Features
Prism organizes its features into focused modules that work together seamlessly:HTTP & Routing
HTTP & Routing
Full HTTP/1.1 server on Network.framework. Pattern-based routing with
:params and * wildcards. Route groups with shared prefixes and middleware. Support for all HTTP methods.Middleware Pipeline
Middleware Pipeline
CORS, logging, authentication, rate limiting, compression, request tracing, API versioning, lifecycle hooks — all built-in. Stack them declaratively.
Database & ORM
Database & ORM
SQLite via the C API. Query builder, model protocol with CRUD, migrations, connection pooling, and relationship queries (hasMany, belongsTo, hasOne).
Real-Time
Real-Time
WebSocket with RFC 6455 compliance. Named rooms with join/leave/broadcast. Server-Sent Events. Actor-based event bus with typed pub/sub.
GraphQL Engine
GraphQL Engine
Schema DSL, recursive descent parser, field-level resolvers, introspection, and an embedded GraphiQL playground. No third-party GraphQL libraries.
MCP Server
MCP Server
Model Context Protocol implementation with JSON-RPC 2.0. Register tools, resources, and prompts. Stdio and HTTP/SSE transports.
Infrastructure
Infrastructure
Environment config with
.env files. Health checks and metrics endpoints. Cron scheduler. Background task manager. Graceful shutdown. Multi-process cluster mode.Security
Security
TLS via Network.framework. HMAC-SHA256 signed sessions. Input validation with 14 built-in rules. HSTS and security headers. Bearer token authentication.
A Real Example
Here’s a more realistic API — a task manager with database, authentication, and validation:Task Manager API
What Can You Build?
REST APIs
JSON APIs with routing, validation, authentication, rate limiting, and database persistence. Full CRUD in minutes.
Real-Time Apps
Chat applications, live dashboards, collaborative tools — using WebSocket rooms, SSE, and the event bus.
GraphQL Servers
Define schemas, write resolvers, and serve a GraphQL playground — all without leaving Swift.
AI Tool Servers (MCP)
Build MCP-compatible servers that expose tools, resources, and prompts to AI assistants like Claude.
Microservices
Lightweight services with health checks, metrics, tracing, and cluster mode for horizontal scaling.
Full-Stack Swift
Server-rendered HTML with the template engine, static file serving, and session management.
Next Steps
Install Prism
Add Prism to your Swift package and start building. Installation guide →
Build Your First API
Follow the quickstart tutorial to build a REST API from scratch. Quickstart →
Explore Features
Dive into specific features like GraphQL, WebSockets, or Database.