An AI assistant for your Gmail inbox. Ask it to read, search, send, archive, and manage your emails and calendar in plain English.
- Email — list, search, read threads, send, reply, archive, trash, move between labels, save drafts, mark as read
- Calendar — list upcoming events, create events (with Google Meet), update and delete events, list all calendars
- Streaming chat — responses stream token by token with a thinking spinner
- Conversation history — all chats are persisted and accessible from the sidebar
- Model picker — switch between DeepSeek V4 Flash and Pro, with Low / Medium / High effort
- Next.js 16 (App Router)
- Supabase — auth, database (conversations + Gmail tokens), RLS
- Pi AI SDK (
@earendil-works/pi-ai) — DeepSeek streaming with tool call support - Gmail REST API + Google Calendar API — direct REST calls using OAuth access tokens
- Framer Motion — animations
- Tailwind CSS
git clone https://github.com/ronishrohan/flash.git
cd flash
npm installCreate a .env.local file:
# Supabase
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
# DeepSeek (via Pi AI SDK)
DEEPSEEK_API_KEY=your_deepseek_api_key
# Google OAuth (for Gmail + Calendar)
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secretRun the migrations in order in the Supabase SQL editor:
supabase/migrations/0001_gmail_tokens.sql
supabase/migrations/0002_conversations.sql
In Supabase Dashboard → Authentication → Providers, enable Google and add your GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET. Set the redirect URL to:
https://your-project.supabase.co/auth/v1/callback
- Create a project at console.cloud.google.com
- Enable Gmail API and Google Calendar API
- Create OAuth 2.0 credentials (Web application)
- Add your domain to authorized redirect URIs
- On the OAuth consent screen, add these scopes:
https://www.googleapis.com/auth/gmail.readonlyhttps://www.googleapis.com/auth/gmail.modifyhttps://www.googleapis.com/auth/gmail.composehttps://www.googleapis.com/auth/gmail.sendhttps://www.googleapis.com/auth/calendar
npm run devOpen http://localhost:3000.
src/
app/
api/ # API routes (chat, conversations, title generation)
auth/callback/ # Google OAuth callback — stores tokens to Supabase
dashboard/ # Main app (layout, new chat, conversation view)
login/ # Auth + Gmail onboarding flow
components/
dashboard/ # Sidebar, message list, chat input, settings modal
ui/ # LiquidGlass, RoseSpinner, reusable primitives
lib/
agent.ts # Agentic loop — Pi SDK + tool execution
gmail.ts # Access token refresh logic
gmail-tools.ts # Gmail + Calendar REST API functions
supabase.ts # Supabase client (browser)
supabase-server.ts# Supabase client (server)
supabase/
migrations/ # SQL migrations