← All projects

Uber Email Service

Resilient email delivery API with automatic failover between AWS SES and SendGrid, designed around clean architecture.

  • Java
  • Spring Boot
  • AWS SES
  • SendGrid
  • Clean Architecture

· github.com/carloscardoso05/Uber-Email-Service-Code-Challenge

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 accepting subject, body, and receiver.
  • Failover logic: SES first, SendGrid on failure; 500 only when both are down.
  • Bean Validation — malformed emails are rejected with 400 before any network call.
  • Clean Architecture: use-cases in application/, gateways in infra/, 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).