Skip to content
This repository has been archived by the owner on Dec 31, 2024. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Giveth/giveth-dapp
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.7.11-beta
Choose a base ref
...
head repository: Giveth/giveth-dapp
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing 328 changed files with 57,875 additions and 43,984 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
PORT=3010
NODE_PATH=src/
FAST_REFRESH=true
10 changes: 8 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -5,9 +5,12 @@
"prettier",
"prettier/flowtype",
"prettier/react",
"prettier/standard"
"prettier/standard",
"plugin:react-hooks/recommended"
],
"rules": {
"react/jsx-props-no-spreading": "off",
"react/jsx-fragments": 0,
"jsx-a11y/anchor-is-valid": [
"error",
{
@@ -36,13 +39,16 @@
"error",
{
"singleQuote": true,
"trailingComma": "all"
"trailingComma": "all",
"printWidth": 100,
"endOfLine": "auto"
}
],
"react-app/jsx-a11y/href-no-hash": "off", // This rule is dropped but create-react-app uses old rules
"jsx-a11y/label-has-for": "off", // This rule will be dropped soon anyways
"react/destructuring-assignment": "off", // Seems to be way too restrictive
"import/no-cycle": 1, // Should be addressed eventually but does not break
"import/prefer-default-export": "off",
"jsx-a11y/media-has-caption": "off" // Pretty hard to do for every video..
},
"env": {
21 changes: 21 additions & 0 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Build

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 10.x
- name: install dependencies
run: yarn ci
- name: run build-css
run: yarn build-css
- name: run linter
run: yarn eslint
- name: push Sentry source map
run: NODE_OPTIONS="--max-old-space-size=10000" SENTRY_AUTH_TOKEN=${{secrets.SENTRY_AUTH_TOKEN}} SENTRY_PROJECT=react SENTRY_ORG=${{ secrets.SENTRY_ORG}} CI=false yarn release
5 changes: 0 additions & 5 deletions .prettierrc

This file was deleted.

12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

99 changes: 41 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[![TEST](https://github.com/Giveth/giveth-dapp/actions/workflows/TEST.yml/badge.svg)](https://github.com/Giveth/giveth-dapp/actions/workflows/TEST.yml)
![Giveth Dapp](./readme-header.png)


@@ -9,7 +10,7 @@ Welcome to the code for Giveth's DApp. This is an open source effort to realize

- [Table of content](#table-of-content)
- [Getting Started](#getting-started)
- [Prerequisities](#prerequisities)
- [Prerequisites](#prerequisites)
- [Install](#install)
- [OSX and Linux](#osx-and-linux)
- [Windows](#windows)
@@ -27,66 +28,64 @@ Welcome to the code for Giveth's DApp. This is an open source effort to realize
## Getting Started
In the following sections you will learn all you need to know to run the DApp locally and to start contributing. All the steps are also described in this amazing [Video Tutorial Walkthrough](https://tinyurl.com/y9lx6jrl) by Oz.

#### Prerequisities
- You need to use Node > v8, however, v10 does not work correctly yet.
- You need to use npm > v5.4, or yarn > v1.6 to correctly install the dependencies.
#### Prerequisites
- You need to use NodeJS v10 LTS.
- You need to use yarn (v1.22.10 or higher) to correctly install the dependencies.
- You need to have [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).

### Install
1. Click **Star** on this repo near the top-right corner of this web page (if you want to).
2. Join us on [Riot](http://join.giveth.io) if you haven't already.
2. Join us on [Element](http://join.giveth.io) or [Discord](https://discord.gg/Uq2TaXP9bC) if you haven't already.
3. Fork this repo by clicking **Fork** button in top-right corner of this web page. Continue to follow instruction steps from your own giveth-dapp repo.
4. Clone your own "giveth-dapp" repo. Copy the link from the "Clone or download" button near the top right of this repo's home page.
5. The rest of these steps must be done from your machine's command line. See the [OSX and Linux](#for-osx-and-linux) or [Windows](#for-windows) section to continue.

#### OSX and Linux
If your operative system is any distribution of linux you can use an All-in-One installation scripts special thanks to Dapp contributor Jurek Brisbane, available [here](https://github.com/Giveth/giveth-dapp/files/3674808/givethBuildStartScripts_2019-09-29.zip) along with a youtube [video](https://www.youtube.com/watch?v=rzLhxxAz73k&feature=youtu.be), otherwise try the following:

1. From the desired directory you wish to copy the "giveth-dapp" folder with source files to.
```
git clone {paste your own repo link here}
```
NOTE: Please use `develop` branch for contributing.
NOTE: Please use `develop` branch for contributing.
```
git clone -b develop {paste your own repo link here}
```
2. Change directories to giveth-dapp:
```
cd giveth-dapp
```
3. Make sure you have [NodeJS](https://nodejs.org/) (v8.4.0 or higher) and [npm](https://www.npmjs.com/) (5.4.1 or higher) installed.
3. Make sure you have [NodeJS](https://nodejs.org/) (v10) and [yarn](https://yarnpkg.com/) (v1.22.10 or higher) installed.
4. Install dependencies from within giveth-dapp directory:
```
npm install
yarn install
```
5. That is it, you are now ready to run the giveth-dapp! Head to the [Run DApp](#run) section for further instructions.
#### Windows
1. Make sure you have the LTS version of [64-bit NodeJS](https://nodejs.org/en/download/current) (v8.9.1)
2. Run the node-v8.9.1-x64.msi installer and then continue through the installation as normal. Be sure to have the "Enable in PATH" option enabled before installing.
3. Open the command line in administrator mode by right clicking on the cmd.exe application and selecting "Run as administrator"
4. In the administrator command prompt, change to the directory where you want to store this repository.
1. Install the latest version of Python from this [Link](https://www.python.org/downloads/). (make sure python is added to $PATH)
2. Install Microsoft Visual Studio 2017 (double-check the version) from this [link](https://download.visualstudio.microsoft.com/download/pr/3e542575-929e-4297-b6c6-bef34d0ee648/639c868e1219c651793aff537a1d3b77/vs_buildtools.exe). Giveth-Dapp needs the node-gyp module and node-gyp needs VS C++ 2017 Build Tools to be installed.
3. After downloading, install the packages marked from this [image](https://cdn.discordapp.com/attachments/849682448102457374/850480734291623946/unknown.png).
4. Then run command below in command prompt
```
cd C:\some\directory\for\repositories
npm config set msvs_version 2017
```
5. Update npm to the latest version (in order to make sure the next step has the latest dependencies to install) with:
5. After installing the above, you should install NodeJS version 10 [LTS](https://nodejs.org/dist/latest-v10.x/) (it is better to be v10.24.1 LTS).
6. Download and run the node-v10.24.1-x64.msi installer and then continue through the installation as normal. Be sure to have the "Enable in PATH" option enabled before installing.
7. Open the command line in administrator mode by right-clicking on the cmd.exe application and selecting "Run as administrator"
8. In the administrator command prompt, change to the directory where you want to store this repository.
```
npm install npm@latest -g
cd C:\some\directory\for\repositories
```
6. You must install the NodeJS/NPM dependcies for Windows before you are able to continue. This command will take a few minutes to install all of the necessary dependencies for building NodeJS applications on Windows.
9. Double-check the node version with CMD command:
```
npm install -g windows-build-tools
node -v
```
7. Install dependencies from within giveth-dapp directory:
10. After that, install the latest version of Yarn. Be careful not to install packages with NPM. If you have already tried "npm install", you should first delete "node modules" folder.
```
npm install
yarn install
```
8. For some reason the npm node-sass package does not install correctly in windows when using the 'npm install' command, so you must rebuild the node-sass package with:
```
npm rebuild node-sass
```
9. The web3 package does not install correctly when using the 'npm install' command, so you must install it separately in order for this dapp to run. Use the following to install web3:
```
npm install web3
```
10. That is it, you are now ready to run the giveth-dapp! Head to the [Run dapp](#run-dapp) section for further instructions.
11. That is it, you are now ready to run the giveth-dapp! Head to the [Run dapp](#run-dapp) section for further instructions.
### Run
1. The Giveth dapp will need to connect to a [feathers-giveth](https://github.com/Giveth/feathers-giveth) server. Follow the feathers-giveth readme instructions to install and run server before proceeding further. Alternatively, you could change the configuration to connect to the `develop` environment, see the [Configuration](#configuration) section.
@@ -98,14 +97,14 @@ In the following sections you will learn all you need to know to run the DApp lo
4. For testing locally, choose any of the wallet files found in the `giveth-dapp/keystores/` folder using the wallet password: `password`. **DO NOT USE THESE ON ANY MAINNET EVMs.**
5. Using the test token
To use the test token you need to import the keystore.json you use for your account to MetaMask.
After importing, click on 'Add token' > 'Custom token' and enter the MiniMe Token address that can be found when deploying the contracts
(should be `0xe78A0F7E598Cc8b0Bb87894B0F60dD2a88d6a8Ab` by default but make sure to check)
The token balance should show up automatically and the token symbol is MMT.
However, in the dApp the token symbol is referred to as ANT, b/c the dapp needs to be able to fetch a conversion rate.
To use the test token you need to import the keystore.json you use for your account to MetaMask.
After importing, click on 'Add token' > 'Custom token' and enter the MiniMe Token address that can be found when deploying the contracts
(should be `0xe78A0F7E598Cc8b0Bb87894B0F60dD2a88d6a8Ab` by default but make sure to check)
The token balance should show up automatically, and the token symbol is MMT.
However, in the dApp the token symbol is referred to as ANT, b/c the dapp needs to be able to fetch a conversion rate.
NOTE:
When resetting feathers or redeploying the contracts, you need to remove the keystore from metamask and follow this procedure again.
NOTE:
When resetting feathers or redeploying the contracts, you need to remove the keystore from metamask and follow this procedure again.
### Build
```
@@ -125,12 +124,13 @@ REACT_APP_DECIMALS | 8 | How many decimal should be shown for cryptocurrency val
REACT_APP_FEATHERJS_CONNECTION_URL | Differs per REACT_APP_ENVIRONMENT | Overwrites the environment injected feathers connection URL. |
REACT_APP_NODE_CONNECTION_URL | Differs per REACT_APP_ENVIRONMENT | Overwrites the EVM node connection URL for making EVM transactions. |
REACT_APP_LIQUIDPLEDGING_ADDRESS | Differs per REACT_APP_ENVIRONMENT | Overwrites the Liquid Pledging contract address. |
REACT_APP_DAC_FACTORY_ADDRESS | Differs per REACT_APP_ENVIRONMENT | Overwrites the DACs contract address. |
REACT_APP_DAC_FACTORY_ADDRESS | Differs per REACT_APP_ENVIRONMENT | Overwrites the Communities contract address. |
REACT_APP_CAMPAIGN_FACTORY_ADDRESS | Differs per REACT_APP_ENVIRONMENT | Overwrites the Campaign Factory contract address. |
REACT_APP_MILESTONE_FACTORY_ADDRESS | Differs per REACT_APP_ENVIRONMENT | Overwrites the MilestoneFactory contract address. |
REACT_APP_TOKEN_ADDRESSES | Differs per REACT_APP_ENVIRONMENT | Overwrites the bridged token addresses. This is a JSON object string w/ token name : token address. |
REACT_APP_BLOCKEXPLORER | Differs per REACT_APP_ENVIRONMENT | Overwrites the block explorer base URL. The DApp assumes such blockexplorer api is `\<BLOCKEXPLORER\>/tx/\<TRANSACTION_HASH\>` |
REACT_APP_DEFAULT_GASPRICE | 10 | Overwrites the default gasPrice that is used if ethgasstation service is down. The value is in gwei. |
REACT_APP_ANALYTICS_KEY | "" | Overwrites `Segment` analytics key
Example of `.env.local` file that makes the DApp run on port 8080, connects to the **develop** environment and uses custom blockexplorer:
@@ -143,25 +143,7 @@ REACT_APP_BLOCKEXPLORER='www.awesomeopensourceexplorer.io'
The rest of the configuration can be found in `configuration.js`
### Analytics
Google analytics and Hotjar can be enabled per environment:
```
analytics: {
ga_UA: 'UA-12345678-1', // Your Google Analytics tracking code
useGoogleAnalytics: true, // Whether to enable GA
useHotjar: false // Whether to enable Hotjar
}
```
The following events are tracked with Google Analytics:
- pageviews
- signup
- signin
- creation of DACs/Campaigns/Milestones
- editing of DACs/Campaigns/Milestones
- making donations
- actions on milestones
**DO NO USE ANY OTHER THAN DEVELOP ENVIRONMENT FOR DEVELOPING AND TESTING.**
Segment Analytics can be enabled by setting REACT_APP_ANALYTICS_KEY
### Query Strings
The milestone creation/proposal view now supports query string arguments!
@@ -220,8 +202,9 @@ Name | Blockchain | Branch Deployed | Auto Deploy | Use |
You can change the environment to which the DApp connects through the node environment variables. See the [Configuration](#Configuration) section for more details.
### Release Process
The development uses the Gitflow process with 2 weeks long sprints. This means there is new release to be tested every fortnight. We invite contributors to help us test the DApp in the release
environment before we merge it to the master branch and deploy to production environments. If you are interested, write to the DApp Development channel on [Riot](https://join.giveth.io). You can read more about the release planning on [our wiki](https://wiki.giveth.io/documentation/DApp/product-development-testing/).
The development uses the Gitflow process with 2 weeks long sprints. This means there is new release to be tested every fortnight. We invite contributors to help us test the DApp in the release
environment before we merge it to the master branch and deploy to production environments. If you are interested, write to the DApp Development channel on [Element
](https://join.giveth.io). You can read more about the release planning on [our wiki](https://wiki.giveth.io/documentation/DApp/product-development-testing/).
## Help
Reach out to us on [Riot](https://join.giveth.io) for any help or to share ideas.
Reach out to us on [Element](https://join.giveth.io) or [Discord](https://discord.gg/Uq2TaXP9bC) for any help or to share ideas.
10 changes: 10 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"baseUrl": "src",
"paths": {
"*": [
"src/*"
]
}
}
}
6 changes: 6 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

[[headers]]
for = "/*"
[headers.values]
X-Frame-Options = "DENY"
X-XSS-Protection = "1; mode=block"
Loading