Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

A Blazor web application for managing teaching assistants at Swansea University.

License

Notifications You must be signed in to change notification settings

SwanseaCompSci/lab-management-system

Repository files navigation

Lab Management System

This project is a Blazor web application for managing teaching assistants at Swansea University. The application allows for the allocation of teaching assistants to modules and labs based on their module preferences, time availability, as well as requirements of the modules.

The implementation follows several design patterns and best practices, discussed in a dissertation available in the /docs folder.

Prerequisite

Development

Registering the application in Azure Active Directory

  1. Register a new application in your Azure Active Directory
    • Go to: Azure Active Directory > App registrations > New registration
    • Register the application with the following values:
      • Name: Lab Manager - Development
      • Supported account types: Accounts in this organizational directory only (Northwind Traders only - Single tenant)
  2. Create a new client secret
    • Go to: Certificates & secrets > New client secret
    • Fill in the form and hit Add
  3. Add API permissions
    • Go to: API permissions > Add a permission
    • Add the following Microsoft Graph Permissions:
      • AppRoleAssignment.ReadWrite.All
      • User.Read.All
    • Grant admin consent for Northwind Traders
  4. Add application roles
    • Go to: App roles > Create app role
    • Create the following roles:
      Display name Allowed member types Value Description
      Administrator Users/Groups Administrator Administrator role
      User Users/Groups User User role
  5. Grant Administrator role to users
    • Go to: Azure Active Directory > Enterprise applications > Lab Manager - Development > Users and groups > Add user/group
    • Fill in the form with the following details:
      • Users: Select all users who should have access as Administrators
      • Select a role: Administrator

Running the application

  1. Update the following section in your appsettings.Development.json (Presentation.BlazorServer)

    {
       "AzureAd": {
          "Instance": "https://login.microsoftonline.com/",
          "Domain": "example.com",
          "TenantId": "00000000-0000-0000-0000-000000000000",
          "ClientId": "00000000-0000-0000-0000-000000000000",
          "CallbackPath": "/signin-oidc",
          "SignedOutCallbackPath": "/signout-callback-oidc"
       }
    }
  2. Add secrets

    • cd .\src\Presentation.BlazorServer\
    • dotnet user-secrets set "ConnectionStrings:DbConnection" "Data Source=localhost,1433;Initial Catalog=LabManagementSystemDb;User ID=SA;Password=Password_123;TrustServerCertificate=True;"
    • dotnet user-secrets set "AzureAd:ClientSecret" "YourClientSecret"
  3. Run the application

    • dotnet run --project .\src\Presentation.BlazorServer\LabManagementSystem.Presentation.BlazorServer.csproj

Testing the application

  1. Add secrets
    • IntegrationTests.Core.Application
      • cd .\tests\Core\LabManagementSystem.IntegrationTests.Core.Application\
      • dotnet user-secrets set "ConnectionStrings:DbConnection" "Data Source=localhost,1433;Initial Catalog=LabManagementSystemIntegrationTestsDb;User ID=SA;Password=Password_123;TrustServerCertificate=True;"
    • IntegrationTests.Core.Application.Allocation
      • cs .\tests\Core\LabManagementSystem.IntegrationTests.Core.Application.Allocation
      • dotnet user-secrets set "ConnectionStrings:DbConnection" "Data Source=localhost,1433;Initial Catalog=LabManagementSystemIntegrationTestsDb;User ID=SA;Password=Password_123;TrustServerCertificate=True;"
  2. Run the tests
    • dotnet test