Skip to content

Backend API Server for NeuroKnight. Python2.7, Flask and Postgres.

Notifications You must be signed in to change notification settings

NightWatchApp/backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NightWatch

Your personal medical guardian - detects Seizures, Sleep Paralysis, Sleep Apnea, Narcolepsy, Brigada and many more!

NightWatch uses a coordination of IoT devices and sensors - a heart rate sensor (through the Pebble Smart Watch), a muscle tension sensor and a breathing sensor (which is a modified temperature sensor).

API Routes

All the API endpoints are accessible under <hostname>/api. All of the outputs are of the form:

{
  "status": "<int>",
  "message": "<string>",
  "data": "<dict>"
}

The outputs of each API Route correspond to the modified attributes of this default output JSON.

  1. /api/signup - Sign a user up
  • POST/GET
  • Input: {username, password, full_name}
  • Returns: {status, message}
  1. /api/login - Log a user into the system
  • POST/GET
  • Input: {username, password}
  • Returns: {status, message, data:{token}}
  1. /api/user/measurement - Collect instrument values from the various sensors
  • POST/GET
  • Input: {token, value, instrument, record_time?}
  • Returns: {status, message}
  1. /api/user/relative - Add a family relative (and that relative's phone number) for the emergency notification system
  • POST/GET
  • Input: {token, full_name, phone}
  • Returns: {status, message}
  1. /api/user/get_measurements - Get all of the measurements for the user

    • POST/GET
    • Input: {token, instrument?}
    • Returns: {status, data:{results: [{instrument, value, record_time}], message}}
  2. /api/user/get_relatives - Get all of the relatives for the user

    • POST/GET
    • Input: {token}
    • Returns: [status, data:{results: [{full_name, phone}]}, message]

About

Backend API Server for NeuroKnight. Python2.7, Flask and Postgres.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages