Skip to content

Latest commit

 

History

History
102 lines (79 loc) · 1.96 KB

File metadata and controls

102 lines (79 loc) · 1.96 KB

Quick Start Guide

Get gnr-async-notification-service running in 5 minutes.

1. Install Dependencies

pip install -r requirements.txt

2. Configure

cp example_config.ini config.ini
# Edit config.ini - set your api_token

Minimal config:

[server]
port = 8002

[notification]
api_token = my-secret-token
db_path = /tmp/notifications.db

[default_account]
provider = mock

3. Run Service

python main.py

Or with Docker:

docker build -t notification-service .
docker run -p 8002:8002 -v $(pwd)/config.ini:/app/config.ini notification-service

4. Test It

Check health:

curl http://localhost:8002/status

Send a test SMS:

curl -X POST http://localhost:8002/commands/add-notifications \
  -H "X-API-Token: my-secret-token" \
  -H "Content-Type: application/json" \
  -d '{
    "notifications": [{
      "id": "test-001",
      "type": "sms",
      "payload": {
        "phone": "+393331234567",
        "message": "Test SMS"
      }
    }]
  }'

Or use the example client:

# Edit example_client.py with your api_token
python example_client.py

5. View Metrics

curl http://localhost:8002/metrics -H "X-API-Token: my-secret-token"

Next Steps

  • Read the full documentation
  • Add a real provider (AWS SNS, Twilio, etc.)
  • Configure delivery reports
  • Set up Prometheus monitoring
  • Deploy to production

Troubleshooting

Service won't start:

  • Check Python version (3.11+ required)
  • Verify config.ini is valid
  • Check port 8002 is available

Notifications not sending:

  • Run: curl -X POST http://localhost:8002/commands/run-now -H "X-API-Token: ..."
  • Check logs for errors
  • Verify provider configuration

Need help?