Skip to content

Getting Started

Benedikt Schulze Baek edited this page Mar 8, 2017 · 29 revisions

This is a Step-By-Step Getting Started, that will help you setting up your first running projects using chayns® and the chayns® Backend API.

Requirements

  • chayns® site (free)
  • chayns® partner account (tspn)
  • webserver (local-)
  • Microsoft Visual Studio / NodeJS

Step 1 - Clone the project

Clone or download the project from this repository.
Now choose a programming language for the backend (C# or NodeJS).
Make sure that the backend project and the index.html file located in the 'GetLocationInfo' folder can be reached through the WWW.
Follow the setup instructions for one of the backend projects and make the fetch-method in the index.html file pointing to the backend api.

Step 2 - Create a developer tapp

Go to the tapp administration and register a new tapp. Call it whatever you want, but in the url field, point at the index.html mentioned in the last step.
Select the required permission PublicInfo (The required permissions are listed for each api endpoint in the reference).
Note the tapp secret and installation code.
The secret is required for authorization later on, the installation code is used to install this developer tapp on any chayns site.

Step 3 - Install the tapp

On your chayns site, go to the configuration -> Tapps -> Add Tapp -> External Content.
Choose any name. Where it says to add an URL, just insert the installation code you copied from the tapp administration.
Now you have to agree to the requested permissions of the tapp you set in the tapp administration. Go ahead an the tapp is installed.
Now go to the tapp and you will see a little intro text.

Step 4 - Tapp Secret

If you open the console while on the tapp, there is an error log caused by a 409-http error.
This is caused by the API because there is no tapp secret stored in the code.
Now open the project you selected and add the tapp secret of your developer tapp.

  • C#: Go to Controllers -> LocationController.cs and insert the tapp secret into the 'Secret'-variable
    • -> Rebuild the project
  • NodeJS: Go to Src -> index.js and insert the tapp secret into the 'Secret'-variable
    • -> Execute 'npm run server' via the NodeJS command line while in the NodeJS directory (if the server isn't running already)

Step 5 - Try it out

Now you can open the tapp on your chayns site and you can see the location info plotted in a content__card element.

Clone this wiki locally