Skip to content

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 dev

Project 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 dashboard

Key Commands

CommandDescription
go run cmd/server/main.goStart API server
go run cmd/worker/main.goStart background worker
go run cmd/migrate/main.go upRun database migrations
go test ./...Run all tests
make docsGenerate Swagger API docs
make docker-upStart with Docker Compose

TechTrans Lab