GithubHelp home page GithubHelp logo

bellmit / server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ohmage/server

0.0 0.0 0.0 99.5 MB

The ohmage server application.

HTML 3.99% Java 91.97% JavaScript 1.42% Shell 0.05% Dockerfile 0.03% TSQL 2.53%

server's Introduction

ohmage API server

Join the chat at https://gitter.im/ohmage/server

ohmage is a mobile data collection system for collecting data given explicitly by a user (active data) and data that is collected by backgrounded applications (passive data). This repository houses the server-side application. The Android application can be found at here.

A description of the high-level entities can be found at here, and an introduction into how to read and write from an up-and-running system can be found here.

The API docs for the server can be found here

Setup

For web application veterans, all that is needed is a MySQL database and a servlet container.

The default ohmage technology stack runs on various Linux distros and requires:

  • Java 7
  • MariaDB 5.5 or MySQL 5.5
  • Tomcat 7.0.28 or later.

For internal hosting and development, the ohmage team uses nginx 1.9 for serving up static content and better SSL performance.

Setting Up the Database

ohmage depends on a MySQL instance. To set the database configuration, create an /etc/ohmage.conf file with the following parameters (fill in host,port,db name, user and password as needed, the defaults are shown):

db.driver=com.mysql.jdbc.Driver
db.jdbcurl=jdbc:mysql://127.0.0.1:3306/ohmage?characterEncoding=utf8
db.username=ohmage
db.password=&!sickly

Please see the db/migrations dir for more information on schema creation and migrating the database.

To note, after running the migrations and seeding, the default admin user to use is ohmage.admin/ohmage.passwd. You'll be forced to reset this password on first log in.

Setting Up the Directory Structure

ohmage depends on a set of directories to store log files and user data. By default, these are located at /var/lib/ohmage/. This directory should contain a number of subdirectories, called audits, audio, images, documents and videos. These directories can be changed through the preference table in the database. The log directory (default: /var/log/ohmage) will create itself.

Setting Up the Servlet Container

Any Servlet 3.0 compliant container should work. Internally, we use Tomcat. To build the WAR file, use ant clean dist, which will produce an ssl-disabled container. It should be noted that we do not recommend having the servlet itself handle SSL, and instead suggest you use a web server like nginx or apache to do SSL termination.

Collaboration

The coding rules are loose, and the best reference would be other parts of the code. A few rules we do have are:

  • 4 space indents (no tabs).
  • Always use curly braces even if the conditional or loop is one line.
  • Opening curly braces go on the same line of the loop or conditional declaration.
  • All comments must be no more than 79 characters (with the 80th character being a new line). Code should try to adhere to this as best as possible.

server's People

Contributors

jshslsky avatar hongsudt avatar stevenolen avatar jojenki avatar johnhicks45 avatar sdanzig avatar sw2032 avatar gitter-badger avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.