Highly ambitious ATProtocol AppView service and sdks
Introduction#
Slices is an open source platform for building structured data applications on the AT Protocol network.
What is Slices?#
Slices lets you define custom data schemas and build applications that store, query, and sync structured records across the decentralized AT Protocol network. Think of it as a schema-first backend that automatically handles data validation, indexing, and cross-network synchronization.
Quick Start#
Get started in under a minute:
# Install the CLI globally
deno install -g -A jsr:@slices/cli --name slices
# Initialize a new slice project
slices init my-app
# Start developing
cd my-app
deno task dev
The slices init command creates a full-stack Deno app with OAuth
authentication, automatically creates your slice on the network, and generates a
type-safe TypeScript SDK.
Simple Example#
Define a schema for vinyl albums:
{
"lexicon": 1,
"id": "com.recordcollector.album",
"defs": {
"main": {
"type": "record",
"record": {
"type": "object",
"required": ["title", "artist", "releaseDate"],
"properties": {
"title": { "type": "string" },
"artist": { "type": "string" },
"releaseDate": { "type": "string", "format": "datetime" },
"genre": { "type": "array", "items": { "type": "string" } },
"condition": { "type": "string" }
}
}
}
}
}
Push your lexicon and regenerate the SDK:
# Push your lexicon to the slice
slices lexicon push
# Regenerate TypeScript SDK
slices codegen
Use the auto-generated, type-safe client:
import { AtprotoClient } from "./generated_client.ts";
const client = new AtprotoClient({
baseUrl: "https://api.slices.network",
sliceUri: "at://your-slice-uri",
});
// Get all grunge albums
const albums = await client.com.recordcollector.album.getRecords({
where: { genre: { contains: "grunge" } },
sortBy: [{ field: "releaseDate", direction: "desc" }],
});
Key Features#
- Schema Validation: Define lexicons that enforce data structure and constraints
- Auto-generated APIs: REST endpoints created automatically from your schemas
- TypeScript SDKs: Type-safe clients generated from your lexicons
- Real-time Sync: Automatic synchronization across the AT Protocol network
- Advanced Querying: Filter, sort, and paginate records with a powerful query API
- OAuth Built-in: Authentication with any AT Protocol account
When to Use Slices#
Slices is ideal for:
- Social Applications: Build specialized communities, forums, or social features
- Content Platforms: Create blogs, documentation sites, or media libraries
- SaaS Products: Develop collaborative tools with structured data needs
- Web APIs: Design REST APIs with automatic validation and documentation
- Decentralized Apps: Build on AT Protocol without managing infrastructure
Next Steps#
- Getting Started - Set up your first slice
- Core Concepts - Understand lexicons and collections
- API Reference - Explore the full API