You can start editing the page by modifying pages/index.tsx
. The page auto-updates as you edit the file.
API routes can be accessed on http://localhost:3000/api/hello. This endpoint can be edited in pages/api/hello.ts
.
The pages/api
directory is mapped to /api/*
. Files in this directory are treated as API routes instead of React pages.
Ozone requires a PDS service to talk to, and it is convenient to point it to a local dev-env
instance for testing during development.
- In the separate atproto project, run the dev server using
yarn workspace @atproto/dev-env start
. This will run a PDS, seeded with some users and data for you. - Run the development server for Ozone using
yarn dev
. This will start running the Ozone frontend athttp://localhost:3000
. - Navigate to the login page in your browser, at http://localhost:3000.
- Login using the atproto dev-env credentials, which you can find here. For development some example login credentials that would work are:
- Service URL: http://localhost:2583
- Account handle: mod.test
- Password: mod-pass
You can also test with different permission levels with the following credentials (/)
- Triage: triage.test/triage-pass
- Triage: admin-mod.test/admin-mod-pass
In the course of development there may be updates to the atproto client that are not yet published to npm, but you would like to use with Ozone. Here's the workflow for using unpublished changes to the @atproto/api package:
-
Ensure the atproto/ project lives as a sibling to the ozone/ project on your filesystem (or adjust the path used in step 4).
~/Documents/bluesky ❯ ls -l total 19856 drwxr-xr-x 22 user group 704 Jan 19 15:51 atproto drwxr-xr-x 24 user group 768 Jan 24 19:17 ozone
-
Checkout whichever branch you'd like to use in atproto/ for the @atproto/api package.
~/Documents/bluesky ❯ cd atproto ~/Documents/bluesky/atproto ❯ git checkout main
-
Build the @atproto/api package in atproto/.
~/Documents/bluesky/atproto ❯ yarn
-
Update the package.json file in ozone/ to reference the local build of @atproto/api.
"dependencies": { - "@atproto/api": "^0.0.3", + "@atproto/api": "link:../atproto/packages/api/dist", "@headlessui/react": "^1.7.7",
-
Ask yarn to reinstall, creating the link from ozone/ to the local build of @atproto/api.
~/Documents/bluesky/ozone ❯ yarn
-
Take care not to check-in the changes to package.json and yarn.lock that came from the temporary linking. When you're done, you can reset everything with:
~/Documents/bluesky/ozone ❯ git checkout package.json yarn.lock && yarn