NEXUS
Getting Started

Getting started with WAVit Dashboard

From a fresh machine to the dashboard running locally against the shared dev databases, signed in with a test login and looking at dev transactions. There is no container and no local database: the app reads every connection string from an Azure Key Vault when it starts.

Checked against development at 2ccf8cf on .

Before you start

Install the tools, then ask the WAVit team for the access in the list below.

ToolVersionWhy
.NET SDK8.0 (the pipelines use 8.0.x)All four projects target net8.0. A newer SDK builds them too, but running the app needs the ASP.NET Core 8 runtime, which the 8.0 SDK includes.
GitAny recent versionThe code is in Azure DevOps: project WavitSystems, repository WAVitDashboard.
Azure CLIAny recent versionaz login gives the app your Azure identity. The app uses it to read the dev Key Vault.
Visual Studio 2022 or laterOptionalWhat the repo's README assumes. Signing in to Visual Studio with the same account also works for Key Vault.
  • Azure DevOps: read access to the WavitSystems project.
  • The dev Key Vault: permission to read its secrets, for the account you use with az login. Ask for the vault's URI as well. It goes into your Development settings.
  • The dev databases: the app uses two SQL Server databases, MiPoint and the Identity database. Their connection strings come from the vault, so your machine must be able to reach the server they name.
  • A dev test login: an email and password in the dev Identity database. The email must be confirmed and have a master MID record with at least one active unit. Never use a real merchant's login.

Get the code

Work starts from development. Pull requests go into development, which deploys to the dev site on every push. main reaches production through release/prod/v* tags.

Clone, branch and build
git clone https://micampdev.visualstudio.com/WavitSystems/_git/WAVitDashboard
cd WAVitDashboard
git switch development
git switch -c us/<story-id>/main

dotnet restore WAVitDashboard.sln
dotnet build WAVitDashboard.sln
  • Branches are named after the work item: us/<story-id>/main for a story, us/<story-id>/task/<task-id>-<short-name> for a task under it.
  • The solution has four projects: WAVitDashboard/WAvitDashboardWeb.csproj (the web app), MiCamp.Models and MiCamp.DataAccess (MiPoint entities and data access), and WAVitDashboard.Tests.
  • The build prints a few hundred warnings, nearly all about nullable references. They are expected. Errors are not.

Point it at the dev Key Vault

There is very little local configuration. At startup the app reads five secrets from the Key Vault named by KeyVault:Uri, and it stops if any of them is missing.

WAVitDashboard/appsettings.Development.json
{
  "KeyVault": {
    "Uri": "https://<dev-key-vault-name>.vault.azure.net/"
  },
  "Clarity": {
    "ProjectId": ""
  }
}

The file is listed in .gitignore, so it stays on your machine. Every launch profile sets ASPNETCORE_ENVIRONMENT to Development, and that is what makes the app load it. An environment variable named KeyVault__Uri works too. User secrets are not set up (the project has no UserSecretsId), and the app never reads connection strings from configuration anyway.

Configuration keys
KeyWhere it is setWhat it does
KeyVault:Uriappsettings.json (production). Override it in appsettings.Development.json.Required. The vault every secret is read from, with DefaultAzureCredential.
Clarity:ProjectIdappsettings.jsonMicrosoft Clarity session replay on signed-in pages. Set it to an empty string locally so your sessions do not land in the shared Clarity project.
Clover:BaseUrlappsettings.jsonClover's web address, for the receipt fallback. Leave it as it is.
ApplicationInsights:ConnectionStringNot setOptional. Without it no telemetry is sent, which is what you want locally.
ASPNETCORE_ENVIRONMENTProperties/launchSettings.jsonDevelopment in every profile. Loads your Development file and shows the detailed error page.
Key Vault secrets the app reads at startup
SecretUsed for
MiPointConnectionStringThe MiPoint database (both MiPoint EF contexts)
AzureIntegrationManagerConnectionStringThe Identity database: logins, passwords, 2FA
smtp2goPasswordEmail over SMTP2GO: confirmations, password resets, invitations and receipts
SlackFeedbackWebhookUrlPosting survey responses to Slack
MiPointApiKeyCreating and cancelling invoices through the MiPoint API

Run it locally

