This project provides a simple starter template for Dfinity Internet Computer using React.js framework as frontend, with Vite for fast development.
Backend
- A simple greeting hello world canister written in Motoko
Frontend
- A simple React HTML form with name input, sending it to greet canister and showing the returned result
- A button to interact with react state
Install:
- NodeJS 18.* or higher
- Internet Computer dfx CLI
- Visual Studio Code (Recommended Code Editor)
- VSCode extension - Motoko (Recommended)
sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)"
Clone this Git repository:
git clone https://github.com/rafael-abuawad/icp-starter-template
Open command terminal: Enter the commands to start dfx local server in background:
cd icp-starter-template
dfx start --background
Note: If you run it in MacOS, you may be asked to allow connections from dfx local server.
Enter the commands to install dependencies, deploy canister and run Next.js dev server:
npm install
dfx deploy
npm run dev
Cleanup - stop dfx server running in background:
dfx stop
Rafael Abuawad Twitter: @0xAbuawad
Please feel free to raise an issue or submit a pull request.
MIT