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

Step 1 - Clone the project

  1. Clone or download the project from this repository. It is located in the 'GetLocationInfo'-subdirectory.
  2. Choose a programming language for the backend (C# or NodeJS).
    The backend project and the index.html file located in the 'GetLocationInfo' folder need to be available through the WWW.
  3. If you move the api to an other server, adjust the url in the index.html file, since it is pointing to localhost.

Step 2 - Register a developer tapp

  1. Register a new developer tapp in the tapp administration in the TSPN.
  2. Choose a name, then in the url field, point to the index.html mentioned in the last step.
  3. Check the required permission PublicInfo (The required permissions are listed in the reference for each api endpoint).

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

  1. On your chayns site, go to Configuration -> Tapps -> Add Tapp -> External Content.
  2. Choose any name. Where it asks you to add an URL, just insert the installation code you copied from the tapp administration.
  3. Now you can to agree to the requested permissions of the tapp you set in the tapp administration. Go ahead an the tapp is installed.

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.

  1. Open the project you selected and add the tapp secret of your developer tapp.
  2. Follow the instructions
  • 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 is running already, it refreshs itself)

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.
The information shown are the name of your chayns site, it's siteId, locationId and the count of registered users.


Conclusion

The example used in this Getting Started

Clone this wiki locally