🥷 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.
FileVault is a file storage application that allows you to upload files from your local computer and store them on the network. FileVault uses Internet Identity (II) for user login and authentication. Once files are uploaded, they can be downloaded at a later time, or they can be deleted. Each user's files are stored under their Internet Identity principal, so only that principal can access them through the canister's public interface.
- Node.js
- icp-cli:
npm install -g @icp-sdk/icp-cli @icp-sdk/ic-wasm - ic-mops:
npm install -g ic-mops
Clone the example project:
git clone https://github.com/dfinity/examples
cd examples/motoko/filevaultStart the local network, deploy, and run tests:
icp network start -d
icp deploy
bash test.sh
icp network stopInternet Identity sign-in runs against the Internet Identity canister deployed on the local network (
ii: trueinicp.yaml). If signing in fails, update the local network launcher withicp network updateand restart the network.
The frontend is served by the asset canister. To run the Vite dev server with hot reload during frontend development:
npm run devThe backend/backend.did file defines the backend canister's public interface. The frontend TypeScript bindings are auto-generated from this file during the frontend build.
If you modify the backend's public API, regenerate the .did file:
mops generate candid backendIf you base your application on this example, it is recommended that you familiarize yourself with and adhere to the security best practices for developing on ICP. This example may not implement all the best practices.