From 9f817ab1859433184b231b3eb04f9df8206685ca Mon Sep 17 00:00:00 2001 From: Dhaiwat Pandya Date: Sat, 6 Nov 2021 10:35:35 +0530 Subject: [PATCH 1/2] Add basic setup info in `CONTRIBUTING.md` --- CONTRIBUTING.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1935a2a..97eb3a1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,6 +4,49 @@ If you start working on an issue please assign it to yourself. +If you need help, please drop a message in `#project-drecruit` channel on Discord. + +### Local dev environment setup + +Clone the repo and follow these steps to get started with developing locally: + +```bash +cd decruit + +# Install dependencies +yarn install + +# Copy the contents of .env.example to .env +cp packages/react-app/.env.example packages/react-app/.env +cp packages/backend/.env.example packages/backend/.env + +# Generate a ceramic seed and copy it to the react app's .env +yarn ceramic + +# Copy the contract's address to the backend's .env (the contract is deployed on the Mumbai testnet) +CONTRACT_ADDRESS=0x9486cB9438b3279D70c55681B41bf50b5c537Aa4 + +# (OPTIONAL) If you want to develop on the localhost network, do this: +yarn chain +yarn deploy --network localhost --reset +CONTRACT_ADDRESS= (in the backend .env) + +# In the backend .env, set the following variables: +RPC_URL=https://rpc-mumbai.maticvigil.com/ (or you can get one from infura) +DB_URL= (you can run mongodb locally or get a free DB from MongoDB atlas) + +# Grab a free token from https://web3.storage and set it in the React app .env +WEB3STORAGE_TOKEN= + +# Start the backend +cd packages/backend +yarn install +yarn dev + +# Start the React app (make sure you're at the root of the repo) +yarn dev +``` + ### Redeploying the contracts on Mumbai ```bash From 96aa32290115e6bd8756b66741ee285ba97fae10 Mon Sep 17 00:00:00 2001 From: Dhaiwat Pandya Date: Sat, 6 Nov 2021 17:33:07 +0530 Subject: [PATCH 2/2] Remove duplicate `.env.example` for backend --- packages/backend/.env.example | 11 ++++++----- packages/backend/.example.env | 8 -------- 2 files changed, 6 insertions(+), 13 deletions(-) delete mode 100644 packages/backend/.example.env diff --git a/packages/backend/.env.example b/packages/backend/.env.example index 80ed10e..8896ae2 100644 --- a/packages/backend/.env.example +++ b/packages/backend/.env.example @@ -1,7 +1,8 @@ -PORT=5000 -COOKIE_NAME=drecruit-session +DB_URL=mongodb+srv://username:password@clusterurl/dbname?retryWrites=true&w=majority +# Generate your own keys using node crypto COOKIE_KEY=5d8400bb232c1e7f38feadcac54e04aba5cd123b2047c2fdc3a1496d144fff89 DID_KEY=d13c018fd5c4d336f67b986d88f98baced3e071e2faedc58e7e1373b2c638cb6 -CONTRACT_ADDRESS= -RPC_URL= -DB_URL= \ No newline at end of file +CONTRACT_ADDRESS=0x9486cB9438b3279D70c55681B41bf50b5c537Aa4 +RPC_URL=https://polygon-mumbai.infura.io/v3/REPLACE_WITH_YOUR_INFURA_ID +PORT=5000 +HOST=localhost diff --git a/packages/backend/.example.env b/packages/backend/.example.env deleted file mode 100644 index 8896ae2..0000000 --- a/packages/backend/.example.env +++ /dev/null @@ -1,8 +0,0 @@ -DB_URL=mongodb+srv://username:password@clusterurl/dbname?retryWrites=true&w=majority -# Generate your own keys using node crypto -COOKIE_KEY=5d8400bb232c1e7f38feadcac54e04aba5cd123b2047c2fdc3a1496d144fff89 -DID_KEY=d13c018fd5c4d336f67b986d88f98baced3e071e2faedc58e7e1373b2c638cb6 -CONTRACT_ADDRESS=0x9486cB9438b3279D70c55681B41bf50b5c537Aa4 -RPC_URL=https://polygon-mumbai.infura.io/v3/REPLACE_WITH_YOUR_INFURA_ID -PORT=5000 -HOST=localhost