MailEven is an AI email client that summarizes messages with Gemini AI, delivers notification briefings, and turns emails into Google Calendar events or Google Tasks with one tap.
Built with Next.js (App Router, TypeScript), Tailwind CSS, Auth.js (NextAuth) Google Provider, googleapis, Gemini API / Groq, SQLite + Prisma, and Web Push API / In-App Bell notifications.
MailEven includes an instant Demo Mode seeded with realistic mock emails across two linked accounts ([email protected] and [email protected]), AI executive summaries, and actionable briefing cards. You can explore and test every single feature immediately without configuring credentials.
-
Install dependencies and push database schema:
npm install npx prisma db push
-
Start the development server:
npm run dev
-
Open http://localhost:3000 in your browser and click "Explore Dual-Account Demo".
- Navigate to the Google Cloud Console.
- Click the project dropdown in the top bar and select "New Project".
- Name your project (e.g.
MailEven-Assistant) and click Create.
In the Google Cloud Console, navigate to APIs & Services > Library and enable each of the following APIs:
- Gmail API (
gmail.googleapis.com) - Google Calendar API (
calendar-json.googleapis.com) - Google Tasks API (
tasks.googleapis.com)
- Go to APIs & Services > OAuth consent screen.
- Select External user type and click Create.
- Fill in the required app info:
- App name:
MailEven - User support email: your email address
- Developer contact email: your email address
- App name:
- On the Scopes page, click Add or Remove Scopes and add:
https://www.googleapis.com/auth/gmail.readonly(Read-only access to emails)https://www.googleapis.com/auth/calendar.events(Create and manage calendar events)https://www.googleapis.com/auth/tasks(Create and manage tasks)openid,.../auth/userinfo.email,.../auth/userinfo.profile
- On the Test users page, click Add Users and enter the Gmail address(es) you plan to connect.
- Go to APIs & Services > Credentials.
- Click Create Credentials > OAuth client ID.
- Select Web application as the Application type.
- Set Authorized redirect URIs to include both:
(For production/Vercel, replace
http://localhost:3000/api/auth/callback/google http://localhost:3000/api/accounts/google/callbackhttp://localhost:3000with your custom domain orhttps://your-app.vercel.app) - Click Create and copy your Client ID and Client Secret.
Create or edit .env.local in the project root:
DATABASE_URL="file:./dev.db"
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="your-generated-nextauth-secret"
# At-Rest Token Encryption Key (32-byte / 64-hex key for AES-256-GCM)
TOKEN_ENCRYPTION_KEY="your-32-byte-hex-encryption-key"
# Google OAuth Credentials
GOOGLE_CLIENT_ID="your-client-id.apps.googleusercontent.com"
GOOGLE_CLIENT_SECRET="your-client-secret"
# Gemini / Groq API Key
GROQ_API_KEY="your-groq-api-key"
GEMINI_API_KEY="your-gemini-api-key"MailEven supports multiple connected accounts per user with interleaved feeds and per-account filtering:
- In the MailEven app, locate the Connected Account Switcher at the top of the Sidebar.
- Click on the account switcher dropdown and select "Add Google Account".
- You will be redirected to the Google OAuth consent screen (
prompt=select_account). Log in with your second Google account and grant the requested permissions (gmail.readonly,calendar.events,tasks). - Upon approval, Google redirects back to
/api/accounts/google/callback, encrypts tokens at rest via AES-256-GCM, and lands back in MailEven with the new account linked without touching your primary login session. - In your Inbox, Daily Briefing, and AI Summary, messages from both accounts interleave seamlessly in chronological order, with distinct colored badges and initials identifying each account.
- Use the sidebar account switcher to filter down to a single account at any time.
MailEven includes an executive AI summarizer accessible from the sidebar (AI Summary) or directly from the Daily Briefing:
- Period Switching: 1-click toggle between Today's Mail and This Week's Mail.
- Executive Synthesis: Multi-account high-level digest highlighting major themes, urgency, and decisions.
- Action Items & Priorities: Direct 1-tap "Schedule Event" or "Add Task" buttons pre-filled by AI.
- Volume & Metrics: Total email counts, actionable percentages, and category breakdown.
- Token Encryption at Rest: All OAuth access and refresh tokens are encrypted using AES-256-GCM with a dedicated 32-byte key (
TOKEN_ENCRYPTION_KEY). No plaintext tokens are stored in SQLite. - Session Cookie Hardening: Cookies are configured with
httpOnly: true,secure: true(in production), andsameSite: "lax". - Rate Limiting: Sync actions and calendar/task creation requests are rate-limited per user to protect Google API quotas and prevent abuse.
- CSP & Origin Checks: Content Security Policy headers and strict origin validation prevent cross-site request forgery and framing attacks.
- Zero-Model-Training Policy: Prominent disclosure copy confirms email content is processed strictly for summarization/classification and is never retained or used to train AI models.
- Configurable Retention: Auto-purge raw email bodies older than N days (default 30) while permanently keeping executive summaries and tags.
- 1-Click Account Revocation: Revokes the OAuth token directly with Google's revocation endpoint server-side and purges all associated records from SQLite.
- Data Portability: Full structured JSON export of all user emails, summaries, calendar events, and tasks.
MailEven Phase 2 replaces high-contrast urgency with a minimal, calm aesthetic:
| Token | Name | Hex | Role |
|---|---|---|---|
charcoal |
Charcoal | #2B2B2E |
Dark-mode background / light-mode primary text |
indigo |
Japanese Indigo | #264348 |
Primary accent — buttons, links, active states, logo |
stardust |
Star Dust | #918578 |
Warm neutral — secondary surfaces, subtle highlights |
foggy |
Foggy | #E7E5E1 |
Light-mode background / dark-mode surface tint |
midgrey |
Mid Grey | #8A8A8D |
Secondary/muted text, borders |
steelteal |
Steel Teal | #4F6B6E |
Secondary accent — tags, hover states |
- Dark mode: Background Charcoal (
#2B2B2E), surface#343438, primary text Foggy (#E7E5E1), accent Steel Teal (#4F6B6E) / Japanese Indigo (#264348). - Light mode: Background Foggy (
#E7E5E1), surface white (#FFFFFF), primary text Charcoal (#2B2B2E), accent Japanese Indigo (#264348). - SSR Theme Painting: Preferences persist via a typed
maileven_prefscookie read server-side, eliminating any flash of the wrong mode. - Sidebar: Desktop navigation replacing top-bar tabs, featuring account switcher, navigation links, tag filters, and theme toggle.
- Calendar & Task Pickers: Action modal fetches the relevant connected account's calendar list (
calendarList.list) and task lists, allowing you to choose the target calendar or task list.