{"id":18556795,"url":"https://github.com/urbit/docs-examples","last_synced_at":"2026-01-21T08:38:28.905Z","repository":{"id":37392866,"uuid":"475764962","full_name":"urbit/docs-examples","owner":"urbit","description":"Example apps and other code used in urbit.org documentation","archived":false,"fork":false,"pushed_at":"2024-03-11T11:33:31.000Z","size":877,"stargazers_count":14,"open_issues_count":4,"forks_count":8,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-12-26T09:41:52.439Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"hoon","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/urbit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-30T07:22:30.000Z","updated_at":"2023-10-10T14:15:56.000Z","dependencies_parsed_at":"2024-03-11T12:53:07.256Z","dependency_job_id":null,"html_url":"https://github.com/urbit/docs-examples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urbit%2Fdocs-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urbit%2Fdocs-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urbit%2Fdocs-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urbit%2Fdocs-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/urbit","download_url":"https://codeload.github.com/urbit/docs-examples/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239281428,"owners_count":19612861,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T21:33:23.346Z","updated_at":"2025-11-01T10:30:30.967Z","avatar_url":"https://github.com/urbit.png","language":"hoon","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Urbit Developer Examples #\n\nThis repo contains the source for the following examples presented in the\n[Urbit developer documentation][devdoc]:\n\n| Example Directory | Example Desk | Interface Type |\n|:------------------|:-------------|:---------------|\n| chat-app          | %hut         | React (JS)     |\n| groups-app        | %squad       | Sail (Hoon)    |\n| journal-app       | %journal     | React (JS)     |\n| voting-app        | %tally       | Sail (Hoon)    |\n\nIn the documentation that follows, the following shorthands are used:\n\n- `/path/to/X/`: The path to directory `X` on your local machine.\n- `example-directory`: The directory of an example in the source tree of this\n  repository (see the table above).\n- `example-desk`: The Urbit desk name of an example in this repository (see\n  the table above).\n\n## Install ##\n\nEach developer example is hosted on `~pocwet` and available for direct install\nvia Urbit software distribution. To install the example on your ship, enter the\nfollowing commands into your ship's `webterm` or `dojo`:\n\n```bash\n|install ~pocwet %example-desk\n|mount %example-desk\n```\n\nYou can then view the files associated with this example on your machine at the\nfile path `/path/to/ship/example-desk`. Please note that this method **will only\ninstall Hoon files**; to view and experiment with React front-end files, please\nread on.\n\n## Build ##\n\n### First-time Setup ###\n\nTo build one of these example from scratch (which is essential for React\ndevelopment), follow these instructions:\n\n1. Download and extract the repo source code [from GitHub][gitsrc], e.g.\n   at `/path/to/repo-source/`.\n2. Follow the instructions for [creating a fake ship][fakeship], e.g.\n   hosting it at `/path/to/fake-ship/`.\n3. When booting up your fake ship, take note of the following line in\n   the introductory digest:\n   ```\n   http: web interface live on http://localhost:XYZ\n   ```\n   The `XYZ` string on this line is port number your ship is using for its HTTP\n   interface. Save this string for use in the subsequent steps.\n4. In your fake ship's `dojo`, enter the following commands:\n   ```\n   |new-desk %example-desk\n   |mount %example-desk\n   ```\n5. In a separate terminal session, enter the following commands:\n   ```bash\n   rm -rI /path/to/fake-ship/example-desk/*\n   cp -RL /path/to/repo-source/example-directory/full-desk/* /path/to/fake-ship/example-desk/\n   ```\n6. Back in your fake ship's `dojo`, enter the following commands:\n   ```\n   |commit %example-desk\n   |install our %example-desk\n   ```\n7. Again in your fake ship's `dojo`, run the following command and copy the\n   result:\n   ```\n   +code\n   ```\n   This is your fake ship's password, which will be used for authentication\n   from your web browser.\n8. Open a web browser and navigate to the HTTP address discussed in step 3.\n9. Paste the ship's password from step 7 into the form that appears and hit\n   enter.\n0. If the installation was successful, you should see a tile for the example\n   on the home page that appears.\n\nIf the example has a React interface, further follow these instructions to\nset up a locally-hosted front-end interface:\n\n11. In a terminal session, enter the following commands (where `XYZ` is from\n    step 3):\n    ```bash\n    cd /path/to/repo-source/example-directory/ui/\n    npm install\n    echo \"VITE_SHIP_URL=http://127.0.0.1:XYZ\" \u003e\u003e .env.local\n    npm run dev\n    ```\n    The final command will generate a text digest containing a line of the form:\n    ```\n    \u003e Local: http://localhost:ABC/apps/example-desk/\n    ```\n    The web address listed here is hosting location for your local React\n    interface. Save this string for use in the subsequent steps.\n12. Open a web browser and navigate to the web address from the step 11.\n    If the local hosting was successful, you should see the interface for the\n    example in your browser.\n\n### Editing and Rebuilding ###\n\nOnce the base infrastructure for an example project is in place, making changes\nis very simple.\n\nFor **React front-end development**, just make sure to run `npm run dev` in a\nterminal and to visit the output \"local\" address for testing; the page will\nautomatically update as you edit your React files.\n\nFor **Sail front-end development and back-end development**, the process is only\nslightly more complicated:\n\n1. If you're editing the files in-place (i.e. in\n   `/path/to/fake-ship/example-desk/`), you can skip this step. If you're\n   editing files from the source tree\n   (i.e. in `/path/to/repo-source/example-directory/full-desk/`), you'll need\n   to copy the files to your ship with the following terminal commands:\n   ```bash\n   rm -rI /path/to/fake-ship/example-desk/*\n   cp -RL /path/to/repo-source/example-directory/full-desk/* /path/to/fake-ship/example-desk/\n   ```\n2. From within your fake ship's `dojo`, enter one of the following command\n   sequences based on your changes:\n   - If you didn't make any changes to the example app's data model:\n     ```\n     |commit %example-desk\n     ```\n   - If you did make changes to the example app's data model (e.g. via `/sur`\n     file changes, app `state` changes, etc.):\n     ```\n     |nuke %example-desk\n     |commit %example-desk\n     ```\n\n\n[CORS]: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS\n[devdoc]: https://developers.urbit.org\n[gitsrc]: https://github.com/urbit/docs-examples/archive/refs/heads/main.zip\n[fakeship]: https://developers.urbit.org/guides/core/environment#creating-a-fake-ship\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furbit%2Fdocs-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Furbit%2Fdocs-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furbit%2Fdocs-examples/lists"}