Clone this repo and run:
npm install
# or
yarn
Run the development server:
npm run dev
# or
yarn dev
Open http://localhost:3000/apps/myappname with your browser to see the result.
Setup and run a local fake Urbit ship containing your app, see the resources below for Urbit development guides.
Allow cross-origin requests on your ship. This project loads at localhost:3000
by default so run the following in your urbit dojo:
|cors-approve 'http://localhost:3000'
Set the environment variables for your local ship in .env.development.local
. Copy the example file from this project, or use the following example below. Adjust the values to match your local setup.
NEXT_PUBLIC_URBIT_SHIP_NAME=zod
NEXT_PUBLIC_URBIT_SHIP_URL=localhost:8080
NEXT_PUBLIC_URBIT_SHIP_CODE=lidlut-tabwed-pillex-ridrup
Edit basePath
in next.config.mjs
to match your app name:
const basePath = '/apps/myappname'
You will need to visit localhost:3000/apps/myappname
to view your app during development.
There is a local only redirect setup for this url by default. If you do not like the warnings this generates, go ahead and remove it from next.config.mjs
Build and export your project by running:
npm run build
# or
yarn build
This is a client side only app, so the server side features of Next.js are not supported, and next export
is used in the build process. This document explains what features are supported with this approach:
Your project will be exported to out/
in the project directory. This is the client side bundle you will include in your app.
Glob the out/
directory following the instructions at: Urbit Developers - Glob
To learn app development on Urbit, follow the guides here:
To learn more about Next.js, take a look at the following resources:
You are welcome to bring questions and comments to ~nodreb-borrus
on Urbit or 𝕏. Thank you for supporting urbit.me.