Skip to content

patricepeartree/emergency-queue

Repository files navigation

header

No Maintenance Intended

About

This project was developed in the context of the Twilio x DEV community hackathon.

The Emergency Queue is a communication point between the medical responders of the national Medical Emergency Line and the patients. It is aimed at simplifying and improving the waiting process for the caller. The core feature of the application is an idle waiting line.

You can read more about the application functionalities and also check demo videos here.

Setup

Disclaimer:
For now, the setup process to prepare and start all the components of the project is somewhat cumbersome, so please be patient. It will be open to improvements in the future.

Requirements
  • Twilio account
  • Docker
  • Docker Compose (only for Linux systems, on desktop systems like Docker Desktop for Mac and Windows, Docker Compose is included as part of those desktop installs)

1. Prepare your Twilio account

In your Twilio account, you need to create and setup two TwiML Apps. For now, fill only the "Friendly Name", we will setup the Voice and Messaging webhooks in a later step.

For setup purposes, from now on we will refer to the TwiML Apps as TwiML App 1 and TwiML App 2.

See here how you can create a TwiML App in the Twilio Console.

You also need to get two Twilio phone numbers with the following characteristics:

  • Phone number 1 must have SMS and Voice capabilities. For both Voice and SMS, configure this phone number with TwiML App 1.

  • Phone number 2 must have Voice capability. For Voice, configure this phone number with TwiML App 2.

See here how you can get a Twilio phone number.

2. Environment variables

Open the server/.env file and set the environment variables with the respective values from your Twilio account:

Variable Name Variable Value
TWILIO_ACCOUNT_SID Your Twilio account identifier. Find it in the Console.
TWILIO_AUTH_TOKEN Your Twilio auth token. Find it in the Console.
INCOMING_TWILIO_NUMBER The Phone number 1 in E.164 format, e.g. "+351 987 654 321".
RESPONDERS_TWILIO_TWIML_APP_SID The application identifier of the TwiML App 2.
RESPONDERS_TWILIO_NUMBER The Phone number 2 in E.164 format, e.g. "+351 987 654 321".

3. Start the services

In the root of the project, execute the following command to start ngrok, the server and the database:

docker-compose up -d --build

4. Finish configuring your TwiML Apps

Go to localhost:4040/status and find the ngrok URL that allows public access to the locally-running server service:

ngrok-URL

Go back to the Apps your created in the first step and configure their webhooks with the ngrok URL in the following way:

  • TwiML App 1:

    Capability URL Method
    Voice ${ngrokURL}/api/voice/incoming POST
    SMS ${ngrokURL}/api/text/holdtime POST
  • TwiML App 2:

    Capability URL Method
    Voice ${ngrokURL}/api/internal/call/dial POST

5. Start the client

In the client folder, execute one of the following commands to build the executable file for the desired platform:

  • Windows:
docker-compose -f docker-compose-dist.yml run --rm client-build-windows

After the build is complete, execute the generated dist/windows/client 0.1.0.exe file.

  • Linux:
docker-compose -f docker-compose-dist.yml run --rm client-build-linux

After the build is complete, run the generated dist/linux/client-0.1.0.AppImage file.

  • Alternativelly, you can start the client application in development mode by executing npm run start.

Authors

🍪 leeforaday

patricepeartree

License

Apache License Version 2.0

About

A communication point between medical responders of the national Medical Emergency Line and the patients that implements an idle waiting line.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published