Skip to content
v3 alpha

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.

Needs hpy, HappyProto’s CLI (beta)

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 = false

src/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!"}

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.
Self-host HappyView

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.
Join the HappyProto beta