How tsujit74/email-scheduler works
Outbox lets users authenticate, build campaigns and recipient lists, schedule paced email delivery, then monitor campaign and email outcomes. The graph follows the documented browser-to-API-to-queue-to-worker flow and the sampled controller, service, repository, and worker calls. Campaign orchestration, queue implementation, and some frontend wiring are represented only at their exact enclosing paths because their source was not sampled; those links follow README documentation where noted.
Main entry points: emailService.ts Recipient scheduling · emailWorker.ts Email worker · app.ts Express API · api.ts API client
Components 23
User interface
- Campaign composer
frontend/app/compose/page.tsx - Recipient upload
frontend/app/components/compose/RecipientFileUpload.tsx - Email dashboard
frontend/app/dashboard/page.tsx - Email details
frontend/app/dashboard/emails/[id]/page.tsx - API client
frontend/lib/api.ts
API and identity
- Express API
backend/src/app.ts - Google auth routes
backend/src/routes/authRoutes.ts - Campaign endpoints
backend/src/controllers/campaignController.ts - Email endpoints
backend/src/controllers/emailController.ts
Campaign management
- Campaign orchestration
backend/src/services/campaignService.ts - Recipient scheduling
backend/src/services/emailService.ts - Schedule calculation
backend/src/utils/emailScheduling.ts
Email delivery
- Job scheduling
backend/src/services/emailQueueService.ts - Email worker
backend/src/services/emailWorker.ts - Hourly rate limit
backend/src/services/rateLimit.ts - SMTP sender
backend/src/services/emailSender.ts
Persistence and integrations
- Campaign repository
backend/src/repositories/campaignRepository.ts - Email repository
backend/src/repositories/emailRepository.ts - PostgreSQL
- BullMQ jobs
backend/src/config/queue.ts - Ethereal SMTP
- Redis
backend/src/config/redis.ts
Other components
- Campaign user
Connections 29
- Campaign user → Campaign composer: creates campaign
- Campaign user → Recipient upload: provides recipients
- Campaign user → Email dashboard: monitors delivery
- Email dashboard → Email details: opens email
- Campaign composer → API client: submits campaign
- Recipient upload → Campaign composer: supplies recipients
- Email dashboard → API client: requests status
- Email details → API client: requests details
- API client → Express API: HTTP requests
- Express API → Google auth routes: dispatches auth
- Express API → Campaign endpoints: dispatches campaigns
- Express API → Email endpoints: dispatches email APIs
- Google auth routes → Redis: stores sessions
- Campaign endpoints → Campaign orchestration: calls
- Email endpoints → Recipient scheduling: calls
- Campaign orchestration → Campaign repository: persists campaigns
- Recipient scheduling → Campaign repository: loads campaign
- Recipient scheduling → Email repository: creates and reads emails
- Recipient scheduling → Schedule calculation: calculates send times
- Campaign repository → PostgreSQL: reads and writes
- Email repository → PostgreSQL: reads and writes
- Recipient scheduling → Job scheduling: enqueues emails
- Job scheduling → BullMQ jobs: stores delayed jobs
- Email worker → BullMQ jobs: consumes and reschedules
- Email worker → PostgreSQL: checks and updates status
- Email worker → Hourly rate limit: checks sending limit
- Hourly rate limit → Redis: increments counters
- Email worker → SMTP sender: sends eligible email
- SMTP sender → Ethereal SMTP: delivers message