This is a template for creating a Next.js app with a Motoko backend that can be deployed to the Internet Computer.
- Install the DFINITY Canister SDK
- Install Node.js
Installing dependencies:
-
Run
yarn install:all
ornpm run install:all
it will run the following commands:Install Node.js dependencies:
- Run
yarn install
ornpm install
Running Local Internet Computer:
- Run
yarn dfx:start
ornpm run dfx:start
Deploying to the Local Internet Computer:
3.1 Run yarn dfx:pull
or npm run dfx:pull
3.2 Run yarn dfx:identity
or npm run dfx:identity
3.3 Run yarn deploy
or npm run deploy
Running Next.js app:
- Run
yarn dev
ornpm run dev
- Open http://localhost:3000 in your browser
- Run
yarn deploy --network=ic
to deploy the canisters to the Internet Computer
- The Motoko code is located in the
backend
directory - The Next.js code is located in the
src
directory - The canister configuration is located in the
dfx.json
file