This boilerplate is based on Turborepo. It uses Yarn as a package manager. It includes the following packages/apps:
There are two ways of initializing an app using create-web3-turbo
starter. You can either use this repository as a template or use Turbo's CLI to init your project:
npx create-turbo@latest -e https://github.com/memoriaXII/create-web3-turbo
web
: A Next.js based app with typescript,wagmi,rainbowkit,ether.jscontracts
: hardhat,typescript,chai,ethersstorybook
: storybookui
: a custom shared ui component librarylib
: sdk library for core instancesconfig
: lint and common config configurationstsconfig
:tsconfig.json
s used throughout the monorepohusky
: lint staged pre-commit check
It uses Turborepo and contains:
.github
└─ pull_request_template
└─ workflows
└─ CI
.vscode
└─ Recommended extensions and settings for VSCode users
apps
├─ contracts
|
└─ web
|
└─ storybook
packages
├─ config
| └─ lint config
├─ lib
└─ sdk library for core instances
└─ ui
└─ a custom shared ui component library
This starter kit contains:
- Next.js framework
- WAGMI Hooks advanced web3 react hooks
- ethers.js integrate with blockchain
- Tailwind Utility-First Fundamentals
- Typechain to keep those end-to-end types generated from ABIs
- Hardhat Deploy && compile smart Contracts
I recommend the following extension to make it easy to switch among packages in your mono repo, as well as open multiple under a single workspace. It makes mono repos work well with the test explorer extension.
link: https://marketplace.visualstudio.com/items?itemName=folke.vscode-monorepo-workspace
git clone https://github.com/memoriaXII/turborepo-web3-starter-kit.git
cd turborepo-web3-starter-kit
yarn install
yarn dev
yarn hardhat:compile
yarn hardhat:node
yarn hardhat:test
yarn storybook
yarn build-storybook
This repo is configured to be built with Docker, and Docker compose. To build all apps in this repo:
# Create a network, which allows containers to communicate
# with each other, by using their container name as a hostname
docker network create app_network
# Build prod using new BuildKit engine
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose -f docker-compose.yml build --parallel
# Start prod in detached mode
docker-compose -f docker-compose.yml up -d
Open http://localhost:3000.
To shutdown all running containers:
# Stop all running containers
docker kill $(docker ps -q) && docker rm $(docker ps -a -q)