Skip to content

Development Setup

Param Siddharth edited this page Jul 14, 2021 · 2 revisions

Development Setup

Here, you'll find the instructions to setup the development environment for Rema.

Dependencies for the Canvas API

Setting up the development requires the system to have the dependencies for the node-canvas module set up. The dependencies are required to have the Node.js port of the Canvas API to work properly in the back-end.

The detailed and updated setup information for its dependencies is given in the node-canvas wiki.

OS Command
OS X Using Homebrew:
brew install pkg-config cairo pango libpng jpeg giflib librsvg
Ubuntu sudo apt install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
Fedora sudo yum install gcc-c++ cairo-devel pango-devel libjpeg-turbo-devel giflib-devel
Solaris pkgin install cairo pango pkg-config xproto renderproto kbproto xextproto
OpenBSD doas pkg_add cairo pango png jpeg giflib
Windows See the node-canvas wiki
Others See the node-canvas wiki

Ensuring the abovementioned dependencies are properly set up and configured, install the package dependencies.

cd src
npm ci

If successful, you can proceed to the next step.

A MongoDB Server

Run a MongoDB server and add the server URI to the DB environment variable before starting up Rema.

# If not set, defaults to 'mongodb://localhost/rema'
export DB='mongodb://uri.to.mongodb/dbname'

Check out the Environment Variables page for more details on the environment variables.

Starting Rema in Development Mode

Rema runs on port 8080 by default. To use a custom port, use the PORT environment variable.

# For development, listening to code-changes
npm run dev

# For production, not suggested for development
npm start

Great! Rema is up and running on http://localhost:8080.