Code Monkey home page Code Monkey logo

canonnapi's Introduction

Projects for the Canonn API system(s)

Please see the documentation start page for more detailed documentation.

Getting started

External dependencies

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.

API

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:

  1. Create a new MariaDb (or MySQL) database.
    1. Create a user that has sufficient privileges on that database to insert, read, update and delete data in tables in this database.
    2. Create a second user that has sufficient privileges to edit the DB schema for the db updates.
  2. In the Visual Studio project \CanonnApi.Backend\CanonnApi.Database.AutoUpdater open the file config.json and enter the connection string with name connectionString in the format server=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.
  3. Build and exeute the project. This will create the required tables in your database and seed the initial data.
  4. Copy the file appsettings.Secrets.json from the folder docs\configuration\api to the folder CanonnApi.Backend\CanonnApi.Web and fill the empty double quotes with your Auth0 domain and client id. Also, fill the connection string for ruinsDb in the format server=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.

Client Application / Web Application

The client application / web site is an Angular Single Page Application (SPA), built with Angular 4.

Prerequisites to build the web application:

  1. Node.js (ideally the latest 6.x LTS version).
  2. Angular-CLI.
    When Node.js is installed, enter npm install -g angular-cli on the commandline to install the angular CLI tooling.
  3. On the commandline, go to the folder CanonnApi.Frontend and run the command npm install. This will install all required additional dependencies for the RuinsApp.

To start the development web server and to run the web app:

  1. On the commandline, go to the folder CanonnApi.Frontend.
  2. 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.
  3. Point your web browser to http://localhost:4200 to run the app.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.