About
I built a serverless application that allows users to text kind words to those that are recovering from COVID-19.
One of the main problems for those recovering from COVID-19 is the isolation from loved ones. You can communicate through other means but this application is for those that don't already have a support network.
Local Environment Setup
If you would like to test the application without setting it up to try visiting the live site Encouragement Now
Setup front end site
Follow and complete all the steps in the front end repo first. Front End Repo
Clone this repository and cd into it
git clone https://github.com/rosborne132/encouragement-now-api.git
cd encouragement-now-apiSetup env file
Sample env file
ACCOUNT_SID=
AUTH_TOKEN=
GIPHY_KEY=
PHONE_NUMBER= (Your Twilio number)
SENDER_PHONE_NUMBER= (Your phone number, really only used for tests)
DYNAMODB_TABLE=Install dependencies
Ensure that you have serverless install globally
npm install -g serverlessAfter that install the project dependencies
npm installHow to run the application locally
First, deploy the dev environment
sls deployOnce this is complete you can update the DYNAMODB_TABLE value in your env file.
Start the application by running sls offline
The output should look like this.
Serverless: Compiling with Typescript...
Serverless: Using local tsconfig.json
Serverless: Typescript compiled.
Serverless: Watching typescript files...
offline: Starting Offline: dev/us-west-2.
offline: Offline [http for lambda] listening on http://localhost:3002
┌────────────────────────────────────────────────────────────────────────────────┐
│ │
│ POST | http://localhost:3000/dev/registeruser │
│ POST | http://localhost:3000/2015-03-31/functions/registerUser/invocations │
│ POST | http://localhost:3000/dev/sendtoqueue │
│ POST | http://localhost:3000/2015-03-31/functions/sendToQueue/invocations │
│ │
└────────────────────────────────────────────────────────────────────────────────┘
offline: [HTTP] server ready: http://localhost:3000 🚀
offline:
offline: Enter "rp" to replay the last requestUpdate your twilio #'s webhook with url http://localhost:3000/dev/sendtoqueue
For more information: Link
If you have completed the registration in the front-end site you should be able to directly text the number
Congrats! That's it!
Tests
You can run the tests locally by typing:
npm testCloud deployment
All deployments are handled through serverless.
For more information: Link
