First, bootstrap your new project with this example using create-next-app
:
npx create-next-app -e https://github.com/cosmoscontracts/starter-kit my-cosmwasm-dapp
# or
yarn create next-app -e https://github.com/cosmoscontracts/starter-kit my-cosmwasm-dapp
Next, setup your .env
file by copying the example:
cd my-cosmwasm-dapp
cp .env.example .env.local
Then, run the development server:
yarn dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying pages/index.tsx
. The page auto-updates as you edit the file.
In order to interact with a local chain, the easiest way is with docker:
docker run -it \
-p 26656:26656 \
-p 26657:26657 \
-e STAKE_TOKEN=ujunox \
ghcr.io/cosmoscontracts/juno:v2.1.0 \
./setup_and_run.sh juno16g2rahf5846rxzp3fwlswy08fz8ccuwk03k57y
More information can be found in the Juno docs here.
Please ensure you have the Keplr wallet extension installed in your Chrome based browser (Chrome, Brave, etc).
To learn more about Next.js, CosmJS, Keplr, and Tailwind CSS - take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
- CosmJS Repository -JavaScript library for Cosmos ecosystem.
- @cosmjs/cosmwasm-stargate Documentation - CosmJS CosmWasm Stargate module documentation.
- Keplr Wallet Documentation - using Keplr wallet with CosmJS.
- Tailwind CSS Documentation - utility-first CSS framework.
- DaisyUI Documentation - lightweight component library built on tailwindcss.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.