Server - NexusLogica/N GitHub Wiki

General

Data for components, configuration, and waveforms are stored in a database on a server. The server is a lightweight component which acts as the HTTP interface on top of the database. Owing to server accessibility at time of initial design, the server is written in PHP and the database is MySQL.

The intent of the design of the HTML/client side is to allow any programmer to run and modify the code locally, so the server is designed to support cross side JSONP and POST calls.

The server API uses a RESTful design model.

API

POST waveform

Insert a new waveform into the database.

  • URI: /waveform
  • Post parameters
    • id: A 36 character UUID string that is the unique identifier of the waveform.
    • name: A string of up to 256 characters that is the name of the waveform. It does not have to be unique, but generally should be so.
    • waveform: The waveform in a JSON string format.

GET waveforms

Get an array of all of the waveform into the database. Returns names, ids, and modification dates.

  • URI: /waveform

Returned:

[
  {"id":"15c1f427-8afb-420a-b777-86994d040517","name":"Simple wave","modification_date":"2013-06-07 19:19:55"},
  {"id":"50ec6d79-c397-4a1e-af58-7f9ec24e9a47","name":"Reticular neuron output","modification_date":"2013-06-07 19:19:55"},
  ...
]

DELETE waveform

Deletes the waveform with the given id.

  • URI: /waveform