
Table of Contents

buatkan dengan golang dan bukan web-based app. saya ingin mengirim dari desktop/server saya.
Berikut adalah prompt yang sempurna untuk Fine AI untuk membuat aplikasi bulk email sender desktop/CLI dengan Golang:
Prompt untuk Fine AI - Desktop Bulk Email Sender Golang
Saya ingin Anda membuat aplikasi desktop/CLI bulk email sender yang canggih menggunakan Golang murni (bukan web-based). Aplikasi ini akan berjalan di desktop/server saya untuk mengirim email dalam volume besar secara efisien dan aman.
### **SPESIFIKASI APLIKASI:**
#### **1. Tipe Aplikasi**
- **Desktop/CLI application** dengan interface command line yang user-friendly
- Support interactive mode dan batch mode
- Configuration via YAML/JSON files dan environment variables
- Cross-platform (Windows, Linux, macOS)
- Single binary executable tanpa dependency eksternal
#### **2. ARSITEKTUR CORE:**
- **Database:** SQLite untuk portabilitas (embedded database)
- **Queue System:** In-memory queue dengan persistence ke disk
- **Configuration:** Viper untuk config management
- **Logging:** Structured logging dengan multiple levels
- **Concurrency:** Worker pools dengan goroutines
- **Storage:** File-based storage untuk templates, contacts, dan results
### **FITUR UTAMA YANG HARUS ADA:**
#### **Multi-SMTP Provider Management**
// Support multiple SMTP providers secara bersamaan
type SMTPProvider struct {
Name string yaml:"name"
Host string yaml:"host"
Port int yaml:"port"
Username string yaml:"username"
Password string yaml:"password"
MaxPerHour int yaml:"max_per_hour"
MaxPerDay int yaml:"max_per_day"
Enabled bool yaml:"enabled"
Priority int yaml:"priority"
}
#### **Advanced Email Features**
- HTML dan plain text email support
- Email templates dengan placeholder replacement
- Attachment support (multiple files)
- Custom headers dan reply-to
- Email validation dan verification
- Bounce handling dan retry logic
- Unsubscribe link auto-generation
#### **Bulk Processing Capabilities**
- Import contacts dari CSV, JSON, Excel files
- Contact segmentation dan filtering
- Duplicate email detection dan removal
- Batch processing dengan configurable batch sizes
- Progress tracking dengan real-time updates
- Resume/pause functionality
- Failed email retry mechanism
#### **Performance & Concurrency**
// Worker pool configuration
type WorkerConfig struct {
MaxWorkers int yaml:"max_workers"
// Default: 10
SendRate int yaml:"send_rate"
// Emails per minute
BatchSize int yaml:"batch_size"
// Default: 100
RetryAttempts int yaml:"retry_attempts"
// Default: 3
RetryDelay time.Duration yaml:"retry_delay"
// Default: 30s
TimeoutPerEmail time.Duration yaml:"timeout_per_email"
// Default: 30s
}
#### **CLI Commands Structure**
Main commands
bulk-emailer config init # Initialize configuration
bulk-emailer providers add
bulk-emailer contacts import
bulk-emailer templates create
bulk-emailer campaign create # Create new campaign
bulk-emailer campaign start
bulk-emailer send quick # Quick send mode (interactive)
bulk-emailer send file bulk-emailer/
├── cmd/
│ └── bulk-emailer/
│ └── main.go
├── internal/
│ ├── cli/
│ │ ├── commands/
│ │ │ ├── config.go
│ │ │ ├── providers.go
│ │ │ ├── contacts.go
│ │ │ ├── templates.go
│ │ │ ├── campaign.go
│ │ │ └── send.go
│ │ └── app.go
│ ├── config/
│ │ └── config.go
│ ├── database/
│ │ ├── sqlite.go
│ │ └── migrations/
│ ├── models/
│ │ ├── provider.go
│ │ ├── contact.go
│ │ ├── template.go
│ │ ├── campaign.go
│ │ └── email_log.go
│ ├── services/
│ │ ├── email/
│ │ │ ├── sender.go
│ │ │ ├── validator.go
│ │ │ └── template_engine.go
│ │ ├── provider/
│ │ │ ├── manager.go
│ │ │ └── health_checker.go
│ │ ├── queue/
│ │ │ ├── processor.go
│ │ │ └── worker_pool.go
│ │ ├── importer/
│ │ │ ├── csv.go
│ │ │ ├── json.go
│ │ │ └── excel.go
│ │ └── reporter/
│ │ └── generator.go
│ └── utils/
│ ├── file.go
│ ├── validator.go
│ └── progress.go
├── configs/
│ ├── config.example.yaml
│ └── providers.example.yaml
├── templates/
├── data/
│ ├── contacts/
│ ├── reports/
│ └── logs/
├── scripts/
│ ├── build.sh
│ └── install.sh
├── go.mod
├── go.sum
├── Makefile
├── README.md
└── .goreleaser.yaml app:
name: “Bulk Email Sender”
version: “1.0.0”
data_dir: “./data”
log_level: “info” database:
path: “./data/emailer.db”
auto_migrate: true email:
default_from_name: “Your Company”
default_reply_to: “noreply@yourcompany.com
”
unsubscribe_url: “https://yoursite.com/unsubscribe" workers:
max_workers: 10
send_rate: 60 # emails per minute
batch_size: 100
retry_attempts: 3
retry_delay: “30s”
timeout_per_email: “30s” providers:
load_from_file: “./configs/providers.yaml”
health_check_interval: “5m”
auto_failover: true logging:
file: “./data/logs/emailer.log”
max_size: 100 # MB
max_backups: 5
max_age: 30 # days providers: // Support untuk template dengan placeholders
type EmailTemplate struct {
Name string // Placeholders: {{.Name}}, {{.Email}}, {{.Company}}, {{.Custom1}}, etc. type Contact struct {
ID int type Campaign struct {
ID int // go.mod dependencies
require (
github.com/spf13/cobra v1.8.0 // CLI framework
github.com/spf13/viper v1.18.2 // Configuration management
github.com/sirupsen/logrus v1.9.3 // Structured logging
github.com/mattn/go-sqlite3 v1.14.19 // SQLite driver
github.com/jmoiron/sqlx v1.3.5 // SQL extensions
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df // Email sending
github.com/tealeg/xlsx/v3 v3.3.6 // Excel file support
github.com/go-playground/validator/v10 v10.16.0 // Input validation
github.com/schollz/progressbar/v3 v3.14.1 // Progress bars
github.com/fatih/color v1.16.0 // Colored output
github.com/olekukonko/tablewriter v0.0.5 // Table formatting
golang.org/x/sync v0.6.0 // Synchronization primitives
) Prompt ini akan menghasilkan aplikasi desktop bulk email sender yang sangat powerful dan professional, dengan semua fitur enterprise-grade yang Anda butuhkan untuk mengirim email dalam volume besar secara efisien dari desktop/server Anda3. Bangun website impian Anda dengan Hugo bersama okabrionz.com. Cepat, aman, dan mudah dikelola!
### **STRUKTUR PROJECT:**
### **KONFIGURASI DETAIL:**
#### **Config File (config.yaml)**
#### **Providers Config (providers.yaml)**
### **FITUR ADVANCED:**
#### **Template Engine**
json:"name"
Subject string json:"subject"
HTMLBody string json:"html_body"
TextBody string json:"text_body"
Attachments []string json:"attachments"
Variables map[string]string json:"variables"
}
#### **Contact Management**
json:"id" db:"id"
Email string json:"email" db:"email"
Name string json:"name" db:"name"
Company string json:"company" db:"company"
Tags []string json:"tags" db:"tags"
Custom map[string]string json:"custom" db:"custom"
Active bool json:"active" db:"active"
Created time.Time json:"created" db:"created"
}
#### **Campaign Tracking**
json:"id" db:"id"
Name string json:"name" db:"name"
Template string json:"template" db:"template"
Contacts []int json:"contacts" db:"contacts"
Status string json:"status" db:"status"
// pending, running, paused, completed, failed
TotalEmails int json:"total_emails" db:"total_emails"
SentEmails int json:"sent_emails" db:"sent_emails"
FailedEmails int json:"failed_emails" db:"failed_emails"
StartTime time.Time json:"start_time" db:"start_time"
EndTime time.Time json:"end_time" db:"end_time"
Created time.Time json:"created" db:"created"
}
### **DEPENDENCIES & PACKAGES:**
### **PERFORMANCE REQUIREMENTS:**
- **Throughput:** Minimal 1000+ email per menit dengan multiple providers
- **Memory:** Efficient memory usage untuk jutaan kontak
- **Concurrency:** Smart goroutine management dengan rate limiting
- **Reliability:** Automatic retry, failover, dan error recovery
- **Monitoring:** Real-time progress tracking dan detailed logging
### **SECURITY FEATURES:**
- Credential encryption untuk stored passwords
- Input validation dan sanitization
- Safe file handling untuk attachments
- Secure temporary file management
- Rate limiting untuk mencegah spam flagging
### **USER EXPERIENCE:**
- Interactive CLI dengan colored output dan progress bars
- Comprehensive help dan usage examples
- Configuration wizard untuk setup awal
- Clear error messages dengan solution suggestions
- Verbose dan quiet modes
### **BUILD & DEPLOYMENT:**
- Cross-compilation untuk Windows, Linux, macOS
- Single binary distribution
- Auto-update mechanism (optional)
- Docker support untuk server deployment
- Installer scripts untuk easy setup
Buatkan aplikasi lengkap dengan semua fitur di atas, termasuk:
1. Complete source code dengan best practices Golang
2. Comprehensive CLI interface dengan semua commands
3. Configuration management dan validation
4. Error handling dan logging yang robust
5. Unit tests untuk core functionality
6. Build scripts dan documentation
7. Example configurations dan usage examples
8. Performance optimization untuk high-volume sending
Pastikan aplikasi dapat di-compile menjadi single binary yang portable dan mudah digunakan di desktop/server manapun.
Tips Tambahan untuk Fine AI:
Related Posts
Siap Punya Website Profesional?