-
Notifications
You must be signed in to change notification settings - Fork 80
How to set up GreenCity project locally
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.
- Install Git or your favorite Git client, if you haven't already. Update to the latest version; the version that came bundled with your OS may be outdated.
- Verify if you are using Java 8 (newer versions of Java might cause malfunctioning in unit tests).
- Install Node.js https://nodejs.org/uk/download/
- Install RabbitMQ https://www.rabbitmq.com/install-windows.html
- Install PostgreSQL 9.5 or higher https://www.postgresql.org/download/
- Open SQL Shell and in order to create new greencity database enter the command
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.
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.
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, runnpm 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
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).
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.