commit c3a9ae81fb1022440a08c665ef12bd1414e7485a Author: Daltonic Date: Wed Aug 24 12:23:14 2022 +0100 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1cac559 --- /dev/null +++ b/.gitignore @@ -0,0 +1,25 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? +.env \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..bfe428d --- /dev/null +++ b/README.md @@ -0,0 +1,32 @@ + +# Hardhat-Tailwind-React Ethers Starter Kit +Speedily develope your decentralized application with this starter kit for free! + +Follow the steps below to download, install, and run this project. + +## Dependencies +Install these prerequisites to follow along with the tutorial. See free video tutorial or a full explanation of each prerequisite. +- NPM: https://nodejs.org +- Hardhat: https://hardhat.org/ +- EthersJs: https://ethers.org/ +- Tailwind CSS: https://tailwindcss.com/ + + +## Step 1. Clone the project +`git clone https://github.com/Daltonic/tailwind_ethers_starter_kit ` + +## Step 2. Install dependencies +```sh +$ cd +$ yarn install # or npm install +``` +## Step 3. Start Hardhat Node +Open the terminal and run the command below. +```sh +$ yarn hardhat node +``` + +## Step 4. Run the Front End Application +`$ yarn start` +Visit this URL in your browser: http://localhost:3000 + diff --git a/config-overrides.js b/config-overrides.js new file mode 100644 index 0000000..89aef9b --- /dev/null +++ b/config-overrides.js @@ -0,0 +1,25 @@ +// This file is included to deal with issues regarding react-scripts v5.0.0 and web3 +// Provided from Web3 documentation -> https://github.com/ChainSafe/web3.js#troubleshooting-and-known-issues + +const webpack = require('webpack'); + +module.exports = function override(config) { + const fallback = config.resolve.fallback || {}; + Object.assign(fallback, { + "crypto": require.resolve("crypto-browserify"), + "stream": require.resolve("stream-browserify"), + "assert": require.resolve("assert"), + "http": require.resolve("stream-http"), + "https": require.resolve("https-browserify"), + "os": require.resolve("os-browserify"), + "url": require.resolve("url") + }) + config.resolve.fallback = fallback; + config.plugins = (config.plugins || []).concat([ + new webpack.ProvidePlugin({ + process: 'process/browser', + Buffer: ['buffer', 'Buffer'] + }) + ]) + return config; +} \ No newline at end of file diff --git a/hardhat.config.js b/hardhat.config.js new file mode 100644 index 0000000..ce99226 --- /dev/null +++ b/hardhat.config.js @@ -0,0 +1,34 @@ +require("@nomiclabs/hardhat-waffle"); +require('dotenv').config() + +module.exports = { + defaultNetwork: "localhost", + networks: { + hardhat: { + }, + localhost: { + url: "http://127.0.0.1:8545" + }, + rinkeby: { + url: process.env.ENDPOINT_URL, + // chainId: 4, + accounts: [process.env.DEPLOYER_KEY] + } + }, + solidity: { + version: '0.8.11', + settings: { + optimizer: { + enabled: true, + runs: 200 + } + } + }, + paths: { + sources: "./src/contracts", + artifacts: "./src/abis" + }, + mocha: { + timeout: 40000 + } +} \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..cc696c4 --- /dev/null +++ b/index.html @@ -0,0 +1,26 @@ + + + + + + + + + + + + Vite App + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..909cf83 --- /dev/null +++ b/package.json @@ -0,0 +1,69 @@ +{ + "name": "Genesis", + "private": true, + "version": "0.0.0", + "scripts": { + "start": "react-app-rewired start", + "build": "react-app-rewired build", + "test": "react-app-rewired test", + "eject": "react-scripts eject" + }, + "dependencies": { + "@cometchat-pro/chat": "^3.0.10", + "@nomiclabs/hardhat-ethers": "^2.1.0", + "@nomiclabs/hardhat-waffle": "^2.0.3", + "ethereum-waffle": "^3.4.4", + "ethers": "^5.6.9", + "hardhat": "^2.10.1", + "ipfs-http-client": "^57.0.3", + "moment": "^2.29.4", + "react": "^17.0.2", + "react-dom": "^17.0.2", + "react-hooks-global-state": "^1.0.2", + "react-icons": "^4.3.1", + "react-identicons": "^1.2.5", + "react-moment": "^1.1.2", + "react-router-dom": "6", + "react-scripts": "5.0.0", + "web-vitals": "^2.1.4" + }, + "devDependencies": { + "@openzeppelin/contracts": "^4.5.0", + "@tailwindcss/forms": "0.4.0", + "assert": "^2.0.0", + "autoprefixer": "10.4.2", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.7.0", + "babel-preset-es2015": "^6.24.1", + "babel-preset-stage-2": "^6.24.1", + "babel-preset-stage-3": "^6.24.1", + "babel-register": "^6.26.0", + "buffer": "^6.0.3", + "chai": "^4.3.6", + "chai-as-promised": "^7.1.1", + "crypto-browserify": "^3.12.0", + "dotenv": "^16.0.0", + "https-browserify": "^1.0.0", + "mnemonics": "^1.1.3", + "os-browserify": "^0.3.0", + "postcss": "8.4.5", + "process": "^0.11.10", + "react-app-rewired": "^2.1.11", + "stream-browserify": "^3.0.0", + "stream-http": "^3.2.0", + "tailwindcss": "3.0.18", + "url": "^0.11.0" + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + } +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..33ad091 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,6 @@ +module.exports = { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +} diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..a11777c Binary files /dev/null and b/public/favicon.ico differ diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..aa069f2 --- /dev/null +++ b/public/index.html @@ -0,0 +1,43 @@ + + + + + + + + + + + + + React App + + + +
+ + + diff --git a/public/logo192.png b/public/logo192.png new file mode 100644 index 0000000..fc44b0a Binary files /dev/null and b/public/logo192.png differ diff --git a/public/logo512.png b/public/logo512.png new file mode 100644 index 0000000..a4e47a6 Binary files /dev/null and b/public/logo512.png differ diff --git a/public/manifest.json b/public/manifest.json new file mode 100644 index 0000000..080d6c7 --- /dev/null +++ b/public/manifest.json @@ -0,0 +1,25 @@ +{ + "short_name": "React App", + "name": "Create React App Sample", + "icons": [ + { + "src": "favicon.ico", + "sizes": "64x64 32x32 24x24 16x16", + "type": "image/x-icon" + }, + { + "src": "logo192.png", + "type": "image/png", + "sizes": "192x192" + }, + { + "src": "logo512.png", + "type": "image/png", + "sizes": "512x512" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..e9e57dc --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,3 @@ +# https://www.robotstxt.org/robotstxt.html +User-agent: * +Disallow: diff --git a/src/App.jsx b/src/App.jsx new file mode 100644 index 0000000..59e710e --- /dev/null +++ b/src/App.jsx @@ -0,0 +1,9 @@ +const App = () => { + return ( +
+

Hello Truffle and Tailwind

+
+ ) +} + +export default App diff --git a/src/index.css b/src/index.css new file mode 100644 index 0000000..4034f79 --- /dev/null +++ b/src/index.css @@ -0,0 +1,18 @@ +@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700&display=swap'); + +* html { + padding: 0; + margin: 0; + box-sizing: border-box; +} + +body { + margin: 0; + font-family: 'Open Sans', sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +@tailwind base; +@tailwind components; +@tailwind utilities; diff --git a/src/index.jsx b/src/index.jsx new file mode 100644 index 0000000..cdd0099 --- /dev/null +++ b/src/index.jsx @@ -0,0 +1,12 @@ +import React from 'react' +import ReactDOM from 'react-dom' +import { BrowserRouter } from 'react-router-dom' +import './index.css' +import App from './App' + +ReactDOM.render( + + + , + document.getElementById('root') +) \ No newline at end of file diff --git a/tailwind.config.js b/tailwind.config.js new file mode 100644 index 0000000..d296883 --- /dev/null +++ b/tailwind.config.js @@ -0,0 +1,35 @@ +module.exports = { + content: ['./src/**/*.{js,jsx,ts,tsx}'], + mode: 'jit', + darkMode: false, // or 'media' or 'class' + theme: { + fontFamily: { + display: ['Open Sans', 'sans-serif'], + body: ['Open Sans', 'sans-serif'], + }, + extend: { + screens: { + mf: '990px', + }, + keyframes: { + 'slide-in': { + '0%': { + '-webkit-transform': 'translateX(120%)', + transform: 'translateX(120%)', + }, + '100%': { + '-webkit-transform': 'translateX(0%)', + transform: 'translateX(0%)', + }, + }, + }, + animation: { + 'slide-in': 'slide-in 0.5s ease-out', + }, + }, + }, + variants: { + extend: {}, + }, + plugins: [require('@tailwindcss/forms')], +}