I am new to smart-contract development and also new to IC development. I have already followed the motoko tutorials and the introduction to development in IC. My next step was to implement a simple login form (with a react interface) using Internet Identity.
I looked at some tutorials, which were not very satisfying and I came across this repository on github: https://github.com/krpeacock/auth-client-demo but just running the dfx deployment I got this error:
Stderr:
Building canisters before generate for
Motoko
Shrink WASM module size.
Generating type declarations for canister
whoami:
src/declarations/whoami/whoami.did.d.ts
src/declarations/whoami/whoami.did.js
src/declarations/whoami/whoami.did
sh: webpack: command not found
In fact, I just need a good start example, without errors, to guide me to implement the local Internet identity with react as a frontend.
Are there any good repositories to start with?
Anyone gets stuck, here's a working example with multiple frameworks:
https://github.com/krpeacock/auth-client-demo
In particular, you can now add:
To your
dfx.jsonto include it in your own project, while it will also automatically resolve between your local replica ("local testnet") and mainnet when deploying. Then by adding the@dfinity/auth-clientdependency, you can then add the necessary logic to your frontend:Note if using Vite, you'll want to probably use
import.meta.envinstead ofprocess.env; just verify you've got your project's environmental variables configured correctly.