Skip to content

Getting Started

Mees van Straten edited this page Sep 2, 2021 · 18 revisions

About

This wiki article explains the steps and tools that are necessary in order to get the backend services running.

The backend consist of the services:

  • API (https://localhost:5001)
  • Identity Server (https://localhost:5005)
  • Database
  • Notification system
    The notification system is responsible for sending emails ( in the future this may be expanded with sending notifications to the frontend )
  • Job Scheduler
    The Job Scheduler is responsible for starting jobs every now and then. For now it is only used to check for graduating users.
  • Elastic Synchronizer
    Elastic Synchronizer is an application which is responsible sending calls to the ElasticSearch instance to keep our MSSQL database up to date with the Elastic dataset.

Setup with docker

Prerequisites

Steps

  1. Clone this repository, using the following command:
    git clone https://github.com/DigitalExcellence/dex-backend.git
  2. Browse to the folder of the repository
  3. Run the command: docker-compose up (If you want to run it in the background: docker-compose up -d) (if you need to rebuild the images use: docker-compose up --build)
  4. After a short while, the services should be running and accessible on the urls mentioned in the about section
  5. When you visit the urls for the first time, you should trust the certificate
  6. When you want to stop the services from running, run the command: docker-compose down

Setup with Visual Studio

Prerequisites

  • Git
  • Visual Studio
  • RabbitMQ RabbitMQ can be installed as a service from the link on the left, but you can also use the RabbitMQ container in our Docker Compose file. It could be necessary to enable the management plugin for RabbitMQ by using the following command for RabbitMQ either in the Docker container or locally. rabbitmq-plugins enable rabbitmq_management See RabbitMQ documentation for more information.

Steps

  1. Clone backend repository
  2. Open solution
  3. Right click -> Set as startup projects: Choose "Multiple startup projects" and select action 'Start' for 1_API and 6_IdentityServer

If the error below shows up your instance of RabbitMQ may not be running or the connection credentials ( appsettings.Development.json ) may be incorrect.
image

Tips

After launch: check if database is created by using SQL Server Object Explorer. To check if API is working:

  1. Use https://localhost:5001/index.html and click on Authorize.
  2. Select Scopes: 'dex-api'
  3. Use user: 'bob' password: 'bob' to authorize.
  4. Click one of the API requests and check for response.

Setup with Rider

Prerequisites

  • Git
  • Rider
  • RabbitMQ RabbitMQ can be installed as a service from the link on the left, but you can also use the RabbitMQ container in our Docker Compose file.

Steps

  1. Clone backend repository.
  2. Open solution.
  3. Ga naar Run -> Edit Configurations.
  4. Press the + sign and add two .NET Projects, one for the API and one for the Identity server.
  5. Press the + sign and add a Compound.
  6. Press the made Compound and the the API and the Identity server.

Here is a video that shows these steps.

Postman setup

Prerequisites

Steps

  1. Import both environment & collection .json files from backend repository in Postman.
  2. Make sure 'SSL certificate verification' setting in Postman is disabled.
  3. Collection: 'Digital-Excellence-API' should be under collections in the left panel. Environment 'Local' should be available in the top right corner of Postman.

More instruction about Postman can be found here: Postman guide