Building a 100% Serverless Disposable Email Platform with Cloudflare D1 & Next.js 15

μž‘μ„±μž

μΉ΄ν…Œκ³ λ¦¬:

← ν”Όλ“œλ‘œ
DEV Community · SK RAYHAN · 2026-08-27 개발(SW)
Cover image for Building a 100% Serverless Disposable Email Platform with Cloudflare D1 & Next.js 15

SK RAYHAN

Hey DEV Community! πŸ‘‹

As developers, we’ve all been there: you’re testing a signup flow, but you don’t want to clutter your personal inbox, and existing disposable email services are either too slow, full of annoying ads, or charge a premium for basic API access.

I decided to solve this by building TTMAIL (trytempmail.co) β€” a modern, privacy-focused, and incredibly fast temporary email platform built entirely on the edge.

πŸ›  The Problem I Wanted to Solve

Most “Temp Mail” services use outdated PHP/MySQL stacks or heavy polling, leading to:

  1. High Latency: Waiting 30s+ for a verification email.
  2. Privacy Concerns: Logged data and trackers.
  3. No Developer DX: Hard to use in Playwright or Cypress tests without paying.

⚑ The Tech Stack (Serverless Excellence)

I wanted zero maintenance and zero server bills. Here is how I achieved it:

πŸ— Architecture Diagram


mermaid
graph LR
    Sender[Email Sender] --> CF_MX[Cloudflare MX]
    CF_MX --> Worker[Email Worker]
    Worker --> D1[(Cloudflare D1 Edge SQLite)]
    Client[Browser/CI Tool] --> API[Next.js API]
    API --> D1
🌟 Key Features for Power Users
1. ⚑ Sub-Second Speed
Because the database (D1) and the logic (Workers) live at the edge, emails are parsed and stored almost instantly.
2. πŸ›‘οΈ Privacy by Design (Zero Tracking)
Pixel Stripper: Our edge worker automatically neutralizes 1x1 tracking pixels.
Auto-Purge: Emails are automatically deleted every 90 days.
3. πŸ€– First-Class API for E2E Testing
Fetch emails programmatically in your CI/CD pipeline:
code
JavaScript
const response = await fetch('https://trytempmail.co/api/[email protected]');
const { emails } = await response.json();
console.log(emails[0].subject);
4. πŸ”‘ Cross-Device Sync
Use a custom passphrase for any alias to restore your inbox on any device.
πŸš€ Check it out!
Live Project: https://trytempmail.co
API Docs: https://trytempmail.co/api-docs
πŸ’¬ I'd Love Your Feedback!
UI/UX: What do you think of the Neo-Brutalist aesthetic?
Features: Would you find Webhook support useful?
Performance: How is the delivery speed in your region?
Drop a comment below! πŸ‘‡

Enter fullscreen mode Exit fullscreen mode

μ›λ¬Έμ—μ„œ 계속 β†—