= LiquidFeedback API Server (lfapi) The LiquidFeedback API Server provides a programming interfaces to all features of the [[Core|LiquidFeedback Core]] Version 2.0.0 and above. The interface is technically described in the the [[API|LiquidFeedback API specification]]. The server is implemented as [[http://node.js|node.js]] application. The current implementation status and installation instructions are available below. At [[http://apitest.liquidfeedback.org/|apitest.liquidfeedback.org]] is a public alpha test installation dedicated for application developers available. == Development Status === NOT implemented yet === - Custom ordering of results, results are ordered ascending by id - Auth/session management, registration, login, adding of applications - Implement time warp function for devel mode - Automatic test case - Black-Box-Testing? === Module status === - GET /session done (preliminary) - GET /info done - GET /member_count done - GET /contingent done - GET /contingent_left done - POST /echo_test done - GET /member done - POST /member done - GET /member_history done - GET /member_image done - POST /member_image TODO - GET /contact done - POST /contact TODO - GET /privilege done - GET /policy done - GET /unit done - GET /area done - GET /allowed_policy done - GET /membership done - POST /membership done - GET /issue done - GET /population done - GET /interest done - POST /interest done - GET /issue_comment done - POST /issue_comment done - GET /initiative done - GET /initiator done - POST /invite_initiator TODO - POST /initiator TODO - GET /supporter almost done, snapshots missing - POST /supporter done - GET /battle done - GET /draft done - POST /draft done - GET /suggestion done - GET /opinion done - POST /opinion TODO - GET /delegation almost done, include_* support missing - POST /delegation done - GET /voter done - GET /delegating_voter done - GET /vote almost done, include_* support missing - POST /vote TODO - GET /event done - GET /ignored_member TODO - POST /ignored_member TODO - GET /ignored_initiative TODO - POST /ignored_initiative TODO - GET /setting TODO - POST /setting TODO == Installation === LiquidFeedback Core To use lfapi you need a working instance of the LiquidFeedback Core Version 2.x.x. It is available for download at http://www.public-software-group.org/liquid_feedback_core as tarball or via mercurial repository. Please follow the installation instructions in the [[http://www.public-software-group.org/mercurial/liquid_feedback_core/file/tip/README|LiquidFeedback Core README file]]. === node.js To install node.js please follow their installation guide as found on [https://github.com/joyent/node/wiki/Installation]. Shortcut: {{{ git clone --depth 1 https://github.com/joyent/node.git cd node git checkout origin/v0.4 # optional. Note that master is unstable. export JOBS=2 # optional, sets number of parallel commands. mkdir ~/local ./configure --prefix=$HOME/local/node make make install echo 'export PATH=$HOME/local/node/bin:$PATH' >> ~/.profile source ~/.profile }}} === npm To install node-postgres you need to install the [[http://npmjs.org/|node package manager]] first. To do so enter the following command: {{{ curl http://npmjs.org/install.sh | sh }}} === node-postgres Install the node-postgres package via the node package manager: {{{ npm install pg }}} === nodemailer Install the nodemailer package via the node package manager: {{{ npm install nodemailer }}} === lfapi The latest stable version of lfapi is published at [http://public-software-group.org/liquid_feedback_api] Current development versions are available via mercurial repository at [http://public-software-group.org/mercurial/lfapi] To install lfapi in /opt/lfapi use the following instructions: {{{ cd /opt hg clone http://www.public-software-group.org/mercurial/lfapi }}} == Configuration The API server needs to be configured by editing config.js in the base directory of the application. An [http://www.public-software-group.org/mercurial/lfapi/file/tip/config.js example configuration] is included. == Start server {{{ cd /opt/lfapi node lfapi.js }}} ** Before starting the server you must run lf_update from LiquidFeedback Core at least once! == Ask questions and get support If you have any questions or need help while installing and configuring the API server, don't hesitate to contact our [[http://dev.liquidfeedback.org/cgi-bin/mailman/listinfo/main|public mailing list main]]. So other administrators can learn from it too.