View this sample's code on GitHub
A minimal React application hosted entirely onchain on ICP. It demonstrates how to deploy a static frontend as an asset canister — no backend needed.
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.
This example can be deployed directly from ICP Ninja, a browser-based IDE for ICP. To continue developing locally after deploying from ICP Ninja, see BUILD.md.
Note: ICP Ninja currently uses
dfxunder the hood, which is why this example includes adfx.jsonconfiguration file.dfxis the legacy CLI, being superseded by icp-cli, which is what developers should use for local development.
Clone the example project:
git clone https://github.com/dfinity/examples
cd examples/hosting/reactStart the local network:
icp network start -dDeploy the canister:
icp deployThe URL for the frontend depends on the canister ID. When deployed, the URL will look like this:
http://{canister_id}.localhost:8000
Stop the local network when done:
icp network stop