Please see the documentation start page for more detailed documentation.
The CanonnApi Frontend and Backend together rely on Auth0.com for authentication.
To locally develop with authenticated users, please sign up to Auth0 (free plan is fine), make yourself comfortable with it, and then follow the steps explained in Auth0 Setup.
The API is a .NET Core ASP.NET Core WebApi project. You can develop on the API solution with the free Visual Studio 2017 Community Edition.
The database migration tool is a .NET 4.6 command line project. This can also be build with Visual Studio 2017 community edition.
These are the steps required to locally set up the api:
- Create a new MariaDb (or MySQL) database.
- Create a user that has sufficient privileges on that database to insert, read, update and delete data in tables in this database.
- Create a second user that has sufficient privileges to edit the DB schema for the db updates.
- In the Visual Studio project
\CanonnApi.Backend\CanonnApi.Database.AutoUpdater
open the fileconfig.json
and enter the connection string with nameconnectionString
in the formatserver=SERVERNAME;database=DBNAME;userid=DBUSERNAME;password=DBUSERPASSWORD
. Use the user name / password for the user that may create the database schema (step 1.2) here as well as the database name created in step 1. - Build and exeute the project. This will create the required tables in your database and seed the initial data.
- Copy the file
appsettings.Secrets.json
from the folderdocs\configuration\api
to the folderCanonnApi.Backend\CanonnApi.Web
and fill the empty double quotes with your Auth0 domain and client id. Also, fill the connection string forruinsDb
in the formatserver=SERVERNAME;database=DBNAME;userid=DBUSERNAME;password=DBUSERPASSWORD
with the user created in step 1.1 and the database name form step 1.
The API will locally run on port 52685.
You can either start the API from within Visual Studio or from the commandline. For that, go to the CanonnApi.Backend\CanonnApi.Web
folder and call the start_dev.bat
. This will set an environment variable so that the API runs in Development mode, and compile and start the API project.
The client application / web site is an Angular Single Page Application (SPA), built with Angular 4.
Prerequisites to build the web application:
- Node.js (ideally the latest 6.x LTS version).
- Angular-CLI.
When Node.js is installed, enternpm install -g angular-cli
on the commandline to install the angular CLI tooling. - On the commandline, go to the folder
CanonnApi.Frontend
and run the commandnpm install
. This will install all required additional dependencies for the RuinsApp.
To start the development web server and to run the web app:
- On the commandline, go to the folder
CanonnApi.Frontend
. - Start the development web server with the command
ng serve
.
This will compile the application and start the development web server. Any changes on the web apps files will automatically be detected, compiled, and any instance of the running app will be automatically updated. - Point your web browser to
http://localhost:4200
to run the app.