Skip to content

Server Setup

Jeremy Bailey edited this page Jul 13, 2020 · 11 revisions

Setup

Running/Building the Application:

  • Requirements:
    • Visual Studio
    • .Net Core 3.1
    • Node.js
    • Webpack npm install --save-dev webpack
  • Clone respository
  • Run npm install from the project directory (where package.json is located).
    • NOTE: by default, type cd Moggles
  • Add the configuration keys in appsettings.json.
  • Run npm run dev-full from the project directory (where package.json is located).
  • Build for deployment or Run in Debug (F5)

Deploying the Application:

The application needs to be deployed on a web server (for example IIS), built in Release mode.

Configuration Keys

  • Custom roles (Required) The application uses by default windows authentication (form based authentication is not implemented) with role based authorization. This part can be removed by removing the ConfigureAuthServices method from Startup and the authorize policy from the HomeController, resulting in anonymous authentication.

    "CustomRoles": {
       "Admins": "MY_DOMAIN\myAdminGroup_Or_UserName"
    }
  • Messaging (Optional)

    "Messaging": {
       "UseMessaging": "true",
       "Url": "rabbitmq://messageBusUrl",
       "Username": "user",
       "Password": "password",
       "QueueName": "my_moggles_deploy_status_queue"
    }

    If UseMessaging is set to false (default) the messaging features will not be available.

  • Application insights instrumentation key (Optional)

    "ApplicationInsights": {
       "InstrumentationKey": "myInstrumentationKey"
    }

Tests

  • Running the unit tests and API tests don't require any additional setup.
  • Running the UI tests:
    Run npm install from the project directory (where package.json is located).
    • Mocha tests
      Run npm run test from the project directory (where package.json is located).
    • Jest tests
      Run npm run test-j from the project directory (where package.json is located).

Troubleshooting

If InvalidOperationException: No authenticationScheme was specified, and there was no DefaultChallengeScheme found. exception is thrown when running the application: right click on Moggles project -> Properties -> Debug -> check 'Enable Windows Authentication'.

If you get npm errors, check the directory, the commandline MUST be in the directory that contains package.json. You will likely need to type cd Moggles in a default install

If you get node_sass errors in your console such as Error: ENOENT: no such file or directory, scandir [full path here]node_modules\node-sass\vendor, then your OS node.js version and the node version inside Visual Studio, may not be the same. Try:

  • Installing latest node.js
  • Verifying versions (command line of node -v and inside Package Manager Console)
  • Running node .\node_modules\node-sass\scripts\install.js
  • Running npm rebuild node-sass

Clone this wiki locally