Architecture
Zapmail’s deployment architecture includes:- SMTP Server: A custom Go server that handles incoming emails via the SMTP protocol
- Web Interface: A Next.js application that provides the user interface for managing temporary email addresses
- Database: PostgreSQL/Supabase for storing emails and user data
- Email Processing: Automatic cleanup job that purges emails older than 7 days
Component overview
SMTP server (Go backend)
The backend server listens on a configurable port and processes SMTP commands including
HELO, EHLO, MAIL FROM, RCPT TO, DATA, and QUIT. It stores incoming emails in PostgreSQL and runs a cleanup job every hour.Web interface (Next.js frontend)
The frontend provides a user-friendly interface for users to create temporary email addresses, view received emails, and manage their inbox. Built with Next.js 15 and React 19.
Prerequisites
Before deploying Zapmail, ensure you have:For backend deployment
- Go 1.23.6 or later installed
- Access to a PostgreSQL database (Supabase recommended)
- A server or hosting platform with TCP port access
- Environment variables configured
For frontend deployment
- Node.js 20 or later
- npm, pnpm, or yarn package manager
- Access to the same PostgreSQL database as the backend
- A hosting platform supporting Next.js (Vercel, Railway, etc.)
Database requirements
Your PostgreSQL database must have anemails table with the following schema:
The backend automatically handles email cleanup - emails older than 7 days are purged hourly.
Deployment flow
Next steps
Backend setup
Deploy the Go SMTP server
Frontend setup
Deploy the Next.js interface
Configuration
Configure environment variables