Uber Email Service
Resilient email delivery API with automatic failover between AWS SES and SendGrid, designed around clean architecture.
Overview
Uber Email Service is the implementation of a code challenge: build an email service that never gives up. The API tries AWS SES first; if the provider is down or fails, it automatically fails over to SendGrid. Both gateways behind interfaces, so adding a third provider is a one-file change.
Screenshot placeholder
Output of
./mvnw test — 16 passing tests (service, controller, SES and SendGrid senders, all mocked). Replace with a terminal capture.
Features
POST /send/— single endpoint acceptingsubject,body, andreceiver.- Failover logic: SES first, SendGrid on failure;
500only when both are down. - Bean Validation — malformed emails are rejected with
400before any network call. - Clean Architecture: use-cases in
application/, gateways ininfra/, all cross-boundary communication via ports.
Tech stack
- Java 21 / Spring Boot 3
- AWS SES SDK and SendGrid SDK
- JUnit 5 + Mockito (gateways mocked — tests run with no credentials)
- Maven
Running locally
cp .env.example .env # AWS_REGION, AWS_ACCESS_KEY(_ID), SENDGRID_API_KEY, VERIFIED_EMAIL
./mvnw spring-boot:run
./mvnw test
Why this project?
It demonstrates resilience patterns (failover), interface-driven design, and disciplined testing — the core skills behind reliable cloud services. The architecture separates what changes (providers) from what doesn’t (the send flow).