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.
- Language: JavaScript
- Runtime: Node.js
- Database: MongoDB
- Package manager: NPM
- Process manager: PM2
- Environment: Docker
- Testing: Jenkins and Travis
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.
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.
git clone /~https://github.com/ess-dmsc/demax-server.git
cd demax-server
npm install --save
npm install --save -g pm2
(Optional)
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.
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.
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.".
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
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
- Jeremias Hillerberg
This project is licensed under the BSD-2 License - see the LICENSE.md file for details