GithubHelp home page GithubHelp logo

petrichorcode / hat2.0 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dataswift/hat2.0

0.0 2.0 0.0 17.4 MB

The HAT Personal Data Store

Home Page: http://hubofallthings.com

License: GNU Affero General Public License v3.0

Scala 66.50% Shell 0.85% CSS 9.07% HTML 23.58%

hat2.0's Introduction

Build Status

This repository contains an implementation of the Hub-of-All-Things project Personal Data Store.

Releases

The current project version is 2.5.1: HAT 2.5.1.

About the project

Hub-of-All-Things is a platform for a Multi-Sided Market powered by the Internet of Things.

A Personal Data Management System (“the HAT”) is a personal single tenant (“the individual self”) technology system that is fully individual self-service, to enable an individual to define a full set of “meta-data” defining as a specific set of personal data, personal preferences, personal behaviour events. The HAT allows individuals to share the right information (quality and quantity), with the right people, in the right situations for the right purposes and gain the benefits.

PhD Comics explains the HAT

Technology stack

This HAT PDS implementation is written in Scala (2.11.8) uses the following technology stack:

  • PostgreSQL relational database (version 9.5)
  • Play Framework (version 2.6.6)
  • Akka (version 2.5.4)
  • Slick as the database access layer (version 3.2.1)

Running the project

HAT Setup

HAT runs as a combination of a backing PostgreSQL database (with a public schema for flattened data storage) and a software stack that provides logic to work with the schema using HTTP APIs.

To run it from source in a development environment two sets of tools are required:

  • PostgreSQL database and utilities
  • Scala Build Tool (SBT)

To launch the HAT, follow these steps:

  1. Create the database:
    createdb testhatdb1
    createuser testhatdb1
    psql postgres -c "GRANT CREATE ON DATABASE testhatdb1 TO testhatdb1"
  2. Compile the project:
    sbt compile
  3. Add custom local domain mapping to your /etc/hosts file. This will make sure when you go to the defined address from your machine you will be pointed back to your own machine. E.g.:
    127.0.0.1   bobtheplumber.hat.org
    
  4. Run the project:
    sbt "project hat" "run -Dconfig.resource=dev.conf"
  5. Go to http://bobtheplumber.hat.org:9000

You're all set!

Customising development environment

Your best source of information on how the development environment could be customised is the hat/conf/dev.conf configuration file. Make sure you run the project locally with the configuration enabled (using the steps above) or it will just show you the message that the HAT could not be found.

Among other things, the configuration includes:

  • host names alongside port numbers of the test HATs (bobtheplumber.hat.org:9000)
  • access credentials used to log in as the owner or restricted platform user into the HAT (the default password is a very unsafe testing)
  • database connection details (important if you want to change your database setup above)
  • private and public keys used for token signing and verification

Specifically, it has 4 major sections:

  • Enables the development environment self-initialisation module:
    play.modules {
      enabled += "org.hatdex.hat.modules.DevHatInitializationModule"
    }
    
  • Sets the list of database evolutions to be executed on initialisation:
    devhatMigrations = [
      "evolutions/hat-database-schema/11_hat.sql",
      "evolutions/hat-database-schema/12_hatEvolutions.sql",
      "evolutions/hat-database-schema/13_liveEvolutions.sql",
      "evolutions/hat-database-schema/14_newHat.sql"]
    
  • devhats list sets out the list of HATs that are served by the current server, for each including owner details to be initialised with and database access credentials. Each specified database must exist before launching the server but are initialised with the right schema at start time
  • hat section lists all corresponding HAT configurations to serve, here you could change the HAT domain name, owner's email address or public/private keypair used by the HAT for its token operations

Deployment

HAT is intended to be run inside Docker containers. To build a new container, execute:

export REPOSITORY_NAME="hubofallthings"
./deployment/ecs/docker-aws-deploy.sh

The script is a thin wrapper around a few basic Docker commands. It allows for changing the name of the repository you want to deploy the container to and tags it with the git commit fingerprint for the current code version. Otherwise, it could be simplified to:

# Scala Build Tool to compile the code and prepare Dockerfile
sbt "project hat" docker:stage

# Build the Docker container
docker build -t hubofallthings/hat hat/target/docker/stage

Uploading the container to a Docker repository is left out

Additional information

License

[HAT including HAT Schema and API] is licensed under AGPL - GNU AFFERO GENERAL PUBLIC LICENSE

hat2.0's People

Contributors

andriusa avatar mrmrtalbot avatar augustinas avatar 4knahs avatar r-gl avatar coolseraph avatar gscardine avatar whiteshadow-gr avatar

Watchers

James Cloos avatar  avatar

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.