Production-ready certificate generation service built with Go. Generates PDF certificates using HTML templates.
- HTML-based PDF generation using headless browser
- Customizable certificate templates
- Bulk certificate generation
- Email delivery with templates
- Redis-backed job queue
- RESTful API
- PostgreSQL storage
- Podman
- Chrome/Chromium (included in container)
podman-compose down
podman-compose build app
podman-compose up -dServices:
- API: http://localhost:8080
- PostgreSQL: localhost:5432
- Redis: localhost:6379
make podman-downmake podman-logsImport postman_collection.json into Postman for complete API documentation.
Health Check
GET /health
Certificates
POST /api/v1/certificates/generate
POST /api/v1/certificates/bulk
GET /api/v1/certificates/:id
GET /api/v1/certificates/:id/download
Batches
GET /api/v1/batches/:id
Templates
POST /api/v1/templates
GET /api/v1/templates
GET /api/v1/templates/:id
Email Templates
POST /api/v1/email-templates
GET /api/v1/email-templates
Edit config.yaml or set environment variables:
PORT- Server portDB_HOST,DB_PORT,DB_USER,DB_PASSWORD,DB_NAME- Database configREDIS_HOST,REDIS_PORT- Redis configSENDGRID_API_KEY- Email service key
certificate-service/
├── cmd/server/ # Application entry point
├── internal/
│ ├── config/ # Configuration
│ ├── handlers/ # HTTP handlers
│ ├── models/ # Data models
│ ├── queue/ # Job queue
│ ├── services/ # Business logic
│ └── storage/ # Storage abstraction
├── pkg/
│ ├── email/ # Email service
│ └── pdf/ # PDF generation
├── templates/ # Certificate templates
├── migrations/ # Database migrations
├── config.yaml # Configuration
├── Containerfile # Container definition
└── podman-compose.yml # Service orchestration
make podman-build- Build containermake podman-up- Start servicesmake podman-down- Stop servicesmake podman-logs- View logsmake podman-restart- Restart servicesmake migrate- Run database migrations