Giter Club home page Giter Club logo

trials's Introduction

Trial participant registration service

Prerequisites

  1. docker - for setting up with Docker
  2. NodeJS - for setting up locally
  3. curl - used for working with the service

Getting up and running (with Docker)

This assumes that you already have a service for getting unique ids running

  1. git clone [email protected]:adaschevici/patient-trials.git
  2. cd patient-trials
  3. build docker image docker build -t trial .
  4. docker run -it -p 5000:5000 -v $(pwd)/src:/app -e UUID_URL=<url for uuid service> trial

Getting up and running (with NodeJS)

  1. git clone [email protected]:adaschevici/patient-trials.git
  2. cd patient-trials
  3. npm i
  4. start CRUD service npx nodemon src/app.js
  5. start UUID service npx nodemon src/unique-id.js

Running the tests

npm test

Working with the API (works with curl) but easily adapted to Postman or any other http client

Performing a listing

curl -X GET http://localhost:5000/

Creating a trial participant

curl -X POST -H "Content-Type: application/json" -d '{ "phone": "123-456-789", "name": "Ally", "dob": "2020-02-12", "address": "Provost St" }' http://localhost:5000/

Updating a trial participant

curl -X PUT -H "Content-Type: application/json" -d '{ "dob": "2020-12-02" }' http://localhost:5000/<some id that exists>

Deleting a trial participant

curl -X DELETE -H "Content-Type: application/json" http://localhost:5000/<some id that exists>/soft
# OR if you want to delete the entry forever
curl -X DELETE -H "Content-Type: application/json" http://localhost:5000/<some id that exists>/hard

TODO:

  1. Add living swagger documentation for service
  2. Add docker-compose.yml for standing up the services cluster

trials's People

Contributors

adaschevici avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.