Skip to content

How to set up GreenCity project locally

greatpanda1603 edited this page Apr 21, 2020 · 15 revisions

Follow these guidelines for setting up GreenCity locally on your system. This is highly recommended if you want to contribute regularly.

For some of the contribution workflows, you need to have GreenCity running locally. For example, previewing coding challenges or debugging and fixing bugs in the codebase.

Prerequisites

CREATE DATABASE greencity;

N.B.! The password does not show up in the terminal when you type it, but that is for security reasons. Just try typing your password out, and hitting enter.

Running GreenCity locally on your machine

Once you have the prerequisites installed, you need to prepare your development environment. This is common for many development workflows, and you will only need to do this once. Follow these steps to get your development environment ready.

Front-end

Clone the front-end part of the project called GreenCityClient using the following URL https://github.com/ita-social-projects/GreenCityClient.git Check if you have node, npm and Angular CLI installed: run sequentially the following commands in the terminal:

  • node -v
  • npm -v
  • ng version (if it is not installed, run npm install @angular/cli)

In order to launch the compilation and start front-end part of the project run sequentially the following commands in the terminal:

  • npm install
  • ng serve

Back-end

Clone the back-end part of the project called GreenCity using the following URL https://github.com/ita-social-projects/GreenCity.git

Configuring dependencies / setting up the environment variable file

You should create environmental variables that are defined in application-dev.properties.

If you are using IntelliJ IDEA go to Run / Edit Configurations / in Spring Boot drop down list select GreenCityApplication, then press on the ‘list’ button on the right end of Environment variables field. Below is the list of environment variables you need to update (fill in the Value fields).

EditConfigurations

EnvironmentalVariables

Note, that you need to have .json file locally with credentials to the Cloud Storage platform, path to this file should be indicated as a value for GOOGLE_APPLICATION_CREDENTIALS variable in environment variables.

Setting up CheckStyle

In order to ensure that your code adheres to a configurable set of rules adopted on GreenCity project, please Setup CheckStyle to your IDE.

Eventually you are ready to run the application.