This project is a mail web app with an AI assistant.
The assistant can:
- open screens (Inbox, Sent, Compose)
- fill email form fields from natural language
- apply filters (sender, keyword, read/unread, date)
- open specific emails
If you want to run everything with one command, use Docker.
Check:
docker --version
docker compose versionCreate Backend/.env (or update existing) before starting containers.
At minimum:
PORT=8080
CORS_ORIGIN=http://localhost:5173
USE_GMAIL_PROVIDER=falseIf using Gmail, also set:
GOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRETGOOGLE_REDIRECT_URIGOOGLE_PUBSUB_TOPIC_NAMEGOOGLE_WATCH_LABEL_IDS
From project root:
docker compose up --build -d- Frontend:
http://localhost:5173 - Backend health:
http://localhost:8080/health
docker compose downdocker compose logs -fGo to:
http://localhost:5173
If you want real emails (Inbox/Sent from Gmail API), do this once.
In Google Cloud Console:
- Create/select a project
- Enable Gmail API
- Create OAuth Client ID (Web Application)
- Add redirect URI:
http://localhost:8080/auth/google/callback- or your ngrok URL callback (if using ngrok), for example:
https://YOUR-NGROK-DOMAIN/auth/google/callback
Create/edit file: Backend/.env
Use this template:
PORT=8080
CORS_ORIGIN=http://localhost:5173
USE_GMAIL_PROVIDER=true
GOOGLE_CLIENT_ID=YOUR_CLIENT_ID
GOOGLE_CLIENT_SECRET=YOUR_CLIENT_SECRET
GOOGLE_REDIRECT_URI=http://localhost:8080/auth/google/callback
GOOGLE_PUBSUB_TOPIC_NAME=projects/<project-id>/topics/<topic-name>
GOOGLE_WATCH_LABEL_IDS=INBOXIf you use ngrok, set
GOOGLE_REDIRECT_URIto your ngrok callback URL exactly.
Same commands as before:
cd Backend
npm run devcd /home/bast/Work/Code/Test/Frontend
npm run devOpen this in browser:
http://localhost:8080/auth/google/start
After success, the page should say: "Google authentication successful. You can close this tab."
Open:
http://localhost:8080/auth/status
You should see:
"provider":"gmail""authenticated": true
The app supports server push via SSE and Gmail webhook route.
For full Gmail push behavior, Pub/Sub + webhook setup is needed:
- webhook endpoint:
/sync/gmail/webhook - frontend stream endpoint:
/sync/events
If webhook is not configured yet, core app still works; new mail push from Gmail may be limited.
Try these in the assistant panel:
Send an email to john@example.com with subject Meeting Tomorrow and body Let's meet at 3pmShow me emails from the last 10 daysShow me emails from the last 1 dayFind the email from Sarah about project updateOpen the latest email from DavidReply to thisForward thisShow only unread emails from this weekShow read emailsfrom date 2026-04-01 to date 2026-04-20
- Make sure backend is running on port
8080 - Check:
http://localhost:8080/health
- Ensure Google Console redirect URI exactly matches
GOOGLE_REDIRECT_URI - Protocol, domain, port, and path must be exact
- You enabled Gmail mode but did not complete OAuth yet
- Open
/auth/google/startonce
- Set OAuth consent screen to Testing
- Add your Gmail account as a Test user
- Restart backend and frontend servers
- Refresh browser