Auto-indexing service and GraphQL API for AT Protocol Records quickslice.slices.network/
atproto gleam graphql
at main 145 lines 3.4 kB view raw view rendered
1<div align="center"> 2 <img src="slices_and_lucy.png" alt="Slices and Lucy" width="201"> 3</div> 4 5# quickslice 6 7Quickslice is a quick way to spin up an [AppView](https://atproto.com/guides/glossary#app-view) for AT Protocol applications. Import your Lexicon schemas and you get a GraphQL API with OAuth authentication, real-time sync from the network, and joins across record types without setting up a database or writing any backend code. 8 9> **Warning** 10> This project is in early development. APIs may change without notice. 11 12## What Quickslice Does 13 14- **Connects to Jetstream** and tracks the record types defined in your Lexicons 15- **Indexes** relevant records into a database (SQLite or Postgres) 16- **Generates GraphQL** queries, mutations, and subscriptions from your Lexicon definitions 17- **Handles OAuth** and writes records back to the user's PDS 18- **Enables joins** by DID, URI, or strong reference, so you can query a status and its author's profile in one request 19 20## Example 21 22The status lexicon (`xyz.statusphere.status`): 23 24```json 25{ 26 "lexicon": 1, 27 "id": "xyz.statusphere.status", 28 "defs": { 29 "main": { 30 "type": "record", 31 "key": "tid", 32 "record": { 33 "type": "object", 34 "required": ["status", "createdAt"], 35 "properties": { 36 "status": { 37 "type": "string", 38 "minLength": 1, 39 "maxGraphemes": 1, 40 "maxLength": 32 41 }, 42 "createdAt": { "type": "string", "format": "datetime" } 43 } 44 } 45 } 46 } 47} 48``` 49 50Querying the status records: 51 52```graphql 53query { 54 xyzStatusphereStatus( 55 first: 50 56 sortBy: [ 57 { field: createdAt, direction: DESC } 58 ] 59 where: { 60 status: { contains: "👍" } 61 } 62 ) { 63 edges { 64 node { 65 uri 66 did 67 status 68 createdAt 69 } 70 cursor 71 } 72 pageInfo { 73 hasNextPage 74 endCursor 75 } 76 } 77} 78``` 79 80## Quick Start 81 82### Docker 83 84Run Quickslice locally with Docker: 85 86```bash 87docker compose up --build 88``` 89 90Open http://localhost:8080 and login with your Bluesky handle. 91 92For PostgreSQL instead of SQLite: 93 94```bash 95docker compose -f docker-compose.postgres.yml up --build 96``` 97 98### Native Development 99 100For development without Docker: 101 102**Prerequisites:** 103- [Gleam](https://gleam.run/getting-started/installing/) v1.13+ 104- [dbmate](https://github.com/amacneil/dbmate) for migrations 105- Node.js 18+ (for client build) 106 107**Setup:** 108 109```bash 110# Server 111cd server 112cp .env.example .env 113make db-setup-sqlite 114gleam run 115 116# Client (rebuild after changes) 117cd client 118npm install 119gleam run -m lustre/dev build 120``` 121 122See [server/README.md](server/README.md) for detailed configuration. 123 124## Documentation 125 126- [Queries](docs/guides/queries.md) 127- [Joins](docs/guides/joins.md) 128- [Mutations](docs/guides/mutations.md) 129- [Subscriptions](docs/reference/subscriptions.md) 130- [Blobs](docs/reference/blobs.md) 131- [Variables](docs/reference/variables.md) 132- [Deployment](docs/guides/deployment.md) 133 134## Structure 135 136- `server/` - Main server with database layer, GraphQL API, and Jetstream ingestion 137- `lexicon_graphql/` - GraphQL schema generation from AT Protocol Lexicons 138- `atproto_car/` - CAR (Content Addressable aRchive) file parsing for backfills 139- `client/` - Web-based GraphQL playground and admin UI 140- `quickslice-client-js/` - JavaScript client library 141- `www/` - Documentation website 142 143## License 144 145Apache License 2.0