Empatica Assignment
This is my implementation of the assignment by Empatica people.
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
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
ACC.csv, EDA.csv, HR.csv, TEMP.csv
php, laravel, MySql, Json Web Token (tymondesign)
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"
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)
angularjs, bootstrap, highchart, jquery 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