frdrwrt / hute

Apache License 2.0
5 stars 0 forks source link

HUTE

HUTE is a project to track weather data. It provides a graphql api. It is possible to send data recorded by a device of your choice. A progressive web app lets you comfortable check your records from anywhere. Further this project will collect informations from the commuinty about how to build your own device and connect it with the application.

Have a look on https://hute.info.
It is also possible to access the graphql api under https://hute.info/graphql.

Contributions are welcome!

If you have an idea about what feature would make hute even better, feel free to create an issue or even help to make your feature become reality.

Local development

To get this project up and running on your local machine, you need the following requirements:

After cloning the repository you can start app and server either by

Docker mode

    ./hute start            # start complete stack
    ./hute start db         # start db 
    ./hute start db-test    # start db-test
    ./hute start app        # start app
    ./hute start server     # start server

The same way you can stop the stack or parts of it with ./hute stop.

Dev mode

First you need to install the dependencies with a simple

    yarn

Next you need to start the DB.

    ./hute start db

You can than excess either app or server directory and start it in development mode. Which includes a livereload on code changes.

    cd app && yarn dev    
    cd server && yarn dev 


To run tests you need to start the test db first

    ./hute start db-test

We use jest test framework which can be started like this:

    cd server && yarn test

Stack can be accessed on the following ports/urls

DB seed

Sometimes it is helpful to have some dummy data in the database for development. You can seed the db with some simple data:

    ./hute seed

To create your own seed files, checkout http://knexjs.org/#Seeds-API for more information

Migrations

To create and run migrations use the following commands:

    ./hute migration            # run migrations on db and db-test
    ./hute migration dev        # run migrations on db
    ./hute migration test       # run migrations on db-test
    ./hute migration create     # create a new migration file