dAppBooster is a template to help you in the development of blockchain frontend applications. It aims to provide an opinionated set of tools and best practices to speed up the development process and make it more reliable.
Ensure pnpm
is installed (https://pnpm.io/) and clone the repository.
# Clone the repository
git clone git@github.com:BootNodeDev/dAppBooster.git my-dapp
# Change the directory
cd my-dapp
# Checkout the latest release
git checkout main
# Create a local .env file
cp .env.example .env.local
# Install the dependencies
pnpm i
Now you might want to change your project's name and description in the package.json
file.
{
"name": "my-dapp",
"description": "My dApp"
}
Also you might want to change your project's remote repository to a different one.
# Change the remote repository
git remote set-url origin
Configure the appropriate settings in the .env.local
file. Most vars are optional and they should be self-explanatory.
pnpm dev
You can start modifying the content of the home page by editing src/components/pageComponents/home/index.tsx
. The page auto-updates as you edit the file.
You can also modify and see how our Web3 components work in the demos folder.
pnpm build
pnpm preview
src/
: Source code
components/
: Reusable componentscomponents/sharedComponents
: Components shared across multiple pagescomponents/pageComponents
: Components specific to a pageroutes/
: TanStack Router routesstyles/
: App stylesTo add / remove / edit a network supported by the dApp you can do it directly in the networks.config.ts
file.
base
.- import { mainnet, optimismSepolia, sepolia } from 'viem/chains'
+ import { base, mainnet, optimismSepolia, sepolia } from 'viem/chains'
...
- export const chains = [mainnet, optimismSepolia, sepolia] as const
+ export const chains = [base, mainnet, optimismSepolia, sepolia] as const
export const transports: RestrictedTransports = {
...
+ [base.id]: http(env.PUBLIC_RPC_BASE),
}
If you want to use an RPC different from the one provided by wagmi
+ PUBLIC_RPC_BASE=https://base.llamarpc.com
src/env.ts
fileexport const env = createEnv({
client: {
...
+ PUBLIC_RPC_BASE: z.string().optional(),
},
})
Note: if not specified, it will be undefined
making the app to use the wagmi-defined RPC.
If you are developing a production application, we recommend updating the configuration file to enable type aware lint rules:
parserOptions
property like this:export default {
// other rules...
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
}
plugin:@typescript-eslint/recommended
for plugin:@typescript-eslint/recommended-type-checked
or plugin:@typescript-eslint/strict-type-checked
plugin:@typescript-eslint/stylistic-type-checked
If you want to contribute to this project, please read the contributing guidelines. Issues and pull requests are welcome!