Skip to content

NammaLakes/integration-microservice-template

Repository files navigation

Integration Service Template

A flexible microservice template for building notification and messaging integration services with nammalakes system, bot for end node and/or master node.

Overview

This template provides a foundation for building integration services that can connect to various messaging platforms (Telegram, Slack, Discord, Email, SMS, etc.) to send notifications to users. It includes:

  • A FastAPI web server with ready-to-use API endpoints
  • A generic integration service framework
  • User verification system
  • Bulk message sending capabilities
  • Proper logging and error handling

Features

  • Easy Integration: Designed to be easily adapted to different messaging platforms
  • API-Ready: Complete REST API with OpenAPI documentation
  • User Management: Built-in verification system for authorized users
  • Scalable: Docker-ready for easy deployment and scaling
  • Extensible: Well-organized code structure for adding new features

Getting Started

Prerequisites

  • Python 3.9+
  • Poetry (for dependency management)
  • Docker (optional, for containerization)

Installation

  1. Clone this repository:

    git clone https://github.com/yourusername/integration-service.git
    cd integration-service
    
  2. Install dependencies using Poetry:

    poetry install
    
  3. Create a .env file based on the example:

    INTEGRATION_SERVICE_service_auth_token=your_auth_token
    INTEGRATION_SERVICE_service_password=your_verification_password
    INTEGRATION_SERVICE_host=0.0.0.0
    INTEGRATION_SERVICE_port=8000
    

Running the Service

Local Development

poetry run python -m notify_microservice

Using Docker

docker-compose up --build

Adapting to Different Platforms

This template can be modified to work with different messaging platforms:

1. Update the Integration Service

Edit the notify_microservice/services/integration_service.py file to implement the specific platform's client libraries and API calls.

2. Configure Environment Variables

Add any required API tokens, secrets, or configuration values to the settings.py file and your .env file.

3. Customize API Endpoints

Modify the endpoints in notify_microservice/web/api/integration/router.py to match your specific platform's requirements.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

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

About

Template to create a notification provider for Namma Lakes system

Topics

Resources

Stars

Watchers

Forks