A comprehensive email integration platform that automatically fetches and processes emails from Gmail using configurable sender whitelists and scheduling.
Linux/Mac:
./start.shWindows:
start.batUsing npm:
npm run startThis will:
- Install all dependencies automatically
- Start both backend (port 8000) and frontend (port 5173) servers
- Perform health checks
- Display all relevant URLs
Install dependencies:
npm run setupStart both servers with concurrently:
npm run start:devOr start individually:
# Terminal 1 - Backend
npm run backend
# Terminal 2 - Frontend
npm run frontend- Python 3.8+ with pip
- Node.js 16+ with npm
- Gmail account with API access
Run the OAuth2 setup:
npm run setup:gmail
# or manually: cd backend && python setup_gmail.pyThis will:
- Guide you through Google Cloud Console setup
- Handle OAuth2 authorization
- Save credentials to
config/gmail.json
Edit config/fetcherSettings.json:
{
"sender_whitelist": [
"[email protected]",
"[email protected]"
],
"schedule": "0 2 * * *",
"enabled": true,
"lookback_hours": 24
}Once running, access:
- Frontend App: http://localhost:5173
- Backend API: http://localhost:8000
- API Docs: http://localhost:8000/docs
- Gmail Dashboard: Open
gmail_dashboard.htmlin browser
| Command | Description |
|---|---|
npm run start |
Start both servers with full setup |
npm run start:dev |
Start both servers (requires deps installed) |
npm run setup |
Install all dependencies |
npm run setup:gmail |
Configure Gmail OAuth2 |
npm run test |
Run Gmail integration tests |
npm run backend |
Start only backend server |
npm run frontend |
Start only frontend server |
npm run build |
Build frontend for production |
- OAuth2 authentication
- Automated email fetching
- Sender whitelist filtering
- Read-only access (non-intrusive)
- Configurable scheduling (cron format)
- JSON database storage
- Message deduplication
- Full-text search capabilities
- Statistics and analytics
- Real-time status monitoring
- Manual fetch triggers
- Message browsing
- Configuration management
- Execution logs
- Health checks
- Message retrieval
- Statistics
- Scheduler control
- Configuration management
- Backend: http://localhost:8000/health
- Gmail Integration: http://localhost:8000/api/gmail/health
The system is currently configured and operational with:
- β 35 messages stored from 15 unique senders
- β Gmail API connected and healthy
- β Scheduler running (daily at 2 AM)
- β Web interfaces accessible
# Get system health
curl http://localhost:8000/api/gmail/health
# Get message statistics
curl http://localhost:8000/api/gmail/stats
# Get recent messages
curl http://localhost:8000/api/gmail/messages?limit=10
# Manual fetch trigger
curl -X POST http://localhost:8000/api/gmail/fetch
# Scheduler control
curl http://localhost:8000/api/gmail/scheduler
curl -X POST http://localhost:8000/api/gmail/scheduler/start
curl -X POST http://localhost:8000/api/gmail/scheduler/stop"Port already in use"
- The startup script automatically kills existing processes
- Or manually:
pkill -f "uvicorn\|vite"
"Gmail credentials not configured"
- Run:
npm run setup:gmail - Follow the OAuth2 setup process
"No messages found"
- Check sender whitelist in
config/fetcherSettings.json - Verify emails exist in the specified time range
- Check Gmail API quota limits
"Dependencies not installed"
- Run:
npm run setup - Or use the full startup script:
./start.sh
- Application logs: Check terminal output
- Execution logs: Available via web interface or API
- Test integration:
npm run test
genaigo/
βββ start.sh # Linux/Mac startup script
βββ start.bat # Windows startup script
βββ package.json # Root npm scripts
βββ backend/ # FastAPI backend
β βββ app/
β β βββ main.py # FastAPI application
β β βββ routes/ # API endpoints
β β βββ services/ # Gmail fetcher & scheduler
β βββ requirements.txt # Python dependencies
β βββ setup_gmail.py # OAuth2 setup utility
βββ frontend/ # React frontend
β βββ src/
β β βββ pages/ # React components
β β βββ components/ # Shared UI components
β βββ package.json # Frontend dependencies
β βββ vite.config.js # Vite configuration
βββ config/ # Configuration files
β βββ gmail.json # Gmail OAuth2 credentials
β βββ fetcherSettings.json # Email fetcher settings
βββ data/ # Stored data
βββ messages.json # Email messages database
- OAuth2 Flow: Secure Google authentication
- Read-only Scope: Minimal Gmail API permissions
- Token Management: Automatic refresh handling
- Local Storage: All data stored locally
- No Modifications: Emails remain unchanged in Gmail
As of the last check:
- Total Messages: 35
- Unique Senders: 15
- Date Range: May 28, 2025 (10:23 AM - 2:22 PM)
- System Status: β Healthy and operational
The system is NOT ready for production use!