Tutorial by Fazt-Code Examples: https://www.youtube.com/watch?v=sw3CPCRk-XE&list=PLo5lAe9kQrwpaPnC4v1LRIS3QgdPomce2
USE Twilio for SMS Socket.io for Real Time Messages Notificacion Push: Api Nativa para notificaciones web (only desktop ?) Template Engine: Use handlebars, optional Pug, Ejs, React ...
express-handlebars | parecido a pug |
morgan | para ver peticiones en consola |
timeago.js | Convierte la fecha en formato natural |
twilio | para SMS |
mongoose | |
express | |
socket.io | |
dotenv | |
nodemon |
npm i -D https://prnt.sc/xgun5d
ngrok.- se tiene que correr en paralelo npm run dev
ngrok.exe http 3006
this is an simple example to send and recive SMS using Node, Twilio, Mongodb, and Socket.io
- Nodejs
- Mongodb
- ngrok (in development). Twilio needs a domain to reach our server.
clone the repo
git clone https://github.com/FaztTech/sms-node
cd sms-node
create a file with the name .env
in the root project with the following Environment variables:
TWILIO_ACCOUNT_SID=<YOUR TWILIO ACCOUNT SID>
TWILIO_AUTH_TOKEN=<YOUR TWILIO AUTH TOKEN>
PHONE_NUMBER=<THE TRIAL PHONE NUMBER OF YOUR TWILIO PROJECT>
then execute:
npm i
npm start # or npm run dev (to execute with nodemon)
- TWILIO_ACCOUNT_SID
- TWILIO_AUTH_TOKEN
- PHONE_NUMBER
- PORT (optional)
- Herok Patterns - Signal Pattern
- ngrok
- Request body inbound Twilio SMS
- https://www.twilio.com/docs/usage/webhooks/sms-webhooks
- https://stackoverflow.com/questions/59753149/express-handlebars-wont-render-data
- https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access
- https://stackoverflow.com/questions/59690923/handlebars-access-has-been-denied-to-resolve-the-property-from-because-it-is
- add authentication
- handle multiple sockets connection
- integrate Docker
- add tests
- create a contact list
- pick a user from the message history to send a message