A full-stack Internet Computer application with React frontend and Motoko backend.
# Deploy to local IC replica
./deploy.sh
# Deploy to IC mainnet
./deploy-ic.sh├── src/
│ ├── frontend/ # React TypeScript frontend
│ └── backend/ # Motoko backend canister
├── deploy.sh # Local deployment script
├── deploy-ic.sh # Mainnet deployment script
├── dfx.json # DFX configuration
└── package.json # Frontend dependencies
-
Start local development:
./deploy.sh
This will:
- Start local IC replica
- Deploy backend canister
- Build and deploy frontend
- Show you the local URLs
-
Development server only:
npm run dev
Your project includes a .env file with configuration:
# Network configuration
VITE_DFX_NETWORK=local
# Canister IDs (auto-generated)
VITE_CANISTER_ID_BACKEND=
CANISTER_ID_BACKEND=
VITE_CANISTER_ID_FRONTEND=
CANISTER_ID_FRONTEND=
For development and testing:
./deploy.shWhat it does:
- Starts local IC replica
- Deploys backend canister locally
- Builds React frontend
- Deploys frontend assets
- Creates local
.envconfiguration - Shows local URLs
For production deployment to Internet Computer mainnet:
./deploy-ic.shWhat it does:
- Checks your DFX identity and wallet
- Confirms you want to deploy to mainnet (costs cycles)
- Builds production frontend
- Deploys to IC mainnet
- Creates
.env.productionconfiguration - Shows live URLs
- You need ICP cycles for deployment
- Make sure you have a funded wallet
- Monitor cycles consumption at NNS
# Call backend functions
dfx canister call backend <function_name>
# Check canister status
dfx canister status backend
# Check canister logs
dfx canister logs backend# Check all canister IDs
dfx canister id --all
# Check cycles balance
dfx wallet balance
# Top up canister with cycles
dfx canister deposit-cycles <amount> <canister-id># Install dependencies
npm install
# Start development server
npm run dev
# Build frontend
npm run build
# Lint code
npm run lint- Make changes to your frontend or backend code
- Redeploy locally:
./deploy.sh
- Deploy to mainnet when ready:
./deploy-ic.sh
DFX not found:
# Install DFX
sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)"Port already in use:
# Stop existing replica
dfx stop
# Clean and restart
dfx start --clean --backgroundDeployment fails:
# Clean build and try again
dfx stop
rm -rf .dfx
./deploy.shOut of cycles on mainnet:
- Check your wallet balance:
dfx wallet balance --network ic - Top up at NNS
- Customize your frontend in
src/frontend/ - Add backend functions in
src/backend/main.mo - Test locally with
./deploy.sh - Deploy to mainnet with
./deploy-ic.sh
Happy building on the Internet Computer! 🚀