This is a GitHub template for creating other Twilio sample/template apps. It contains a variety of features that should ideally be included in every Twilio sample app. You can use GitHub's repository template functionality to create a copy of this.
Implementations in other languages:
.NET | Java | Python | PHP | Ruby |
---|---|---|---|---|
TBD | TBD | TBD | TBD | TBD |
This application is only a barebones Node.js application using Express.js. Whenever, possible we should be using this. However, if you are using a framework like React.js, Angular or similar that comes with their own standardized application structure, you should try to merge these by using the same README
structure and test coverage, configuration etc. as this project.
- Node.js web server using Express.js
- Basic web user interface using Handlebars for templating and Bootstrap for UI
- User interface to create reminders.
- Unit tests using
mocha
andchai
- End to End UI testing using Cypress
- Automated CI testing using GitHub Actions
- Linting and formatting using ESLint and Prettier
- Interactive configuration of environment variables upon running
npm run setup
usingconfigure-env
- Project specific environment variables using
.env
files anddotenv-safe
by comparing.env.example
and.env
. - One click deploy buttons for Heroku, Glitch and now.sh
- Create a copy using GitHub's repository template functionality
- Update the
README.md
,package.json
andapp.json
with the respective values. - Build your app as necessary while making sure the tests pass.
- Publish your app to GitHub
This application should give you a ready-made starting point for writing your own appointment reminder application. Before we begin, we need to collect all the config values we need to run the application:
Config Value | Description |
---|---|
Account Sid | Your primary Twilio account identifier - find this in the Console. |
Auth Token | Used to authenticate - just like the above, you'll find this here. |
Phone number | A Twilio phone number in E.164 format - you can get one here |
After the above requirements have been met:
- Clone this repository and
cd
into it
git clone git@github.com:twilio-labs/sample-template-nodejs.git
cd sample-template-nodejs
- Install dependencies
npm install
- Set your environment variables
npm run setup
See Twilio Account Settings to locate the necessary environment variables.
- Run the application
npm start
Alternatively, you can use this command to start the server in development mode. It will reload whenever you change any files.
npm run dev
- Navigate to http://localhost:3000
That's it!
You can run the tests locally by typing:
npm test
Additionally to trying out this application locally, you can deploy it to a variety of host services. Here is a small selection of them.
Please be aware that some of these might charge you for the usage or might make the source code for this application visible to the public. When in doubt research the respective hosting service first.
Service | |
---|---|
Heroku | |
Glitch | |
Zeit |
- GitHub's repository template functionality
This template is open source and welcomes contributions. All contributions are subject to our Code of Conduct.
No warranty expressed or implied. Software is as is.