How krishavrajsingh/automailer works
Main Components
a) Client Layer:
• Google OAuth Authentication endpoint
• Email handling endpoints
b) Application Layer:
• Express.js Server
• Controllers (Google Controllers)
• Services (Gemini Service, Google Service)
• Queue System (BullMQ)
c) External Services:
• Google Gmail API
• Google OAuth
• Gemini AI API
• Redis Server
Component Relationships
• Authentication flow with Google OAuth
• Email processing flow
• Queue management flow
• AI analysis flow
┌─────────────────────────────────────────────────────────────┐
• AutoMailer System │
• ┌─────────┐ ┌──────────┐ ┌────────────────────┐ │
• Express │────│Controllers│────│ Services │ │
• Server │ │ │ │ │ │
• ┘ └──────────┘ └────────────────────┘ │
• ┌──────┴───────┐ │
• Queue System │ │
• ┘ │
• ┼──────────────┼─────────────────┼──────────────────┘
• ▼ ▼ ▼
• ┌─────────┐ ┌──────────┐ ┌──────────┐
• Google │ │ Gemini │ │ Redis │
• APIs │ │ API │ │ Server │
• ┘ └──────────┘ └──────────┘
Specific Flows
a) Authentication Flow:
Client → Express Server → Google OAuth → Token Storage
b) Email Processing Flow:
Gmail API → Google Service → Email Queue → Gemini Service → Response Queue → Gmail API
Important Details
• BullMQ queue system with separate queues for:
• Email processing queue
• Response generation queue
• Error handling queue
• Service layer components:
• geminiService.ts
• googleService.ts
• Controller layer:
• googleControllers.ts
Technical Stack Indicators
• Node.js/Express.js environment
• TypeScript implementation
• Redis for queue management
• OAuth2 authentication
• AI integration points
Remember to indicate:
• Security boundaries
• Data persistence points
• Asynchronous processing zones
• External service integration points
This will provide a complete picture of how the AutoMailer system works while maintaining clarity and usefulness for development and maintenance purposes.