Difference between revisions of "SafeCode"

From Hackstrich
Line 33: Line 33:
 
*** Check-in non-OK, in session
 
*** Check-in non-OK, in session
 
** Time of next expected check-in (if in session)
 
** Time of next expected check-in (if in session)
 +
 +
== Daemon to Web Service Protocol ==
 +
* JSON-based
 +
** Command
 +
*** event - client_arrived, check_in, check_out
 +
*** distress - true/false
 +
** Response
 +
*** status - accepted, error, distress
  
 
[[Category:Current Projects]]
 
[[Category:Current Projects]]

Revision as of 22:55, 4 June 2013

SafeCode is a software/hardware solution to handle digital safe-calls for independent in-call sex work.

Project Status

  • 2013-06-03: Got a prototype box up using an Arduino + TouchShield, can now log in to a session successfully. I've kind of got "business logic" spread between the web service and daemon now, next step is to move all of that into the web service, daemon should just be hardware interfacing and keepalive.
  • 2013-06-02: Started writing software. Frontend now loads and connects to the web service, as does the backend daemon. Still have some cleanup/reliability improvements to do, but basic functionality is there (minus hardware interfacing).
  • 2013-06-01: Started thinking about/planning.

Hardware

  • Small/portable box
  • Rugged design, as it will be thrown in bags/traveled with constantly
  • USB connected/powered
  • Keypad on top to enter data (Storm 6000-21001, telephone-style 12 key + Cancel, Clear, Help, Enter)
  • Lighting to provide feedback for "entry received" and such
  • Beeper for indicating exceeding check-in time without checking in

Software

  • Daemon that runs on the local machine talking to the SafeCode box
  • Web service that runs on an outside server that reports status to others
  • Keepalives between all components to indicate that a connection was broken

Web Service Architecture

  • Sinatra-based daemon
  • Accepts WebSocket connections from the daemon talking to the SafeCode box and monitors to ensure that connection stays open and that keepalives are being received
  • Serves web pages & uses WebSockets to update status in real-time for anyone monitoring
  • Keeps state of:
    • Current geographical location
    • Connectivity to daemon
    • Daemon's connectivity to the SafeCode box
    • Session state
      • Not in session
      • Client arrived, no check-in yet
      • Check-in OK, in session
      • Check-in non-OK, in session
    • Time of next expected check-in (if in session)

Daemon to Web Service Protocol

  • JSON-based
    • Command
      • event - client_arrived, check_in, check_out
      • distress - true/false
    • Response
      • status - accepted, error, distress