From the repository root
az login                          # the account that can read the dev vault
dotnet dev-certs https --trust    # once per machine
dotnet run --project WAVitDashboard --launch-profile https
Launch profiles
ProfileAddress
httpshttps://localhost:7036 and http://localhost:5139
httphttp://localhost:5139
IIS Express (Visual Studio)http://localhost:63279, SSL port 44369

The browser opens on the public landing page. Before you sign in, open /health to check that the app reached the vault and both databases. It answers 200 when every check passes and 503 when one fails. It shows statuses only; the reason for a failure is logged in the console where dotnet run is running.

GET https://localhost:7036/health (formatted)
{
  "status": "Healthy",
  "checks": [
    { "name": "identity-db", "status": "Healthy" },
    { "name": "mipoint-db", "status": "Healthy" },
    { "name": "key-vault", "status": "Healthy" }
  ]
}

Your first look at Transactions

A read-only tour that proves the whole chain works: the Identity database, MiPoint, and the per-user scoping of units.

  1. 1
    Sign inGo to https://localhost:7036/Identity/Account/Login, or use the sign-in link on the landing page, and sign in with the dev test login. Every successful sign-in lands on Home, /Dashboard/Portal/Home, whatever page you started from.
  2. 2
    Check HomeHome fills in after two background requests: today's balance, the 10-day chart and a card for each unit. Zero balances are normal when the dev units took no payments today.
  3. 3
    Open TransactionsChoose Transactions in the navigation (/Dashboard/Transaction/Index). The page opens on today's date range for every unit your login can see.
  4. 4
    Widen the rangePick Last 7 Days (or Custom) and press Search. The summary strip and the table reload with the payments in range.
  5. 5
    Open one paymentUse Quick View for the side panel, or Details for the full transaction page, which opens in a new tab.

Run the tests

The unit tests need no database, vault or sign-in. They use EF Core InMemory and Moq.

The same build and test as the pull request pipeline
dotnet build WAVitDashboard.sln --configuration Release
dotnet test WAVitDashboard.Tests/WAVitDashboard.Tests.csproj --configuration Release --no-build

On development at 2ccf8cf this runs 151 tests, and all of them pass. Pull requests into development and main run the same restore, build and test (azure-pipelines.yml). Every push to development runs the tests again before it deploys to the dev site.

A Playwright end-to-end suite, WAVitDashboard.E2E, lives on unmerged branches (the newest is us/1693/main). It reads E2E_BASE_URL, E2E_USER and E2E_PASSWORD from a .env file that you copy from .env.example, it must never point at production, and no pipeline runs it yet.

Troubleshooting

What you seeWhat to do
Startup stops with Failed to read secret 'MiPointConnectionString' from Key Vault.Your Azure identity cannot read the vault. Run az login with the account that has access (az account show tells you which one is active), or sign in to Visual Studio with it. The inner exception says whether sign-in or permission failed.
Startup stops with KeyVault:Uri is not configured.The key is empty in every settings file. Set it in WAVitDashboard/appsettings.Development.json.
Merchants or totals look like productionYour Development settings were not loaded, so the app used the production vault from appsettings.json. Stop the app. Check that your file sits next to appsettings.json and that ASPNETCORE_ENVIRONMENT is Development. It is not when you pass --no-launch-profile or run the DLL directly.
/health shows identity-db or mipoint-db as UnhealthyThe secrets loaded but the database did not answer. The console has the SQL error. If it is a network or firewall error, ask the team for access to the dev database server.
Sign-in says User Not Found.No login with that email exists in the dev Identity database.
Sign-in says Please, confirm your email .The email is not confirmed yet. Use the resend link on the login page. The email really goes out.
Sign-in says User temporarily disabled.The email's master MID record is marked Hidden.
Signed in, but Home sends you to the error pageThe email has no master MID record in the dev MiPoint, and no unit lists it as its contact email, so the dashboard cannot tell which units it may show.
Transactions shows an empty tableThe default range is today. Pick Last 7 Days and press Search. If it is still empty, the login's units have no recent dev payments, or they are unticked under Account settings, Preferences.
The README says to uncomment connection strings in Program.csThat step is out of date, and so is its clone URL. Connection strings now come only from the Key Vault, so there is nothing to uncomment.
You need a schema changeThere are no EF migrations, so dotnet ef will not help. Schema changes are SQL scripts under db/, run once per environment. db/DashboardAuditLog.sql is the example.

Next steps