8000 GitHub - c-m/mood-meter: Mood meter repo based on https://github.com/mihneadb/stressed
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

c-m/mood-meter

Repository files navigation

Mood meter

Easy way to measure the amount of stress and happiness within a team/project/random context.

Data is stored in an sqlite db. It looks like this:

    {
      "id": 1,
      "message": "happy",
      "timestamp": 1428273876
    }

Up and running

Docker

You can simply fire it up using:

docker build -t mood-meter --no-cache .
docker run -p 8080:80 -it mood-meter

The server will be available on 127.0.0.1:5000.

Local install

Use the provided requirements.txt to install the deps and then you can either run the Flask development server using python app.py or start the app via gunicorn, using gunicorn -k eventlet app:app.

Don't forget to build the JS as well - you can read everything about it in static/README.md.

URLs

GET / - home for frontend.

GET /api/statuses/ - list endpoint for status objects (supports filtering via message, since and until).

Example:

{
  "data": [
    {
      "id": 3,
      "message": "happy",
      "timestamp": 1428276198
    },
    {
      "id": 2,
      "message": "happy",
      "timestamp": 1428273877
    },
    {
      "id": 1,
      "message": "happy",
      "timestamp": 1428273876
    }
  ]
}

POST /api/statuses/ - adds a new status; needs content-type json and {"message": $msg}, with $msg one of "stressed" and "happy".

GET /api/timeseries/ - data endpoint for building timeseries graphs on top of the data (supports same filters as statuses/ and, in addition, a resolution - day, hour, minute or second - defaulting to day).

Example:

{
  "1428192000": 3,
  "1428278400": 0
}

Changing what to count

The possible statuses are defined in constants.py. Feel free to change them and everything will keep working!

About

Mood meter repo based on https://github.com/mihneadb/stressed

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0