Clone this repo and run:
npm install
# or
yarn
Run the development server:
npm run dev
# or
yarn dev
Open http://localhost:3000/apps/novel 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
You will need to visit
localhost:3000/apps/novel
to view your app during development.
Build and export your project by running:
npm run build
# or
yarn build
This is a client side only app, so we cannot use the server side features of Next.js, and we use next export
in our build process. This document explains what features can and cannot be used with this approach: Static HTML Export
Your project will be exported to out/
in your project directory. This is the client side bundle you will include in your app.
To add this bundle to your Urbit app, visit http://localhost:8080/docket/upload
. Select the novel desk for your app, and choose your apps out/
directory for upload.
To learn app development on Urbit, follow the guides here:
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You are welcome to bring questions and comments to the urbit.me Discord or to ~nodreb-borrus
on Urbit. Thank you for supporting urbit.me.