Skip to content

edragonetti/empa-Assign

Repository files navigation

empa-Assign

Empatica Assignment

This is my implementation of the assignment by Empatica people.

DEMO

THE BACK END

The REST SERVICES

A series of rest services that consume and produce json data.
All the rest services are under jwt authentication

/api/logIn It creates a jwt token, sets a http only cookie(in production it must be also with secure flag) and returns a json response with the created token.
input: {"username":"xxxxxx","password":"yyyyyy"}

/api/getTemp it returns in json the values contained in TEMP.csv
/api/getEda it returns in json the values contained in EDA.csv
/api/getAcc it returns in json the module of the x,y,z values from ACC.csv
/api/getHr it returns in json the values contained in HR.csv

the returned json format: {"t":time,"f":freq, "d":[val1,val2,val3,val4.................
t: start time in milliseconds
f: frequency
d: the data

/api/getUsers it returns in json the user list
/api/getDevices it returns in json the device list
/api/getSessions it returns in json the session list
/api/createUser it creates an user

DATABASE


users: user credentials for authentication
user_profile: user profile ("admin","doctor","operator","user")
sessions: the user sessions
role_permissions: the permission for the every role
devices: the device list

THE DATA SOURCES


ACC.csv, EDA.csv, HR.csv, TEMP.csv

FRAMEWORK AND PLATFORMS


php, laravel, MySql, Json Web Token (tymondesign)

THE FRONT END

for signing in the following users are available (username,password):
admin role: "admin","admin"
operator role: "oper1","oper1"
doctor role: "doctor1","doctor1"
user role: "user1","user1"
user role: "user2","user2"

PAGE STRUCTURE

Login view
Device view shows device list (admin,doctor,operator)
User view shows user list (admin,doctor)
Session view shows session list (admin,doctor,operator,user)
Session detail shows EDA,HR,Temperature, Accelerometers charts.(admin,doctor,operator,user)

FRAMEWORK AND PLATFORMS


angularjs, bootstrap, highchart, jquery

INSTALLATION

Prerequisites: MySQL, Apache, php (WAMP or LAMP stack)

Copy the directory empaticaAssignment under an Apache location.
Create a new schema on MYSql.
Rename "example.env to" ".env".
In ".env" set the database parameters with the created schema and your mysql instance user and password
Execute the script "db.sql" for populating schema with tables and data

About

Empatica Assignment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages