Home - usmantahirr/infobip-notification-service GitHub Wiki

Infobip Notification Service

A starter project for building a notification service using Infobip's API with Express.js and TypeScript. This project provides a foundation for sending email and SMS notifications with built-in security, validation, and error handling.

🌟 Current Features

  • 📧 Email Notifications

    • Send emails with file attachments
    • HTML content support
    • File type validation
    • Size restrictions (2MB)
  • 📱 SMS Notifications

    • Text message support
    • Phone number validation
    • Simple payload structure
  • 🔒 Security

    • API key authentication
    • Rate limiting
    • Input validation
    • Security headers
    • CORS configuration
  • 📝 Documentation

    • OpenAPI/Swagger documentation
    • Request/Response examples
    • Error handling guide

🚀 Quick Start

  1. Clone the repository:

    git clone https://github.com/usmantahirr/infobip-notification-service.git
    cd infobip-notification-service
  2. Install dependencies:

    npm install
  3. Set up environment:

    cp .env.example .env
    # Edit .env with your Infobip credentials
  4. Start the development server:

    npm run dev
  5. Send notifications using the API:

    # Send SMS
    curl -X POST http://localhost:3000/api/v1/notifications/sms \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -d '{
        "recipient": "+1234567890",
        "message": "Your verification code is: 123456"
      }'
    
    # Send Email
    curl -X POST http://localhost:3000/api/v1/notifications/email \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -d '{
        "recipient": "[email protected]",
        "subject": "Welcome",
        "message": "Welcome to our platform!"
      }'

📚 Documentation

🛠️ Tech Stack

Current

  • Runtime: Node.js with TypeScript
  • Framework: Express.js
  • Validation: Zod
  • Documentation: OpenAPI/Swagger
  • Logging: Winston
  • Security: Helmet, CORS
  • API: Infobip

Planned

  • Message Queue (Redis/Bull)
  • Database (PostgreSQL)
  • Monitoring (Prometheus/Grafana)
  • Testing (Jest)

🔧 Configuration

Create a .env file with your configuration:

# Application
NODE_ENV=development
PORT=3000

# Infobip
INFOBIP_API_KEY=your_api_key
INFOBIP_BASE_URL=your_base_url
INFOBIP_SENDER_EMAIL=your_verified_sender_email
INFOBIP_SENDER_NUMBER=your_sender_number

# Rate Limiting
RATE_LIMIT_WINDOW=60000
RATE_LIMIT_MAX_REQUESTS=100

📦 Installation

  1. Clone the repository:

    git clone https://github.com/usmantahirr/infobip-notification-service.git
    cd infobip-notification-service
  2. Install dependencies:

    npm install
  3. Set up environment:

    cp .env.example .env
    # Edit .env with your credentials
  4. Start the service:

    npm run dev

🤝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🆘 Support

🙏 Acknowledgments

  • Infobip for providing the messaging API
  • Express.js for the web framework
  • TypeScript for type safety
  • Zod for runtime type validation
  • All contributors to this project

🔄 Planned Improvements

High Priority

  • Message queue integration for reliable delivery
  • Database integration for notification tracking
  • Enhanced error handling and retries

Medium Priority

  • Caching layer for rate limiting
  • Health check endpoints
  • Metrics collection

Low Priority

  • Advanced monitoring
  • A/B testing capabilities
  • Analytics dashboard

Built with ❤️ by Usman Tahir

Last updated: March 2025

⚠️ **GitHub.com Fallback** ⚠️