To run the project with docker-compose use:
docker-compose up --build
The frontend is built using TypeScript and components from the Equinor Design System (EDS).
cd frontend
npm install
npm start
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.
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.
cd backend/api
dotnet run
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
Frontend | Backend | |
---|---|---|
Required | AzureAd__ClientSecret | |
Optional |
API_URL AD_APP_ID |
ASPNETCORE_ENVIRONMENT HTTPONLY Database_ConnectionString |