How to set up your development project

How to set up your development project

It is quite easy to get started developing towards a Twinfinity portal. In this brief article you will find a step by step, how to set up your project and what you need to get everything up and running.

Prerequisites

There are some things you need to get sorted before you can start developing towards a Twinfinity portal. For your convenience we’ve listed them here:

  • certificate.key and certificate.pem files

  • client-id which is an ID that is provided by Twinfinity. Reach out to your local Twinfinity contact to acquire one.

  • IDP-url (typically bim.[your portal url]/idp

Steps to set up your project.

Setting up your project is easy ising the twinfinity-templates. This npm package will help you set up everything you need, from authentication to loading your first model. It will provide you with a solid starting point for your Twinfinity digital twin project. Here are the steps needed to get a development project started towards a Twinfinity portal:

  1. Open your favourite IDE

  2. Install twinfinity templates

    “npm install -g @twinfinity/templates”

  3. Create a directory for your project.

  4. Open your IDE and in the terminal enter

    “twinfinity-templates typescript <project directory>”

  5. Add your “certificate.key” and “certificate.pem” file to your project directory.

  6. In your IDE, open a terminal:

    1. cd <project directory>

    2. npm install

    3. npm run serve


Your project is now running and can be seen in a browser at localhost:9000