Skip to content

JasonWeinzierl/BHS.NET

Repository files navigation

BHS.NET

The Belton Historical Society website, built on ASP.NET Core, Angular, and MongoDB.

Azure Release

Development Setup

Prerequisites

  • .NET 10 SDK and Visual Studio 2026
    • dotnet tool restore
  • Node.JS 24 and yarn
    • corepack enable
  • MongoDB

Build and Debug

Database

  1. You must have access to an instance of MongoDB.
    • Either use a free cloud offering or set up a local instance.
  2. Add a connection string named ConnectionStrings:bhsMongo.
    • See the below section on Configuration for other required settings.

Frontend

  1. Open the src/bhs-web-angular-app directory in VS Code or other editor.
  2. yarn
  3. yarn start
    • Use the included VS Code launch profiles to attach the debugger.

This starts the angular development server on localhost:4200, but backend requests will not succeed. See the next section for starting up the backend so that the web host can receive requests from the frontend development server.

Backend

Use the launch profile in Visual Studio, or

dotnet run --project src/BHS.Web/BHS.Web.csproj --launch-profile BHS.Web

This starts the web application server and also launches the SPA with proxying enabled. Test the frontend application through the 2nd launched terminal window.

Navigate to /api/swagger to use the Swagger UI. This does not require the frontend development server to be running.

Infrastructure

See separate repository: [https://github.com/JasonWeinzierl/belton-historical-society-infrastructure]

Auth

This application uses Auth0; you must set up an Auth0 tenant with RBAC permissions matching those set up in Startup.cs. You must also add the configuration settings as mentioned below.

Configuration

The required configuration settings are listed in the modules/web-apps/configs.tf file of the separate infrastructure repository. These settings include authentication settings, database connection strings, API keys, etc. Without these settings, various features may fail to work locally.

Example

The infrastructure lists the following resource, which is a required setting you need to run this application locally.

resource "azurerm_app_configuration_key" "auth0_domain" {
  configuration_store_id = data.azurerm_app_configuration.bhs.id

  label = var.environment
  key   = "AUTH0_DOMAIN"
  value = ...
}

Based on this resource, create a setting named AUTH0_DOMAIN with a value of your Auth0 tenant's domain.

You may add this setting either to your local appsettings.Development.json, user secrets, machine environment variables, command line arguments, or else create an instance of Azure App Configuration with these.

Repeat this step for every other resource of type azurerm_app_configuration_key.

If using Azure App Configuration locally, each key must be labeled with nothing or else development. Add the App Configuration's connection string to a setting named ConnectionStrings:AppConfig.

E2E

To run E2E locally, you need the app running per previous instructions.

  1. cd src/bhs-e2e
  2. yarn e2e

If you are running on macOS, you must first run safaridriver --enable to enable Safari's WebDriver support.

About

Belton Historical Society website built on .NET

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •