A NestJS-based backend service that integrates multiple Twilio communication channels including SMS, WhatsApp, voice calls, and email (via SendGrid). Designed for scalable, modular use in microservices or monolithic applications.
- 📩 SMS Messaging via Twilio
- 💬 WhatsApp Messaging via Twilio Business API
- 📞 Voice Calls through Twilio's programmable voice service
- 📧 Email sending using Twilio SendGrid
- 🛠️ Modular Design for easy extension
- 🗃️ Prisma ORM integration for structured database operations
- Backend Framework: NestJS
- Language: TypeScript
- Database ORM: Prisma
- Database: PostgreSQL (or compatible via Prisma)
- Email Provider: SendGrid (via Twilio)
- Cloud Messaging: Twilio (SMS, WhatsApp, Calls)
git clone https://github.com/YashPatrot/communication-integrations.git
cd communication-integrations
npm install
Create a .env
file using .env.example
as a reference:
# Database
DATABASE_URL="postgresql://username:password@localhost:5432/dbname?schema=public"
# Twilio credentials
TWILIO_ACCOUNT_SID=your_account_sid
TWILIO_AUTH_TOKEN=your_auth_token
TWILIO_PHONE_NUMBER=your_twilio_number
TWILIO_WHATSAPP_NUMBER=your_twilio_whatsapp_number
# SendGrid credentials
TWILIO_SENDGRID_API_KEY=your_sendgrid_api_key
TWILIO_SENDER_EMAIL=your_sender_email
TWILIO_REPLY_TO_EMAIL=your_reply_to_email
# Server
PORT=3000
npx prisma generate
npx prisma migrate dev
npm run start:dev
src/
├── app.module.ts # Main module
├── main.ts # Entry point
├── prisma/ # Prisma client and service
├── common/ # Shared constants and utilities
├── twilio/ # Core Twilio wrapper
├── twilio-sms/ # SMS handling
├── twilio-wsms/ # WhatsApp messaging
├── twilio-call/ # Voice call handling
├── twilio-email/ # SendGrid email service
prisma/
├── schema.prisma # Data models
└── migrations/ # Migration history
.env.example # Environment config sample
All endpoints accept JSON payloads via POST
.
Endpoint | Description |
---|---|
/twilio-sms |
Send SMS via Twilio |
/twilio-wsms |
Send WhatsApp message |
/twilio-call |
Make a phone call |
/twilio-email |
Send email via SendGrid |
# Unit tests
npm run test
# End-to-end tests
npm run test:e2e
We welcome contributions!
- Fork this repo
- Create a branch:
git checkout -b feature/awesome-feature
- Commit your work:
git commit -m 'Add some awesome feature'
- Push to your fork:
git push origin feature/awesome-feature
- Open a Pull Request 🚀
This project is licensed under the MIT License.