Implementing a resilient Email Sending Service using JavaScript

Опубликовано: 30 Июнь 2026
на канале: ASHISH MEHTA
24
1

About the project:
It's a resilient email sending service that works with two mock email providers and implements features like a retry mechanism, fallback between providers, idempotency, rate limiting, and status tracking.

GitHub link: https://github.com/mehtashish/Email-Sendin...

API Base URL: https://email-sending-service-28gk.onrende...

🧪 API Endpoints
POST /email: Send an email.
GET /status: View status logs (history of all send attempts, provider used, success/failure, timestamp).

🧰 How it works (high level)
Tries the primary provider first.
If it fails, it retries with exponential backoff (e.g., 1s → 2s).
After retries, switches to the fallback provider.
Uses a Set to keep track of sent email IDs (idempotency).
Implements simple rate limiting based on a small time window.
Logs each attempt in a status log.