Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Next.js starter template for the Internet Computer with Motoko canisters, React frontend, and image upload example.

A full-stack Next.js TypeScript template focused on functionality over UI, featuring Zustand, TanStack Query, and ESLint 9 support.
nextjs-ic-starter is a boilerplate for building full-stack decentralized applications on the Internet Computer with a Next.js React frontend, Motoko backend canisters, and DFX deployment scripts.
nextjs-ic-starter is a starter template that pairs a Next.js 15.2.0 frontend with two Motoko canisters: a hello canister that returns a greeting and an ImageBucket canister that stores, retrieves, and deletes images. It requires DFX 0.25.0 and NodeJS 22.12.0, and it includes a live demo deployed to the IC mainnet at https://u4gun-5aaaa-aaaah-qabma-cai.raw.ic0.app. The template is authored by Henry Chan and released under the MIT license.
useImageObject hook.actor-locator.js reads the NEXT_PUBLIC_IC_HOST environment variable to set the DFX agent host, so the same code works locally and on the IC network.dfx generate, you copy the generated declaration files into ui/declarations and change variable names to use the NEXT_PUBLIC_ prefix./ui/styles and use CSS modules rather than a CSS framework.npm run build exports the Next.js app to /out, which dfx deploy hello_assets uploads to the frontend canister.useImageObject hook to upload, persist, and retrieve images on-chain.After cloning the repository, you start a local DFX server with dfx start --background, install dependencies with npm install, deploy the canisters locally with dfx deploy --network local, and run the Next.js dev server with npm run dev. The frontend calls canister methods through async actors generated by dfx generate and bridged by the service locator.
Yes, nextjs-ic-starter is open source and released under the MIT license. You can use, modify, and redistribute it freely, including in commercial projects.
You need ICP tokens converted to cycles and a cycles wallet. Then copy .env.icprod to .env.production, run dfx deploy --network ic, and open the returned canister ID at https://[canisterId].raw.ic0.app/.
Yes. The generated UI declarations in src/declarations include TypeScript definitions. The template itself uses JavaScript, but you can use the declarations in a TypeScript Next.js project.
The template requires NodeJS 18 or higher, the DFX CLI, and Visual Studio Code with the Motoko extension for editing backend code. The provided install command for DFX is sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)".
Check the Chrome DevTools console and network tab to verify that the frontend is using the correct canister ID and that the DFX host environment variable matches your deployment target (local or mainnet).