Code Monkey home page Code Monkey logo

communityline's Introduction

Community line

A system developed in a hurry in March 2020 to automate the routing of telephone calls to volunteer workers.

  • Multiple volunteer groups are supported.
  • Calls are handled by Twilio - the system allows definition of who the call will route to at a given hour.
  • Voicemail service can also be provided, with the recording and transcript emailed to a specified email address for a given volunteer group. Sendgrid is used for sending mails.
  • Batch email sending to volunteers for the next day, to remind them they have a shift on the phone.
  • The system ran on a free Heroku dyno, which is no longer available.

Limitations

May not be usable in its exact current form, but is open-sourced in case it is of interest (or amusement!) for someone. Specific limitations:

  • Not much documentation.
  • Not very comprehensive testing.
  • Some of the code is not very well-written for readability / maintainability. The main aim was to write the code in such a way as to minimise the chance of making a mistake since I didn't have many tests or much time.
  • I had to anonymise / edit some hardcoded details (email addresses etc.) when preparing for open-source. This may not have resulted in consistent names in some places.

Notes

The following sections are a verbatim reproduction of notes I kept for myself whilst running and developing the system. They have not been edited for general readability yet.

Development

  • python manage.py makemigrations after modifying models
  • python manage.py migrate after making migrations

Ops

  • Backups:
    • heroku pg:backups:capture --app communityline to back up the database
    • heroku pg:backups --app communityline to see backups
    • heroku pg:backups:url <backup number> --app communityline to see backup URL to download
    • See docs for more (link below)
  • Change Python version by editing runtime.txt
  • Twilio Debugger: https://www.twilio.com/console/debugger
  • Deploying to Heroku:
    • git push heroku master
    • The deploy runs the migrations automatically

Testing

General preparation / running

  • Open up anaconda powershell prompt
  • Activate villageline environment
  • Source env_vars.ps1: . .\env_vars.ps1
  • Run heroku local web -f Procfile.windows

Interactively with Postman

  • Collection of queries exported into villageline-other
  • Call handle URL to use: http://localhost:5000/callrouting/handle
    • Need to create a POST request with the To field populated with the called number
  • There are postman saved queries for the recording and transcription hooks too.
    • These need the CallSid which must be "CA..." 34 chars and unique
    • Plus recording URL or transcription status and text as appropriate

Exploration through the web interface

Automated testing

  • Run with python manage.py test <test spec>
  • e.g. python manage.py test callrouting.tests.VolunteersViewTests.test_no_shifts

Resources:

communityline's People

Contributors

gmarkall 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.