damikun / fusion-bmt

Barrier Management Tool

Home Page:https://fusion-bmt.app.radix.equinor.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Barrier Management Tool

Build Status Codacy Badge

To run the project with docker-compose use:

  • docker-compose up --build

Prerequisites

Frontend

The frontend is built using TypeScript and components from the Equinor Design System (EDS).

Run frontend

cd frontend
npm install
npm start

Backend

The backend is build using .NET Core 3.1. We use GraphQL to handle requests to the backend, and Hot Chocolate is used as the implementation in .NET.

We are using a Entity Framework SQL database for storing our data. The environment variable Database__ConnectionString can be a ADO.NET connection string to an existing database. If empty we use an InMemory database which is initialized with dummy data.

GraphQL schema

When running locally, a playgrond server for trying out GrapQL queries will be available at localhost:500/graphql/playground. This will not work properly production since the playground server will not provide bearer token for authentication. For generating a bearer token and try out the API, the Swagger URL localhost:5000/swagger can be used.

The Schema used for the models in the backend can be found here.

Run backend

cd backend/api
dotnet run

BMT in Radix

Etc

Configuration

Database configuration

Make sure you have dotnet-ef installed: dotnet tool install --global dotnet-ef and that you have set your Database__ConnectionString.

  • Create initial migration: dotnet ef migrations add InitialCreate

  • Delete database: dotnet ef database drop

  • Apply migrations: dotnet ef database update

  • Remove migrations: dotnet ef migrations remove

  • Pupulate DB with questions: dotnet ...

For populating SQL database with question templates go to backend/scripts make sure your Database__ConnectionString is set and run dotnet run --question-file PATH-TO-FILE. An example file of question templates: backend/api/Context/InitQuestions.json

Environment variables

Frontend Backend
Required AzureAd__ClientSecret
Optional API_URL
AD_APP_ID
ASPNETCORE_ENVIRONMENT
HTTPONLY
Database_ConnectionString

API structure

About

Barrier Management Tool

https://fusion-bmt.app.radix.equinor.com

License:MIT License


Languages

Language:C# 54.1%Language:TypeScript 43.0%Language:JavaScript 1.8%Language:Dockerfile 0.5%Language:Python 0.5%Language:Less 0.1%