Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Basic React Frontend

Open in ICP Ninja

🥷 Try it live — no local setup. ICP Ninja is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit Deploy if you're already in Ninja. To build and run it locally instead, follow the steps below.

Overview

A minimal React application hosted entirely onchain on ICP. It demonstrates how to deploy a static frontend as an asset canister — no backend needed.

Project structure

The /frontend folder contains the web assets for the application's user interface, built with React, Vite, and Tailwind CSS. The frontend is deployed as an asset canister — no backend canister is needed.

Build and deploy from the command line

Prerequisites

  • Node.js v18+
  • icp-cli: npm install -g @icp-sdk/icp-cli @icp-sdk/ic-wasm

Install

Clone the example project:

git clone https://github.com/dfinity/examples
cd examples/hosting/react

Deployment

Start the local network:

icp network start -d

Deploy the canister:

icp deploy

icp deploy prints the frontend URL. On the local network it is derived from the canister name:

http://frontend.local.localhost:8000

Stop the local network when done:

icp network stop