Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ This repository uses our recommended hardhat setup, by using our [`@nomicfoundat
- Get metrics on the gas used by your contracts with the [hardhat-gas-reporter](https://github.com/cgewecke/hardhat-gas-reporter) plugin.
- Measure your tests coverage with [solidity-coverage](https://github.com/sc-forks/solidity-coverage).

This project also includes [a sample frontend/Dapp](./frontend), which uses [Create React App](https://github.com/facebook/create-react-app).
This project also includes [a sample frontend/Dapp](./frontend), which uses [Create React App](https://github.com/facebook/create-react-app) and also if you prefer to use [Vite](https://vitejs.dev/), you can check out [vite-hardhat-boilerplate](https://github.com/NomicFoundation/hardhat-boilerplate/tree/vite-hardhat-boilerplate) branch as well.

## Looking for Vite?

If you prefer to use [Vite](https://vitejs.dev) instead of `create-react-app`, you can check out the [vite-hardhat-boilerplate](https://github.com/NomicFoundation/hardhat-boilerplate/tree/vite-hardhat-boilerplate) branch for more details!

## Troubleshooting

Expand All @@ -85,6 +89,6 @@ This project also includes [a sample frontend/Dapp](./frontend), which uses [Cre

If you need help with this project, or with Hardhat in general, please read [this guide](https://hardhat.org/hardhat-runner/docs/guides/getting-help) to learn where and how to get it.

For the latest news about Hardhat, [follow us on Twitter](https://twitter.com/HardhatHQ), and don't forget to star [our GitHub repository](https://github.com/NomicFoundation/hardhat)!
For the latest news about Hardhat, [follow us on Twitter](https://twitter.com/HardhatHQ), and don't forget to star [our GitHub repository](https://github.com/NomicFoundation/hardhat-boilerplate/tree/vite-hardhat-boilerplate)!

**Happy _building_!**
15 changes: 15 additions & 0 deletions frontend/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
],
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
settings: { react: { version: '18.2' } },
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': 'warn',
},
}
12 changes: 6 additions & 6 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Sample React Dapp
# Sample React Dapp + Vite

This directory has a sample Dapp to interact with your contracts, built using
React.
React + Vite.

## Running the Dapp

This project uses [`create-react-app`](https://create-react-app.dev/), so most
This project uses [`vite`](https://vitejs.dev/) instead of `create-react-app`, so most
configuration files are handled by it.

To run it, you just need to execute `npm start` in a terminal, and open
To run it, you just need to execute `npm run dev` in a terminal, and open
[http://localhost:3000](http://localhost:3000).

To learn more about what `create-react-app` offers, you can read
[its documentation](https://create-react-app.dev/docs/getting-started).
To learn more about what `vite` offers, you can read
[its documentation](https://vitejs.dev/guide).

## Architecture of the Dapp

Expand Down
1 change: 1 addition & 0 deletions frontend/assets/react.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions frontend/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
<link rel="apple-touch-icon" href="/logo192.png" />
<meta name="description" content="Hardhat React + Vite Dapp" />
<link rel="manifest" href="/manifest.json" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Hardhat + React App = DApp</title>
</head>

<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>

</html>
Loading