Skip to content
This repository has been archived by the owner on May 28, 2021. It is now read-only.

ess-dmsc/demax-server

Repository files navigation

demax-server

Build Status DeepScan grade

This repository constitutes the backend server of the DEMAX User Office website. The frontend part can be found here.

The Deuteration and Macromolecular Crystallisation (DEMAX) platform supports life science and soft matter research users of ESS.

The DEMAX User Office is used for submission, management and administration of proposals and requests for deuterated material production.

A live version of the backend server can be found at https://demaxapi.esss.dk. A live version of the frontend can be found at https://demax.esss.se.

Project facts:

Getting started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

  1. Node.js
  2. MongoDB
  3. PM2(Optional)

An alternative to installing MongoDB on your local machine is to use a cloud-hosted MongoDB. (mlab.com)[https://mlab.com/] is a free-to-use Database-as-a-service.

Installing

  1. git clone https://github.com/ess-dmsc/demax-server.git
  2. cd demax-server
  3. npm install --save
  4. npm install --save -g pm2 (Optional)

Run

npm run dev

Npm run dev initiates a mongod instance and sets the server to listen at port 3000. To check if the server works, go to http://localhost:3000/api - it should look like in the picture below.

http://localhost:3000/api

PM2

pm2 start process.yaml

To start the server with the process manager, make sure that PM2 is installed globally. The configuration file 'process.yaml' provides all the information PM2 needs to run the server.

Useful commands: pm2 monit - Starts the PM2 app monitor pm2 logs - Display the logs pm2 stop 0 - Stop the process (If you haven't used PM2 before, '0' is probably the process ID for demax-server) pm2 delete 0 - Deletes the process instance

To set up the frontend, simply follow the instructions of the demax-client repository.

Running the tests

npm run local_test

This command starts the mocha test runner with variables for local testing. The test files are located in the folder test/ and all end with ".spec.js.".

Deployment

This server is configured to be deployed with Docker - there are several different docker-compose files in this repository for different environments.

In the default settings, demax-server is configured to listen to port 3000. The information contained in the file docker-compose.yaml (in the root directory) has all the required information needed to pull the newest image from Dockerhub

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Authors

  • Jeremias Hillerberg

License

This project is licensed under the BSD-2 License - see the LICENSE.md file for details

Acknowledgments