A web app that analyzes a Gmail inbox, sorts recent emails into "keep" or "delete" with an AI model, and applies the cleanup for you after you review it.
Live app: https://tidy-mail-box-web.vercel.app
- Connect: sign in with Google (OAuth), with Gmail scopes checked and requested on demand. A first screen shows mailbox statistics: total, unread, trash, important and attachments.
- Analyze: the app streams the most recent emails (up to 500) from the Gmail API and classifies them in two passes: rules based on Gmail metadata (category labels, read status, age), then an LLM pass that returns, for each email, an action (
to_keep,to_delete,unknown), a confidence score and a one-word topic label. - Review: results are grouped and filterable, with search, an email viewer and a per-email action menu so you can override any decision before anything changes.
- Apply: approved emails are moved to the trash, and frequent topics become Gmail labels on the kept ones. Changes run in batches with retries and exponential backoff, and progress is streamed to the UI.
- Billing: a free onboarding analysis, then one-time cleanups or a subscription through Stripe Checkout, tracked by a Stripe webhook in Supabase.
- Landing page, English and French interface, privacy policy and terms of use.
- Next.js 15 (App Router), React 19, TypeScript, Tailwind CSS 4, shadcn/ui
- Vercel AI SDK (Google Gemini for classification), Gmail API (
googleapis) - Supabase (Postgres, row-level security), Stripe, PostHog, next-intl
- TanStack Query, Zustand, Zod
- Turborepo + pnpm monorepo (
apps/web,packages/ui,packages/supabase), Biome, Husky
Requires Node 20+, pnpm, a Supabase project, Google OAuth credentials with Gmail access, Stripe test keys and an AI provider key.
pnpm install
cp apps/web/.env.template apps/web/.env # fill in the keys
pnpm devTo test payments locally, forward Stripe webhooks with pnpm --filter web stripe-listen.
Personal SaaS project built in spring 2025 (May to June) by Marius Diguat--Mateus.
