Skip to content
This repository has been archived by the owner on Jan 24, 2020. It is now read-only.

Latest commit

 

History

History
106 lines (73 loc) · 4.41 KB

SETUP.md

File metadata and controls

106 lines (73 loc) · 4.41 KB

Toucan - Setup

Prerequisites

Your development machine will need to have the following installed.

Installing

The easiest way is to install via Yeoman

npm install generator-toucan
yo toucan

The alternative is to Git clone the project to a local folder and then follow steps below ...

Project Dependencies

Update and build the .NET Core projects by switching to to ./src/server and running

dotnet build

Update and build the TypeScript UI project by switching to ./src/ui and running

npm install
npm install webpack -g
npm install typings -g
typings install
webpack --config webpack.config.js

Configuration

The first step in configuration is to decide what backing database to use. You can then ensure it is properly configured, and following that invoke scaffolding tools to generate initial data migrations.

For PostgreSQL

For proper localization support ensure the server defaults are set to create

  • new databases with a character set that supports unicode strings (ie. UTF8)
  • client connections with default timezone set to 'UTC' for (via postgresql.conf)

Above steps may require a restart of the service/daemon. You can then proceed to

  • update data:connectionString configuration key inside src/server/app.development.json*
  • update ConfigureServices() method in src/server/startup.cs*, and uncomment the code block starting services.AddDbContext<NpgSqlContext>
  • update ./src/server/ContainerRegistry.cs, and uncomment the line statingFor<DbContextBase>().Use<NpgSqlContext>();
  • add the same connection string details to src/data/npgsql.json* (required for EF tooling)
  • (optional) add a database schema name to src/data/npgsql.json*
  • scaffold migrations by switching to src/data* and running
dotnet ef --startup-project ../server migrations add Initial -c NpgSqlContext

For SQL Server

  • update data:connectionString* configuration key inside src/server/app.development.json*
  • update the ConfigureServices() method in src/server/startup.cs*, and uncomment the code block starting services.AddDbContext<MsSqlContext>
  • update ./src/server/ContainerRegistry.cs, and uncomment the line statingFor<DbContextBase>().Use<MsSqlContext>();
  • add the same connection string details to src/data/mssql.json* (required for EF tooling)
  • (optional) add a database schema name to src/data/mssql.json*
  • create migrations by switching to src/data* and running
dotnet ef --startup-project ../server migrations add Initial -c MsSqlContext

External Authentication

The system by default enables users to create a local login account using a signup page, which stores their credentials in the database.

It also enables users to login via an external authentication provider, using the OAuth 2.0 Implicit grant workflow.

Most external providers will required https support. This is covered off fairly well by Setting up HTTPS for development in ASP.NET Core

The project currently provides support for

To configure the

  • Google Provider - edit const GOOGLE_CLIENT_ID key in google-provider.ts file, and clientId in app.development.json
  • Microsoft Provider - edit const MICROSOFT_CLIENT_ID key in microsoft-provider.ts file, and clientId in app.development.json

To remove a provider from appearing the UI, edit externalProviders class property in login.ts

Startup

Run the project by switching to ./src/server and running

set ASPNETCORE_ENVIRONMENT=Development
set ASPNETCORE_URLS=https://localhost:5001
dotnet run -p server.csproj

You should now be able to load the site at https://localhost:5001/