-
Notifications
You must be signed in to change notification settings - Fork 0
Microbrew.it API Web Stack
This page outlines the stack used by the Microbrew-it backend. You will need to install most of these applications/services to be able to run the API and contribute to the development of the software:
- Node.js ( http://nodejs.org/ ): used to run the API (i.e connect the dots).
- PostgreSQL ( http://www.postgresql.org/ ): used to store userdata.
- Redis ( http://redis.io/download ): used for sessions and frequently used queries.
- Sesame ( http://www.openrdf.org/download.jsp ): used to store data (in graphs).
-
- Tomcat ( http://tomcat.apache.org/ ): used to run Sesame.
-
- our ontology ( https://github.com/Microbrewit/brewingOntology ): defines entities and relations between entities in the graph.
-
Node.js is a Javascript-based server framework. We use Node.js with Express to develop the API-part of the backend. Node.js can be found at http://nodejs.org/. If you use Ubuntu (or other Linux distros) you can find a tutorial on how to add the official packages at: https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager.
Our node.js api have some dependencies. These are listed in the package.json file.
The API use a PostgreSQL database to store basic user info such as username, email, a hashed and salted password and user settings. PostgreSQL can be found at http://www.postgresql.org/. If you use Ubuntu PostgreSQL can be installed using sudo apt-get install posgtresql. A detailed description of how to install PostgreSQL on Ubuntu 12.04 (should work on all version =< 12.04) can be found at: http://fracturedplane.blogspot.no/2013/02/installsetup-postgres-91-on-ubuntu-1204.html.
CREATE TABLE users (
id serial primary key,
username varchar(256) NOT NULL,
email varchar(256) NOT NULL,
password varchar(60) NOT NULL,
settings text NOT NULL,
UNIQUE(username),
UNIQUE(email));
Redis is a key-value store with both in-memory and persistent storage of data. The Microbrew-it API currently use it to store user sessions, but will in the future also use Redis to cache frequently requested resources. To install Redis (server and client) you can download an installation file from http://redis.io/download or follow the terminal command guide on the same page. Alternatively, for those using Ubuntu you can install the latest version through the following ppa: https://launchpad.net/~rwky/+archive/redis. More detailed instructions are provided on the ppa site.
The Microbrew.it data is stored in a graph store powered by Sesame. Sesame provides a Sparql endpoint that we use to extract data. Sesame and a workbench utility that can be used to directly manipulate the graph through a GUI is available at http://www.openrdf.org/download.jsp. In order to host a Microbrew.it endpoint you will need to import the Microbrew.it ontology, available at https://github.com/Microbrewit/brewingOntology. The ontology defines the entities used in the graph, and the relation between entities.
Sesame runs on a Tomcat instance. Tomcat is a Java-based webserver. Tomcat is available at http://tomcat.apache.org/ or through most package managers.