Backend application to collect and share BIONIC data.
$ npm install
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
Please refer to API for an explanation of how to interact with the Storage Platform API endpoints and more.
# start the system
$ docker-compose -f "docker-compose.yml" up -d --build
The compose builds bionic-data-storage from source, downloads mongo and links the 2 images.
Storage address:
Database address:
The Database creates a volume on the host at /tmp/mongo. If necessary, change the location in docker-compose.yml.
Check the Migrations section after starting the database but before inserting new data.
Use something like MongoDB Compass to connect to the DB and check your data.
To use authorization with the database, uncomment the authorization parameters and create 2 files that hold the db root user credentials (username/password).
echo my_username | sudo tee secrets/db_user.txt
echo my_password | sudo tee secrets/db_pass.txt
migrations, in the current form, might be removed in a future version!
Database migrations use the migrate-mongo package.
# create a new migration file
$ npm run migrate:create my-new-migration
The migration file is located in ./migrations/{timestamp}-my-new-migration.js
Populate the up and down function in the newly created file. See this.
# up
$ npm run migrate:up
# down
$ npm run migrate:down
While up will run in one go all pending migrations, down will revert only the last applied migration.
it is possible to run migrations using the storage-migrate service in docker-compose:
docker-compose --profile migration up -d
The up in this command refers to starting a dockerized service not to the migrations.
Content type
Image
Digest
Size
51.4 MB
Last updated
about 5 years ago
docker pull hypercliq/bionic-data-storage