Getting Started
Dispatch is a multi-tenant SaaS platform for sending emails and SMS with intelligent provider routing.
Prerequisites
- Go 1.25+
- PostgreSQL 16+
- Redis (for Asynq task queue)
- Node.js 20+ (for frontend)
Quick Start
bash
# Clone the repository
git clone [email protected]:wuchienhsun/sending-saas.git
cd sending-saas
# Backend
cd backend
cp env.example.local .env
go run cmd/server/main.go
# Worker (separate terminal)
go run cmd/worker/main.go
# Frontend
cd ../frontend
yarn install
yarn devProject Structure
backend/
cmd/
server/ # Main API server entry point
worker/ # Background job processor (Asynq)
migrate/ # Database migration runner
config/ # YAML config loader
internal/
handlers/ # HTTP request handlers
services/ # Business logic layer
repository/ # Data access (GORM)
models/ # Database models
delivery/ # Email/SMS provider adapters
worker/ # Task definitions & handlers
smtp/ # SMTP server implementation
middleware/ # Auth, CORS, rate limiting
webhooks/ # Webhook dispatcher
frontend/
src/ # Vue/Nuxt dashboardKey Commands
| Command | Description |
|---|---|
go run cmd/server/main.go | Start API server |
go run cmd/worker/main.go | Start background worker |
go run cmd/migrate/main.go up | Run database migrations |
go test ./... | Run all tests |
make docs | Generate Swagger API docs |
make docker-up | Start with Docker Compose |