Code Monkey home page Code Monkey logo

move-up-sms-tool's Introduction

Move Up - SMS Tool

This project will allow potential clients to sign up for Move Up's services by texting a dedicated hotline.

Development Team

Project Manager: Albert Kragl

Developers: Alana Ceci, Alex Lam, Jonathan Colaco Carr, Kira Noël, Madonna Huang, Nafiz Islam, Tom Wright, Xin Rui Li, Yasasa Abey

Setup and Installation

To get the backend set up, follow the instructions in the README in the backend folder.

Running the backend requires having some environment variables defined. To do this, create a file called .env at the root of the backend folder, and define variables in the following format:

EXAMPLE_VAR=example_value
SECRET_VAR=supersecretpassword

You will need to define values for FLASK_CONFIG (can be either development, testing or production), TWILIO_AUTH_TOKEN (auth token for your Twilio account) and TWILIO_ACCOUNT_SID (SID for your Twilio account). Once this file is created with proper values, the app will automatically load them into the environment when run. To use these environment variables, you can do the following in your code:

import os

# get the value of the TWILIO_AUTH_TOKEN environment variable
env_var = os.environ.get("TWILIO_AUTH_TOKEN")

move-up-sms-tool's People

Contributors

cc-21 avatar ke-noel avatar kraglalbert avatar nafiz1001 avatar thomasgudjonwright avatar xinruili07 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

move-up-sms-tool's Issues

Create dotenv file to store environment variables

To store environment variables, we'll make use of a .env file. This will store sensitive information like our Twilio Auth Token and Account SID. This file should not be pushed to the repository (the .gitignore in the backend folder already ignores it).

The Flask code has already been configured to read from it, so we just need to create the file itself. See https://simpleit.rocks/python/flask/managing-environment-configuration-variables-in-flask-with-dotenv/.

Update automatic response when user completes form

Instead of responding with Thank you for completing the form, and we look forward to working with you, Move Up would like the response to be Thank you for completing the form. We will reach out to you shortly with next steps. We look forward to working with you.

Create class in models.py to represent a client SMS response

In backend/models.py, create a class with the fields that a client's SMS response would contain:

  • Name
  • Email
  • Location
  • Address
  • The raw response as it was received (i.e. the entire message)

This will allow us to represent a client's SMS response more cleanly, and will make it easier to access the different parts of their response.

Create automatic response when a SMS is received

When a message is sent to our Twilio number, we should send back some kind of response. We can make it a simple message for now and possibly customize it later.

The response should let the client choose between 2 options:

  • Tell them where they can sign up for Move Up's service (i.e. give them the form link and Move Up's phone number)
  • Tell the client what information they should reply back with. We'll start with Name, Email, Location, and Age. This response should only be sent if the client sends a specific message to the Twilio number, for example "MOVEUP".

The client could respond with "1" for the first option and "2" for the second.

See https://www.twilio.com/docs/sms/quickstart/python?code-sample=code-reply-to-an-incoming-message-using-twilio-sms-1&code-language=Python&code-sdk-version=6.x

Take a SMS response and store it in Airtable

Note: this task depends on other tasks being completed.

In Airtable, we'll have a designated spreadsheet for storing SMS responses (since these will only contain a client's basic information and will be different than a full application). Once we receive the SMS response from the client, we should take it and store it in Airtable. We will have to use the Airtable API for our specific Airtable base(s).

Different approaches we could use:

  1. Ask the client to separate their information by comma, and then split by comma
  2. Store their entire SMS as a string

Allow user to pick their sign-up method

[Related to #3]

After a user texts MOVEUP to our number, they have two options:

  • Get the link to the sign-up form and Move Up's phone number
  • Do their sign-up via SMS

The automated response should let them choose which one they would like to do.

Deploy to Heroku

We can try deploying our app to Heroku to see if things still work as expected when the app is deployed to the cloud.

The Procfile should contain web: gunicorn manage:app. Everything else will require doing things from the Heroku CLI (command line) and managing the Heroku app via their website.

Update TravisCI script to only build the project

Since this project may not have any real test cases, we can simply test if the code compiles and builds as expected. To do this, look into changing the command beside script in .travis.yml.

If we do end up adding tests, then we can update the TravisCI script to run those as well.

Make README more detailed

Add more information to the README, including:

  • Basic info about the project
  • Team members
  • How to set up/run the project

Fix TravisCI Build

We need to make TravisCI pass so that we can start to implement tests and know when things are actually working. It looks like the reason that TravisCI is failing is because of our DB configuration; since we're using Airtable and not an actual database, we can remove SQLAlchemy as a dependency from the project and update config.py so that we don't define any DB URLs there.

We can also look into defining some configuration variables for the different Airtable URLs, since we will want to use different URLs for testing/dev/production.

This was already done in the CRM tool, take a look at this PR to see what to do: hack4impact-mcgill/move-up-crm-tool#28

Return error message if user gives invalid SMS message

If the user responds with something invalid, we should let them know and keep waiting for a valid response. Possible errors include:

  • Not texting either 1 or 2 when choosing which sign-up option they would like
  • Not texting MOVEUP to our number

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.