Quick Start

This quick start section will help you get going with a HAT PDA and start testing the API in a matter of minutes. There are a few ways to get a running HAT PDA and the approach will depend on your skills level, available time and the actual purpose.

Get a sandbox HAT PDA from Developers Portal

The registration process is quick and straightforward. You can read more about how to create an account here. Normally, you should be able to get up and running with a new HAT PDA in a matter of minutes.

Run postman collection

You can find our postman collection here. The collection is able to run using a predefined managed HAT PDA (postman.hubat.net). If you choose to use that account, please keep in mind that other developers can see the data in this HAT PDA, DO NOT write any sensitive information on this HAT PDA. If you want to avoid using a HAT PDA with other developers you can use your personal HAT PDA by replacing the following environment variables in postman:

  • hat — your HAT PDA address, eg. postman.hubat.net
  • username — the first part of the HAT PDA address, eg. postman
  • password — the password of your HAT PDA

The goal of the collection is to showcase basic operations on a HAT PDA. The collection aims to showcase how you can:

  • authenticate with a HAT PDA
  • perform CRUD operations
  • use advanced techniques to bundle data
  • work with data debits
  • upload files
  • fetch and setup existing applications, data plugs and tools

Run HAT locally from source code

HAT is an open-source project with the full project codebase available on GitHub. With a bit of technical knowledge, it should be relatively easy to follow the steps below to setup and run the project on a localhost (if it's not, please let us know how we can improve!).

Before starting make sure the following pre-requisites are installed:

  • Java SDK 8
  • Scala Runtime 2.12
  • Scala Build Tool (SBT) 1.0
  • PostgreSQL 9.6

To launch HAT instance, follow these steps:

  1. Clone HAT repository and its submodules:

    git clone https://github.com/Hub-of-all-Things/HAT2.0.git
    cd HAT2.0
    git submodule init
    git submodule update
  2. Create the database:

    createdb testhatdb1
    createuser testhatdb1
    psql postgres -c "GRANT CREATE ON DATABASE testhatdb1 TO testhatdb1"
  3. Compile the project:

    sbt compile
  4. Add custom local domain mapping to your /etc/hosts file. This will make sure that when you go to the defined address from your machine, you will be pointed back to your own machine. E.g.:   bobtheplumber.hat.org
  5. Run the project:

    sbt "project hat" "run -Dconfig.resource=dev.conf"
  6. Go to http://bobtheplumber.hat.org:9000

You're all set! Now is a good time to start getting a deeper understanding of the technology through the available guides.