With the rising global temperature, ice caps are melting and sea level is rising. Planting Trees is the only option to save planet Earth. We developed a web application where users can upload the data of the tree they have planted. This will help us to keep track of the progress of the sapling. Users can also upload the water data. By doing so a sapling could grow into a tree and join the battle to save earth. Users can earn reward points for both watering and planting trees. Reward points can be redeemed in our rewards store. This will motivate our users to plant and water trees regularly.
Follow this developer guide to get started. You can add new functionalities, fix bugs, or improve documentation. Everyone is welcome to contribute and all ideas are appreciated.
1. Clone or Fork the repository Foresty.
For cloning run the following command in your terminal:
git clone https://github.com/OfficialAkashKumar/Foresty.git
To create a fork of Foresty repository, click on the fork button on the top right corner of the repository page. This will create a copy of the repository in your account. Now clone the forked repository to your local machine.
git clone https://github.com/{your_username}/Foresty.git
Navigate to the project directory and install the dependencies using the following command:
npm install
To run the project, you need to provide the API keys. Rename the file .env.example
to .env
and provide the API keys.
Following are the API keys required:
REACT_APP_MAPBOX_TOKEN
: Mapbox API keyREACT_APP_GOOGLE_LOGIN_CLIENT_ID
: Google login client ID, you can obtain it from hereREACT_APP_SANITY_PROJECT_ID
: Sanity project ID. Setup a sanity project by following the sanity guide here. Copy the project ID from the sanity dashboard and paste it in the.env
file.REACT_APP_SANITY_TOKEN
: Sanity token. You can obtain the token from the sanity dashboard. Go to theAPI
tab and click onCreate a new token
. Copy the token and paste it in the.env
file.REACT_APP_AQI_TOKEN
: Air quality index token. You can obtain the token from here. Copy the token and paste it in the.env
file.REACT_APP_IPGEO_TOKEN
: IP Geolocation token. You can obtain the token from ipgeolocation. Copy the token and paste it in the.env
file.
Sanity studio is used to manage the content of the website. To configure sanity studio, clone the Foresty Backend repository:
git clone https://github.com/navin772/ForestyBackend.git
Navigate to the ForestyBackend
directory and install the dependencies using the following command:
npm install
Change the projectId
field in the sanity.cli.js
and sanity.config.js
file to the project ID you obtained from the sanity dashboard. Also update the dataset
field in these 2 files to the dataset you are using from your sanity manage dashboard. Now run the following command to start the sanity studio:
npm run dev
A new tab will open in your browser with the sanity studio running on localhost:3333
. You can login to the studio using your google or github account. Now you can manage the content of the website.
To run the project, use the following command in the Foresty directory:
npm start
A new tab will open in your browser with the project running on localhost:3000
.
Create a new branch from your forked repository for every issue you are working on. To create a new branch, run the following command:
git checkout -b <branch_name>
Make the changes and commit them. To commit your changes, run the following command:
git add .
git commit -m "commit message"
Push your changes to the remote repository. To push your changes, run the following command:
git push origin <branch_name>
Go to the repository page and click on Compare & pull request
button. Add a title and description to your pull request that explains your changes. Click on Create pull request
button to create a pull request.
Wait for the review from the maintainers. If there are any changes required, make the changes and push them. The maintainers will review the changes and merge the pull request if everything is fine.
We follow the Contributor Covenant as our Code of Conduct. Please read the Code of Conduct.
If you are facing any problem, feel free to ask us. You can reach us on LinkedIn at Navin Chandra and Akash Kumar or create an issue on the Foresty repository.