This is the full stack implementation for the RespiraWorks ventilator test data management system currently provided at http://data.respira.works/. It is made with javascript, react, express and react-bootstrap. Data is stored in MongoDB.
RespiraWorks is a 501(c)(3) non-profit organization with over 200 contributors worldwide working to design a low-cost and open-source ventilator for communities underserved by the global supply chain. Our objective is to provide the know-how and technology to enable others to manufacture these systems and put them in the hands of those who need them most.
Install npm, preferrably using nvm. Install and switch to Node v.16:
nvm install 16
nvm use 16You should probably also install docker (and docker-compose depending on your platform). You will need to add
yourself to the docker group as follows:
sudo groupadd docker
sudo usermod -aG docker $USERAnd now start a new terminal for user privileges to take effect.
Clone the repository and install the Node modules.
# Clone the repository
git clone https://github.com/RespiraWorks/test-data-browser
# Go inside the directory
cd test-data-browser
# Install dependencies
npm installYou will need to configure a .env file to provide MongoDB credentials, something like this:
MONGO_URI=mongodb://user:password@localhost/?retryWrites=true&w=majority&authSource=adminor
MONGO_URI=mongodb+srv://user:[email protected]/?retryWrites=true&w=majoritywhile replacing user, password and specifying correct host name.
If you are using an external Mongo provider, remember to whitelist your IP.
To run the site locally and have it reload whenever you modify it, run as:
npm run devAnd it should automatically open http://localhost:3000/ on your browser.
Do all your fun development now...
When you are ready to test the "production build" of the site, do:
# Build for production
npm run build
# Start production server
npm startAnd you should be able to see it at http://localhost:8080/
To test docker-based deployment locally:
docker build . -t whatever
docker run -p 80:8080 whatever...and now you can see it at http://localhost/
You can also test it with
docker-compose upLog into your site hosting machine.
Clone repository and set things up just like in the Getting started section above.
To spin up the site as a service:
docker-compose up -dTo stop it:
docker-compose downTo update it and delete old image versions:
git pull
docker-compose up --force-recreate --build -d
docker image prune -fOccasionally, dependencies have failed to update automatically, so you may need to do npm install before rebuilding
the docker image.