<commit_before>lokki-server [![Build Status](https://travis-ci.org/TheSoftwareFactory/lokki-server.svg?branch=master)](https://travis-ci.org/TheSoftwareFactory/lokki-server)
============

Backend code (API server) for the Lokki project.

## Development

For developing the software, you will need:
- Recent version of [node.js](http://nodejs.org/) (tested with 0.10.33) – the distribution includes npm, which you will also need
- Recent version of [Redis](http://redis.io/) – follow installation and running instructions on Redis website

After these dependencies are installed, go to repository root and run:

    $ npm install

This will install JavaScript dependencies of the project. If you have your Redis server running (on default port), you can run server with:

    $ node lokki-server.js

Tests can be run with:

    $ node unittest-runner.js

See the [Lokki Wiki](https://github.com/TheSoftwareFactory/lokki/wiki) for more information on development.

## Files

*NOTE: Incomplete. Fill as files functions are discovered.*

- `lokki-server.js`: node.js + express app, exposing REST API.
- `lib/dbSetup.js`: setting up database for testing

## Rest API

*NOTE: this seems to be outdated, but left intact for now.*

User API
- create new user:
POST /api/user/:userId

- update user info:
PUT /api/user/:userId - body should have user object with fields which need to be changed, like: {name: "My new name"}

- get user info
GET /api/user/:userId

- user updates his location:
POST /api/user/:userId/location - body should have object like: {lon:22.2, lat:12.3, acc:10}

Dashboard API
GET /api/user/:userId/dashboard

Family API
- userId invites userId2 to his family:
POST /api/user/:userId/family/invite/:userId2

- userId accepts invitation from userId2:
POST /api/user/:userId/family/:userId2

- add or delete place. body must have place object for POST
POST|DEL /api/user/:userId/family/place/:placeId

## Manual tests

*NOTE: ``manual_test`` directory does not seem to exist – outdated section?*

- manual tests are located in "manual_test" subdirectory. They test access against external services (Amazon AWS S3).
    - to run them you need to set the access keys as environment variables. go to "lokki-server" folder and type "AWS_ACCESS_KEY_ID=TheKey AWS_SECRET_ACCESS_KEY=SecretKey ./node_modules/nodeunit/bin/nodeunit manual_test/testAWSS3.js"

## Note

Lokki is available to the open source community under Apache v2 license AS IS.

This fork of the project is READ-ONLY and thus F-Secure will not respond to any pull requests, bug reports or vulnerability reports.<commit_msg>Remove outdated things from README, update files<commit_after>lokki-server [![Build Status](https://travis-ci.org/TheSoftwareFactory/lokki-server.svg?branch=master)](https://travis-ci.org/TheSoftwareFactory/lokki-server)
============

Backend code (API server) for the Lokki project.

## Development

For developing the software, you will need:
- Recent version of [node.js](http://nodejs.org/) (tested with 0.10.33) – the distribution includes npm, which you will also need
- Recent version of [Redis](http://redis.io/) – follow installation and running instructions on Redis website

After these dependencies are installed, go to repository root and run:

    $ npm install

This will install JavaScript dependencies of the project. If you have your Redis server running (on default port), you can run server with:

    $ node lokki-server.js

Tests can be run with:

    $ node unittest-runner.js

See the [Lokki Wiki](https://github.com/TheSoftwareFactory/lokki/wiki) for more information on development.

## Files

Some files and directories of interest include:

- `lokki-server.js`: Node.js + express app, exposing REST API. You can run the application with `node lokki-server.js`.
- `unittest-runner.js`: Unit test runner. Unit tests are run with `node unittest-runner.js` command. 
- `lib/dbSetup.js`: Setting up database for testing.
- `locmap/`: Folder containing logic related to location sharing.
    - `locmap/locmap-server.js`: REST API for locmap
    - `locmap/test`: Tests for locmap
- `test/`: General tests

## Note

Lokki is available to the open source community under Apache v2 license AS IS.
{'fraction_non_alphanumeric': 0.10095011876484561, 'fraction_numerical': 0.006175771971496437, 'mean_word_length': 4.231055900621118, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3450077', 'n_tokens_mistral': 1261, 'n_tokens_neox': 1231, 'n_words': 493}