This project, Noti, is a Unified Notification Service written in Go using Domain-Driven Design (DDD). The service aims to unify the sending of notifications across various tenants, each with a unique database. Database credentials are securely stored in HashiCorp Vault, and connections are cached for efficiency. Notifications are routed to various providers such as Twilio, Amazon SES, and others, and can differ for each tenant. The service supports sending push notifications, SMS, calls, and other types of notifications. Providers can be added as needed, and each client receives notifications tied to their specific database.
- Multi-Tenant Support: Each tenant has a unique database.
- Secure Credential Storage: Database credentials are stored in HashiCorp Vault.
- Connection Caching: Database connections are cached for performance.
- Provider Flexibility: Supports multiple notification providers (e.g., Twilio, Amazon SES).
- Notification Types: Supports push notifications, SMS, calls, and more.
- Template Management: Templates can be stored and customized per provider and tenant.
- Database Support: Currently supports SQLite, MySQL, and PostgreSQL, with plans to add more.
- Queue Management: Notifications are queued for efficient processing.
- Monitoring and Analytics: Plans to add monitoring and analytics for open rates and tracking.
- Microservice Architecture: Designed to run in an authenticated environment, recommended to use Keycloak or Hydra for authentication.
- Go 1.16+
- Docker (for running databases and other services)
- HashiCorp Vault
- Keycloak or Hydra (for authentication)
-
Clone the repository:
git clone https://github.com/yourusername/noti.git cd noti
-
Set up environment variables: Create a
.env
file in the root directory and add the necessary environment variables:VAULT_ADDR=http://127.0.0.1:8200 VAULT_TOKEN=myroot
-
Run the services:
docker-compose up -d
-
Run the application:
go run main.go
- Database Configuration: Configure your database settings in
config.toml
. - Provider Configuration: Add your provider credentials and settings in
providers.toml
.
- API Endpoints: The API endpoints are documented using Swagger. Access the documentation at
http://localhost:8000/swagger/index.html
. - Sending Notifications: Use the
/send
endpoint to send notifications. Example payload:{ "tenant_id": "tenant123", "notification_type": "email", "provider": "twilio", "message": "Hello, this is a test notification!" }
We welcome contributions! Please read our CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the MIT License
- Inspired by various DDD resources and Go projects.
- Special thanks to the contributors and the open-source community.
Feel free to reach out if you have any questions or need further assistance. Happy coding!