Giter Club home page Giter Club logo

mafil-volunteer-data-giver's Introduction

Web application for sending acquired medical (DICOM) data to volunteers

This application was created for the MAFIL laboratory as my bachelor's thesis. The entire text of the thesis can be found here.

Table of Contents

Installation Tutorial

  1. Install Docker
  2. Fill out the required env variables in docker-compose.yml (for frontend as well as backend!)
    • Odorik credentials are needed for sending SMS messages
    • Mail credentials are needed for sending emails
    • INCOMING_API_KEY and OUTGOING_API_KEY are used for communication with other MAFIL microservices
    • PACS_API_URL and LOG_API_URL represent endpoints of MAFIL microservices that are used by this application (application fails gracefully if they are not provided)
    • TOKEN_SECRET and EMAIL_TOKEN_SECRETS are secrets used for signing Json Web Tokens
    • HASH_PEPPER can be used for stronger password hashing
    • LOGIN_URL represents a URL of the frontend login page
    • SITE_ADDRESS represents the URL (domain) of the website - it is needed to create an SSL certificate for it
    • The other env variables can be used to change small particularities of the system (timeouts, limits, etc.)
    • For more information about the particular variables see .env.example in the respective folders (backend/frontend)
  3. Go into the folder "frontend" (this step is neccessary due to facebook/create-react-app#982)
    • Copy the .env.example file and rename it to ".env"
    • Fill the variable REACT_APP_API_URL in the newly created ".env" file
    • Save the ".env" file
  4. Run docker-compose up

(If there are any problems or some functionality is missing, it may be necessarry to do the step 3 also for the folder "backend" and fill all the variables. However, it should not be needed.)

API Endpoints

Authorization can be performed either as a bearer tohen in the Authorization header, or as a field "access_token" in the body of the request.

POST /api/users

Description: Create a new volunteer account

Used by: MAFILDB

Authorization: Incoming API key

URL params: none

Body:

{
  "email": "[email protected]",
  "phoneNumber": "+420111111111", // must contain +
  "visitDate": "1660000073131", // timestamp of ms
  "name": "John Doe",
  "studyInstanceUID": "study82733"
}

Response: 201

{
  "id": "18d1521b151fsayh4" // string
}

POST /api/users/tokens

Description: Get a USER token (for other actions)

Used by: Volunteer

Authorization: Email token

URL params: none

Body:

{
  "secret": "620BBB06C8" // code from SMS
}

Response: 200

{
  "id": "18d1521b151fsayh4", // string
  "token": "jf81js2basb9b71babsab..." // string
}

GET /api/users/<userId>

Description: Get volunteer details

Used by: MAFILDB, Volunteer

Authorization: Incoming API key || USER token

URL params: userId

Body: empty

Response: 200

{
  "id": "18d1521b151fsayh4", // string
  "expirationDate": "1660000073131", // timestamp of ms
  "visitDate": "1660000073131", // timestamp of ms
  "dataSize": "2.554815" // size in GB
}

DELETE /api/users/<userId>

Description: Delete a volunteer

Used by: MAFILDB, Volunteer

Authorization: Incoming API key || USER token

URL params: userId

Body: empty

Response: 204 - empty

PUT /api/users/<userId>/data

Description: Deliver images from PACS

Used by: PACS-API

Authorization: Incoming API key

URL params: userId

Body:

multipart/form-data:

  • files: [file1, file2, file3] // array of DICOM files

Response: 204 - empty

POST /api/users/<userId>/data

Description: Download data package with images

Used by: Volunteer

Authorization: Email token

URL params: userId

Body: empty

Response: 200 - native data download starts

GET /api/users/study/<studyInstanceUID>

Description: Get IDs of users with specific studyInstanceUID

Used by: MAFILDB

Authorization: Incoming API key

URL params: studyInstanceUID

Body: empty

Response: 200

[ user1, user2, user3] // array of users

GET /api/users/secrets

Description: Send login code to volunteer's mobile phone

Used by: Volunteer

Authorization: Email token

URL params: none

Body: empty

Response: 204 - empty

GET /api/users/secrets/details

Description: Get details of the sms login code

Used by: Volunteer

Authorization: Email token

URL params: none

Body: empty

Response: 200

{
  "leftSMSAmount": "21", // number
  "secretExpirationDate": "1660000073131", // timestamp of ms
  "secretTryAmount": "2" // number
}

mafil-volunteer-data-giver's People

Contributors

jakubvanko avatar

Watchers

 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.