β νΌλλ‘
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:
- High Latency: Waiting 30s+ for a verification email.
- Privacy Concerns: Logged data and trackers.
- 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:
- Framework: Next.js 15 (App Router)
- Runtime: Cloudflare Pages Functions
- Database: Cloudflare D1
- Email Ingestion: Cloudflare Email Routing
- Design: Neo-Brutalist UI using Tailwind CSS.
π 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
μΆμΆ λ³Έλ¬Έ Β· μΆμ²: dev.to Β· https://dev.to/skrayhanyt_developer/building-a-100-serverless-disposable-email-platform-with-cloudflare-d1-nextjs-15-cj0