A self-hosted newsletter aggregator that collects your email newsletters, summarizes them using AI, and delivers personalized digests on your schedule.
- Email Collection: Receives newsletters via AgentMail inbox
- AI Summarization: Uses Gemini Flash (via OpenRouter) to extract key insights
- Scheduled Digests: Configure multiple schedules for different topics
- Customizable: Set interests, summary length, and custom AI instructions
- Self-Hosted: Run on your own infrastructure with SQLite storage
├── backend/ # Bun + Hono API server
│ ├── src/
│ │ ├── routes/ # API endpoints
│ │ ├── services/ # Business logic (scheduler, summarizer, agentmail)
│ │ └── db/ # SQLite schema and migrations
│ └── baml_src/ # BAML prompts for AI extraction
│
├── frontend/ # Next.js 15 dashboard
│ └── src/
│ ├── app/ # Pages (dashboard, schedules, history, preferences)
│ └── components/
│
└── docker-compose.yml
- Bun runtime
- AgentMail account and API key
- OpenRouter API key (for Gemini Flash)
# Backend
cd backend
cp .env.example .env
# Edit .env with your API keys
bun install
bun run baml:generate
# Frontend
cd ../frontend
cp .env.example .env.local
# Edit .env.local if needed
pnpm installBackend (backend/.env):
PORT=5101
DATABASE_PATH=./brewsletter.db
AGENTMAIL_API_KEY=am_your_key
AGENTMAIL_INBOX_EMAIL=[email protected]
OPENROUTER_API_KEY=sk-or-your_keyFrontend (frontend/.env.local):
NEXT_PUBLIC_API_URL=http://localhost:5101# Terminal 1 - Backend
cd backend
bun run dev
# Terminal 2 - Frontend
cd frontend
pnpm devOpen http://localhost:3000 to access the dashboard.
# Create .env file in root with backend variables
docker-compose up -d- Connect: Enter your backend URL and generate an API key
- Configure Preferences: Set your delivery email, interests, and default AI instructions
- Create Schedules: Set up automated digests for different topics (e.g., "AI Daily" at 8am)
- Forward Newsletters: Subscribe to newsletters using your AgentMail inbox address
- Receive Digests: Get summarized digests delivered to your email on schedule
| Endpoint | Method | Description |
|---|---|---|
/api/auth/generate-key |
POST | Generate API key |
/api/auth/validate |
GET | Validate API key |
/api/newsletters |
GET | List newsletters |
/api/newsletters/sync |
POST | Sync from AgentMail |
/api/preferences |
GET/PUT | User preferences |
/api/schedules |
GET/POST | Manage schedules |
/api/schedules/:id/trigger |
POST | Run schedule now |
/api/processing/generate |
POST | Generate digest |
/api/processing/history |
GET | Processing history |
Backend:
- Bun - JavaScript runtime
- Hono - Web framework
- BAML - AI prompt engineering
- AgentMail - Email infrastructure
- SQLite - Database
Frontend:
- Next.js 15 - React framework
- Tailwind CSS - Styling
- shadcn/ui - UI components
- Sonner - Toast notifications
MIT