Skip to content

Dev Env Guide

Sergii Diachenko edited this page May 28, 2020 · 14 revisions

Development Environment Setup Guide

🏗 UNDER CONSTRUCTION 🏗

This page describes all required steps you need to perform to get you up and running with development environment

Product

API

Azure Storage

In order to develop against azure storage locally you need to install and download Azure Storage Emulator.

All connections are configured.

For the first time use you have to run scripts that would configure Azure Storage into the correct state.

From the root run the following PowerShell script:

.\dev-env\build-and-run-migrations.ps1

Frontend

Test Automation

Unit/Integration tests

Project uses Specflow to run unit and integration tests. In order to run tests you need Specflow extension installed.

See instructions here.

Also see guide on hot to Write New Test;

API Tests

Project uses Karate to test API.

In order to run tests you need latest Java installed. JRE is sufficient.

Angular development environment setup

Set up the Development Environment

You need to set up your development environment before you can do anything. Install Node.js and npm if they are not already on your machine. Verify that you are running at least node 6.9.x and npm 3.x.x by running 'node -v' and 'npm -v' in a terminal/console window. Older versions produce errors, but newer versions are fine. Then install the Angular CLI globally 'npm install -g @angular/cli'.

Restore npm packages

Go to the project directory (src\VolleyManagement.WebClient\spa). Run 'npm install'

Serve the application

Go to the project directory (src\VolleyManagement.WebClient\spa) and launch the server 'ng serve --open'. The ng serve command launches the server, watches your files, and rebuilds the app as you make changes to those files. Using the --open (or just -o) option will automatically open your browser on http://localhost:4200/. Another option is to run 'npm start' from the project directory it will run 'ng serve'.

Local JSON metadata for VOU integration development

VOU integration uses JSON files which contain metadata about what information to display. In production we use Azure Blob Storage to serve those files.

In order to support development workflow you could configure local environment to help you.

  1. Install Azure Storage Emulator. Dwonload link
  2. Install Azure Storage Explorer. Download link
  3. Create blob container named "volleymanagement".
  4. Upload metadata files into it.
  5. Profit!

Note: Check out environment.json inside WebClient to check if your path matches. Or if you want to deviate from defaults.

Supporting

App Secrets

We integrate with a couple of external systems. In order to support development environment you have to obtain appropriate credentials and deploy it locally.

In order to avoid sensitive information disclosure we store secrets outside of repository.

IMPORTANT: DO NOT COMMIT ANY ACCESS KEYS/PASSWORDS/ETC INTO SOURCE CONTROL. ESPECIALLY PUBLIC REPOS.

SonarLint

We use Sonar as code quality tool. Therefore we use SonarLint as a local development tool to keep code clean.

This section gives a high level overview of steps required for you to perform to get it configured for your local Visual Studio

  1. Get SonarLint extension for Visual Studio. See SonarLint for VS page.
  2. Get SonarCloud token
    1. Login to sonarcloud.io
    2. Go to My Account -> Security
    3. Generate token to be used by SOnarLint to authenticate
    4. Copy that token - you won't be able to see it anymore.
  3. Connect SonarLint
    1. Go to VS: Menu 'Analyze' > 'Manage SonarQube Connections'
    2. Enter following data:
      1. SonarQube server: https://sonarcloud.io/
      2. Username/Token: token you generated at one of the previous steps
  4. Profit!