Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Commit

Permalink
gm ☀️
Browse files Browse the repository at this point in the history
  • Loading branch information
wottpal committed Jul 18, 2022
0 parents commit bca6fa2
Show file tree
Hide file tree
Showing 55 changed files with 14,553 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .gitignore
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
7 changes: 7 additions & 0 deletions .husky/pre-commit
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
4 changes: 4 additions & 0 deletions .lintstagedrc.json
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"
}
3 changes: 3 additions & 0 deletions .npmrc
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
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16
8 changes: 8 additions & 0 deletions .prettierrc.json
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
}
44 changes: 44 additions & 0 deletions .vscode/ethathon.code-workspace
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"
}
}
}
8 changes: 8 additions & 0 deletions .vscode/extensions.json
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"
]
}
21 changes: 21 additions & 0 deletions LICENSE
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.
52 changes: 52 additions & 0 deletions README.md
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
```
29 changes: 29 additions & 0 deletions package.json
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"
}
}
}
14 changes: 14 additions & 0 deletions packages/frontend/.babelrc.js
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'],
}
9 changes: 9 additions & 0 deletions packages/frontend/.env.local.example
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
7 changes: 7 additions & 0 deletions packages/frontend/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
**/node_modules/*
**/out/*
**/.next/*
**/artifacts/*
**/sql/*
**/public/*
**/types/typechain/*
24 changes: 24 additions & 0 deletions packages/frontend/.eslintrc.json
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"
}
}
40 changes: 40 additions & 0 deletions packages/frontend/.gitignore
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/**
7 changes: 7 additions & 0 deletions packages/frontend/.prettierignore
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
5 changes: 5 additions & 0 deletions packages/frontend/next-env.d.ts
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.
11 changes: 11 additions & 0 deletions packages/frontend/next.config.js
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
Loading

0 comments on commit bca6fa2

Please sign in to comment.