- TypeScript 71%
- JavaScript 21%
- HTML 8%
- CSS <1%
- Shell <1%
- 1 more language <1%
Ziran #
Ziran is a local-first document environment for people who read, organize, and create documents. It uses DASL tiles, which carry the code that edits each document, and supports live collaboration and publishing to the AT Protocol network. You can use the hosted web app today. Desktop apps are not available to download at this time.
Install and run #
Use Ziran in your browser. No desktop download is currently available. To run Ziran from source, use the steps below.
-
Clone the repository:
git clone https://tangled.org/scarnecchia.net/ziran -
Open a terminal and change to the cloned
ziranfolder withcd ziran. -
Run this command:
deno task devThe Ziran window opens when the command works. Close the window or press
Ctrl+Cin the terminal to stop it.
See Developer setup for requirements and other tasks.
Developer setup #
Install Git and Deno 2.9 or newer, then clone this repository. Deno installs the npm packages that the project needs. Node and npm are not required for core development. package.json is for Node-based contrast checks and the screenshot harness.
Run the desktop shell with hot module replacement:
deno task desktop
Run the relay locally:
deno task relay
Run tests. The full suite includes the tile and Spaces tests. Each test prints PASS or FAIL for each check and exits with an error if a check fails.
deno task test:sync
deno task test:tiles
deno task test:spaces
Build project assets or check the TypeScript files:
deno task build:ui
deno task build:tiles
deno task build:webapp
deno lint
Hosted web app origin #
ZIRAN_APP_ORIGIN selects the hosted app origin at build time, not at container runtime. The source default is https://app.ziran.space. Build with the variable unset to use that default:
unset ZIRAN_APP_ORIGIN
deno task build:webapp
For this branch's self-hosted origin, build with:
ZIRAN_APP_ORIGIN=https://ziran.scarnecchia.net deno task build:webapp
Use an HTTPS origin. Ports are allowed, and the build normalizes a trailing slash. Blank values, HTTP URLs, credentials, non-root paths, queries, and fragments are rejected.
The build writes the browser bundle and OAuth client metadata to webapp/site/. Serve the metadata publicly at https://ziran.scarnecchia.net/oauth-client-metadata.json for the custom build. That URL is the OAuth client ID. The OAuth callback is the origin's root URL, https://ziran.scarnecchia.net/, not a separate callback path.
Rebuild the static assets whenever the origin changes, before building the container image. webapp/Dockerfile copies the existing site/ files. A container runtime environment variable cannot change them. A different origin creates a new OAuth client identity, so users must grant consent again.
webapp/service.json still uses app.ziran.space as its production domain. Operators must configure the public host, TLS, and routing to match a custom origin. The build option does not change that host configuration.
The custom bundle is generated locally for this branch's self-hosted origin. The committed webapp/site/index.html references that bundle with a hash-stamped URL. The source default remains generic. Unset ZIRAN_APP_ORIGIN and rebuild to restore the upstream app.ziran.space client identity. These build steps do not deploy the app or verify live authentication.
Other development tasks #
deno task lex:publish publishes the lexicon schemas. deno task devnet:spaces runs the upstream Spaces development network.
The suite and deno task dev need Deno 2.9 or newer. On older Deno versions, undici 8.10 crashes at startup (webidl.util.markAsUncloneable is not a function), and the integration tests that start the app fail with it.
Start with AGENTS.md for the repository map and known issues. Folder-specific AGENTS.md files describe each area. See PRODUCT.md for the product brief and DESIGN.md for the design system. Operators can find self-hosting and deployment details in deploy/AGENTS.md and the website/README.md deployment guide.