A comprehensive Node.js server application for AI-powered email management and presentation generation with voice command integration.
- AI-powered email search and analysis with enhanced semantic search
- Voice-controlled email composition and sending
- Smart email fetching with context-aware filtering
- Contact management with intelligent name resolution
- OAuth integration with Google Gmail API
- Email thread summarization and analysis
- Voice-triggered presentation creation with "Hey Omi" commands
- AI-powered slide generation using SlidesGPT API
- Real-time progress tracking with web viewer interface
- Persistent presentation storage with Supabase database
- Multiple output formats (embed links, PowerPoint downloads)
- Intent detection with natural language processing
- Multi-language support for voice commands
- Context-aware conversation flow management
- Real-time webhook processing for voice segments
- Redis caching for session state management
- Supabase database for persistent data storage
- Rate limiting and performance monitoring
- Comprehensive error handling and logging
- Security middleware with Helmet and CORS
- Node.js (v14 or higher)
- Redis (for session management)
- Supabase account (for database)
- OpenAI API key (for AI features)
- SlidesGPT API key (for presentation generation)
- Google OAuth credentials (for email features)
- Clone the repository:
git clone https://github.com/yourusername/omisend.git
cd omisend- Install dependencies:
npm install- Create a
.envfile in the root directory:
# Server Configuration
PORT=3000
NODE_ENV=development
# Database
SUPABASE_URL=your_supabase_url_here
SUPABASE_KEY=your_supabase_anon_key_here
# Redis (Upstash)
UPSTASH_REDIS_HOST=your_redis_host
UPSTASH_REDIS_PASSWORD=your_redis_password
UPSTASH_REDIS_PORT=your_redis_port
# AI Services
OPENAI_API_KEY=your_openai_api_key_here
SLIDESGPT_API_KEY=your_slidesgpt_api_key_here
# Google OAuth (for email features)
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GOOGLE_REDIRECT_URI=your_redirect_uri
# Security
JWT_SECRET=your_jwt_secret_here- Set up the database:
npm run setup-supabasesrc/
├── config/
│ └── constants.js # Application configuration
├── controllers/
│ └── webhookController.js # Webhook request handling
├── middleware/ # Custom middleware functions
├── models/
│ ├── intentDetection.js # Voice command pattern matching
│ ├── aiEmailFetcher.js # AI-powered email retrieval
│ ├── aiEmailSender.js # AI-powered email composition
│ ├── enhancedEmailSearch.js # Advanced email search
│ ├── Email.js # Email data model
│ └── User.js # User data model
├── routes/
│ ├── auth.js # Authentication endpoints
│ ├── email.js # Email management API
│ └── deck.js # Presentation generation API
├── services/
│ └── authService.js # Authentication services
└── utils/
├── dbUtils.js # Database utilities
├── redisUtils.js # Redis cache management
├── emailUtils.js # Email processing utilities
├── deckUtils.js # Presentation utilities
├── googleAuth.js # Google OAuth integration
├── supabaseUtils.js # Supabase database utilities
├── contactUtils.js # Contact management
├── nameUtils.js # Name resolution utilities
├── omiUtils.js # Core Omi utilities
├── mailUtils.js # Mail processing
└── errorHandler.js # Error handling utilities
public/
├── index.html # Main web interface
├── deck.html # Presentation interface
├── success.html # Success page
└── style.css # Styling
tests/ # Test suites
server.js # Main application entry point
GET /api/auth/oauth/callback- Google OAuth callbackPOST /api/auth/login- User authenticationGET /api/auth/profile- Get user profile
POST /api/email/send- Send email via voice commandGET /api/email/search- Search emails with AIGET /api/email/fetch- Fetch emails with contextGET /api/email/contacts- Get contact listGET /api/email/summary/:threadId- Get email thread summary
POST /api/deck/webhook- Process voice commands for presentationsGET /api/deck/status/:presentation_id- Check generation statusGET /api/deck/viewer/:presentation_id- View presentation progressGET /api/deck/history/:session_id- Get presentation history
POST /webhook- Main webhook endpoint for voice processingGET /health- Health check endpoint
Development mode:
npm run devProduction mode:
npm startEmail Commands:
- "Hey Omi, send an email to [contact] about [subject]"
- "Find emails from [sender] about [topic]"
- "Show me recent emails"
Presentation Commands:
- "Hey Omi, create a presentation about [topic]"
- "Make slides on [subject]"
- Main Interface: Visit
http://localhost:3000 - Presentation Viewer: Visit
http://localhost:3000/deck - Real-time Tracking: Each presentation gets a unique viewer URL
npm test# Initialize Supabase tables
npm run setup-supabase
# Test database connection
node tests/test_database.jsThe application includes built-in performance monitoring that logs:
- Request count and error rates
- Average and maximum response times
- Webhook processing statistics
- Email sending metrics
- Helmet.js for security headers
- CORS configuration for cross-origin requests
- Rate limiting (200 requests per minute per IP)
- Input validation with express-validator
- JWT authentication for secure sessions
- Environment variable validation on startup
- Stores presentation generation data
- Tracks status, content, and SlidesGPT responses
- Maintains persistent URLs for embed and download
- User authentication and profile data
- OAuth integration details
- Email metadata and processing history
- Search indexing and caching
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the ISC License - see the LICENSE file for details.
For detailed setup instructions for the presentation system, see PRESENTATION_SETUP.md.
For issues and questions, please open an issue on GitHub.