Git Product home page Git Product logo

fit5120's Introduction

Data processing backend for the FIT5120 Capstone Project

This is the back-end program for of our project titled: Reducing Transport Injuries - Fighting Fatigue

It is developed using the Flask web framework.

View the product video for this project:

product video

Features

  • Implementation of the Psychomotor Vigilance Test (PVT) for measuring fatigue
  • Alternative route discovery. Routes are tagged as Safest, Fastest, and Shortest

System Overview

Application Architecture

Usage

→ Prepare the application

$ git clone https://github.com/cigarplug/fit5120.git
$ cd fit5120

→ Create your heroku application

$ heroku create <your-app-name>

→ Declare environment variables

The vars are stored in the .env file in your app directory

user : database username
password : database password
host : link to the database host
gcp_key : client key of your Google Maps Directions API project
mapbox_tile : url and access key from your MapBox account

→ Run the application on local machine

$ heroku local

→ To deploy the application, (in your app directory) run:

$ git push heroku master

→ The application is now deployed. Ensure that at least one instance of the app is running:

$ heroku ps:scale web=1

API Docs

Type Location Description Return Type
HTTPS POST /map HTML map: route + accident clusters html
HTTPS POST pvt_data/summary Fatigue: star rating + description json
HTTPS POST pvt_data/chart Visualization of PVT response times image/png

For the /map endpoint, the request data is in json format with the following structure:

{
    "origin": {
        "qry_type": "txt",
        "query": "Melbourne"
    },
    "dest": {
        "qry_type": "latLon",
        "query": {
            "lat": "-37.8847163",
            "lon": "145.0695384",
            "address": "Chadstone SC"
        }
    },
    "tags": "safest"
}
 

For the fatigue test result endpoint i.e, /pvt_data the request json data structure is:

{
  "reaction_times": [0.67, 1.23, 1.07, 1.22, 1.11, 0.7, 1.43],
  "test_times": [5, 10, 8, 8, 6, 9, 5],
  "false_clicks": 3
}

fit5120's People

Contributors

cigarplug avatar dependabot[bot] avatar

Watchers

 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.