This repository has been archived by the owner on Nov 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit bca6fa2
Showing
55 changed files
with
14,553 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# dependencies | ||
**/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# yarn | ||
.pnp.* | ||
.yarn/* | ||
yarn.lock | ||
.yarnrc | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
.pnpm-debug.log* | ||
|
||
# local env files | ||
.env | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
# vercel | ||
.vercel | ||
.gitsigners | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
|
||
# turbo | ||
.turbo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
export NVM_DIR="$HOME/.nvm" | ||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" | ||
|
||
npx lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"*.{js,jsx,ts,tsx}": ["eslint --fix", "prettier --write"], | ||
"*.{md,html,css,json}": "prettier --write" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
strict-peer-dependencies = false | ||
auto-install-peers = true | ||
enable-pre-post-scripts = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"semi": false, | ||
"singleQuote": true, | ||
"trailingComma": "es5", | ||
"printWidth": 100, | ||
"tabWidth": 2, | ||
"useTabs": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"folders": [ | ||
{ | ||
"name": "_ROOT", | ||
"path": "../" | ||
}, | ||
{ | ||
"name": "Frontend", | ||
"path": "../packages/frontend" | ||
}, | ||
{ | ||
"name": "Hardhat", | ||
"path": "../packages/hardhat" | ||
} | ||
], | ||
"settings": { | ||
"files.exclude": { | ||
"**/node_modules/": true, | ||
"**/package-lock.json": true, | ||
"**/pnpm-lock.yaml": true, | ||
"**/yarn.lock": true, | ||
"**/yarn-error.log": true, | ||
"**/.yarn": true, | ||
"**/.turbo": true, | ||
"**/.next": true, | ||
"packages/hardhat/cache": true | ||
}, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.organizeImports": true, | ||
"source.fixAll.eslint": true | ||
}, | ||
"peacock.color": "#00f5d4", | ||
"workbench.colorCustomizations": { | ||
"sash.hoverBorder": "#29ffe2", | ||
"statusBar.background": "#00f5d4", | ||
"statusBar.foreground": "#15202b", | ||
"statusBarItem.hoverBackground": "#00c2a8", | ||
"statusBarItem.remoteBackground": "#00f5d4", | ||
"statusBarItem.remoteForeground": "#15202b" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"recommendations": [ | ||
"dbaeumer.vscode-eslint", | ||
"esbenp.prettier-vscode", | ||
"mikestead.dotenv", | ||
"NomicFoundation.hardhat-solidity" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2022 | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# ETHathon Smart Contract & dApp Development Boilerplate | ||
|
||
![Typescript](https://img.shields.io/badge/Typescript-blue) | ||
![Hardhat](https://img.shields.io/badge/Hardhat-yellow) | ||
![Next.js](https://img.shields.io/badge/Next.js-gray) | ||
![Tailwind](https://img.shields.io/badge/Tailwind-pink) | ||
|
||
This is a very opinionated boilerplate/starterkit/scaffold to get up and running with smart contract & dApp development. Comes in handy for hackathons. 👀 | ||
|
||
By [Dennis Zoma](https://twitter.com/dennis_zoma) 🤠 | ||
|
||
## Disclaimer | ||
|
||
This is **work-in-progress** and there are many open tasks: | ||
|
||
- [ ] Remove packages that are not actually used | ||
- [ ] Give in instructions on how to initialize this (where to replace placeholder string etc.) | ||
- [ ] Show a sample contract-interaction and build a very basic default layout | ||
- [ ] Make Turborepo Configuration less verbose | ||
|
||
## The Stack | ||
|
||
- Package-Manager: `pnpm` | ||
- Monorepo Tooling: `turborepo` | ||
- Smart Contract Development: `hardhat` | ||
- TS-Types: `typechain` | ||
- Frontend: `next` | ||
- Contract Interactions: `wagmi`, `rainbowkit` | ||
- Styling: `tailwindcss` | ||
- Styled Components: `twin.macro`, `emotion` | ||
- Linting on Git Hooks: `husky`, `lint-staged` | ||
|
||
## Getting Started | ||
|
||
```bash | ||
# Install pnpm | ||
npm i -g pnpm | ||
|
||
# Install dependencies | ||
pnpm install | ||
|
||
# Copy & fill environments | ||
cp packages/frontend/.env.local.example packages/frontend/.env.local | ||
cp packages/hardhat/.env.example packages/hardhat/.env | ||
``` | ||
|
||
## Development | ||
|
||
```bash | ||
# Generate contract-types & start frontend with turborepo | ||
pnpm dev | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"name": "@ethathon/monorepo", | ||
"version": "0.0.1", | ||
"license": "MIT", | ||
"private": true, | ||
"workspaces": [ | ||
"packages/*" | ||
], | ||
"scripts": { | ||
"dev": "turbo run dev", | ||
"build": "turbo run build", | ||
"format": "turbo run format", | ||
"frontend:dev": "pnpm --filter frontend dev", | ||
"frontend:start": "pnpm --filter frontend start", | ||
"prepare": "husky install" | ||
}, | ||
"devDependencies": { | ||
"husky": "^8.0.1", | ||
"lint-staged": "^13.0.3", | ||
"turbo": "^1.3.1", | ||
"typescript": "^4.7.4", | ||
"next": "^12.2.2" | ||
}, | ||
"pnpm": { | ||
"overrides": { | ||
"react-query": "4.0.0-beta.23" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module.exports = { | ||
presets: [ | ||
[ | ||
'next/babel', | ||
{ | ||
'preset-react': { | ||
runtime: 'automatic', | ||
importSource: '@emotion/react', | ||
}, | ||
}, | ||
], | ||
], | ||
plugins: ['@emotion/babel-plugin', 'babel-plugin-macros'], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
NEXT_PUBLIC_PRODUCTION_MODE=false | ||
NEXT_PUBLIC_URL=http://localhost:3000 | ||
|
||
NEXT_PUBLIC_DEFAULT_CHAIN=1337 | ||
NEXT_PUBLIC_SUPPORTED_CHAINS=[1337, 4] | ||
|
||
NEXT_PUBLIC_RPC_HARDHAT=TODO | ||
NEXT_PUBLIC_RPC_RINKEBY=TODO | ||
NEXT_PUBLIC_RPC_MAINNET=TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
**/node_modules/* | ||
**/out/* | ||
**/.next/* | ||
**/artifacts/* | ||
**/sql/* | ||
**/public/* | ||
**/types/typechain/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"root": true, | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": ["@typescript-eslint"], | ||
"extends": [ | ||
"eslint:recommended", | ||
"next/core-web-vitals", | ||
"plugin:@typescript-eslint/recommended", | ||
"prettier" | ||
], | ||
"rules": { | ||
"@typescript-eslint/explicit-module-boundary-types": "off", | ||
"@typescript-eslint/no-empty-interface": "off", | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/no-unused-vars": "off", | ||
"@typescript-eslint/no-non-null-assertion": "warn", | ||
"@typescript-eslint/no-empty-function": "warn", | ||
"react/no-children-prop": "warn", | ||
"react-hooks/exhaustive-deps": "off", | ||
"react/jsx-no-target-blank": "off", | ||
"no-extra-boolean-cast": "off", | ||
"prefer-const": "warn" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
.pnpm-debug.log* | ||
|
||
# local env files | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
|
||
# typechain | ||
src/artifacts | ||
src/types/typechain/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
node_modules | ||
.next | ||
yarn.lock | ||
package-lock.json | ||
src/public | ||
src/types/typechain | ||
src/artifacts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/// <reference types="next" /> | ||
/// <reference types="next/image-types/global" /> | ||
|
||
// NOTE: This file should not be edited | ||
// see https://nextjs.org/docs/basic-features/typescript for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* eslint-env node */ | ||
// @ts-check | ||
|
||
/** | ||
* @type {import('next').NextConfig} | ||
**/ | ||
const nextConfig = { | ||
/* config options here */ | ||
} | ||
|
||
module.exports = nextConfig |
Oops, something went wrong.