Quickstart
These steps install hpy, create a project and call its starter query on a local instance. Installation and Running locally explain the first three steps in more detail.
You need macOS or Linux (on Windows, use WSL), and the DID of an atproto account to develop with. Use a test account: the local instance writes to that account’s real PDS. pds.rip issues sandbox accounts.
-
Install
hpyfrom itsbetachannel, then check it:brew brew install happyproto/tap/hpy-betahpy --version
For the install script and other package managers, see Install hpy.
-
Create a project:
hpy hpy happyview create --name my-appcreateasks for a Superadmin DID (your test account’s DID), Interpreters (keep the default, Lua), Libraries (none are needed here) and an App name (it defaults tomy-app). It then prints:Output
created /home/you/my-app cd my-app hpy happyview dev
The project contains a query lexicon,
src/lexicons/com/example/hello.json, and the Lua script that answers it,hello.lua. -
Run the project as a local instance:
my-app cd my-apphpy happyview dev
The first run downloads HappyView and the project’s plugins. When the instance is ready,
devprints:Output
happyview dev: serving /home/you/my-app at http://127.0.0.1:3000dashboard: http://127.0.0.1:3000/dashboard/writes from this instance go to your real PDS and the live network, where any instance indexing the same collections, including your production one, will index them; use `hpy happyview dev --network local` to keep test writes private
Leave it running.
-
In another terminal, call the starter query:
curl curl 'http://127.0.0.1:3000/xrpc/com.example.hello?name=Ada'Output
{"message":"Hello, Ada!"}Without
name, the query answers{"message":"Hello, world!"}. Edithello.luaand save it, and the next request runs the new version.
Next steps
Section titled “Next steps”- Running locally: what
devreloads, where it keeps data, and its options, including a local atproto network. - Installation: every install method, each
createprompt, and the filescreatewrites.
© HappyProto

