Write the lexicon. HappyView serves the API.
An open-source AppView for atproto. Each query or procedure lexicon becomes an XRPC endpoint, a short Lua, JavaScript or TypeScript script answers it, and HappyView indexes your records.
Lexicons in, XRPC out
This is the heart of the project hpy happyview create gives you. The lexicon’s path is its route, and the script beside it answers it.
Change the script, save it and call it again: the new version answers, with no restart.
happyview.toml
# A HappyView project. `hpy happyview dev` runs it; happyview.lock pins
# the exact plugin versions, and `hpy happyview add` edits both files.
[happyview]
version = "3.0.0-alpha.42"
[instance]
app_name = "statusboard"
superadmin = "did:plc:your-did-here"
[interpreters]
lua = { did = "did:plc:mo7vq4jbioxwafy5zkcc3eux", name = "happyview-lua", channel = "alpha" }
[libraries]
[dev]
backfill = falsesrc/lexicons/com/example/hello.json
{
"lexicon": 1,
"id": "com.example.hello",
"defs": {
"main": {
"type": "query",
"description": "Says hello. The file's path is its route: rename the file and this id together.",
"parameters": {
"type": "params",
"properties": {
"name": { "type": "string", "maxLength": 64 }
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["message"],
"properties": {
"message": { "type": "string" }
}
}
}
}
}
}src/lexicons/com/example/hello.lua
-- Answers com.example.hello. Save this file and the next request runs it.
function handle(input, ctx)
return { message = "Hello, " .. (input.name or "world") .. "!" }
end$ hpy happyview dev
$ curl 'http://127.0.0.1:3000/xrpc/com.example.hello?name=Ada'
{"message":"Hello, Ada!"}What you get
Lexicons are your API
Add a query or procedure lexicon and its NSID is a live XRPC route. There is no router to keep in sync.
Lua, JavaScript or TypeScript
Each language is an interpreter plugin from the registry. Install the ones your scripts are written in.
React to the network
Run a script when a record is created, updated, deleted or labeled, and backfill what came before.
Jobs for slow work
Background jobs report progress, can be paused or cancelled, and aren’t bound by a request’s time limit.
Plugins declare their capabilities
HappyView checks what each WebAssembly plugin imports against what it declares, and shows you before you install.
Tests run in process
hpy happyview testfires queries, procedures, record events and jobs, with nothing on the live network.
Run it yourself, or let HappyProto run it
It’s the same HappyView and the same project either way.
Self-host
- MIT licensed. The source, issues and releases are on GitHub.
- A single binary for macOS, Linux and Windows, or a Docker image.
- SQLite or Postgres.
- You run the server, TLS, upgrades and backups, and install the interpreters you need.
HappyProto
- Your instance at your-app.hpy.at, with Lua already installed.
- Deploy a project from your terminal with
hpy happyview deploy(hpy 1.0 beta). - Three plan sizes, from 512 MB of memory and 5 GB of storage.
- In beta now, by invite.
From the blog
All postsHappyView v2.16
HappyView becomes the authority for its own spaces, credentials get signed requests, and space sync goes both ways.
HappyView v2.15
Catching up on atproto spaces, interop tests for every PDS that supports them, and automatic space migration.
HappyView v2.14
Confidential OAuth clients, opt-in telemetry, and a proxy that finally does what it says.