This guide will help you set up and run SubZero locally.
npm installYou need to create a Google Cloud project and OAuth credentials:
- Go to Google Cloud Console
- Create a new project
- Enable the Gmail API
- Create OAuth 2.0 credentials (Web application)
- Add these redirect URIs:
http://localhost:5173/oauth/callback
cp .env.example .envEdit .env and add your Client ID:
VITE_GOOGLE_CLIENT_ID=your_client_id_here.apps.googleusercontent.com
npm run devsrc/
├── lib/ # Core business logic
│ ├── auth/ # OAuth PKCE implementation
│ ├── api/ # Gmail API client
│ ├── parsers/ # Email header parsing
│ ├── grouping/ # Sender grouping logic
│ ├── actions/ # Unsubscribe & cleanup actions
│ ├── storage/ # IndexedDB (Dexie)
│ └── utils/ # Helper functions
├── components/ui/ # shadcn/ui components
├── routes/ # React Router pages
├── stores/ # Zustand state management
└── types/ # TypeScript types
- ✅ Google OAuth with PKCE
- ✅ Gmail API integration (list messages, get metadata)
- ✅ Header parsing (List-Unsubscribe, List-Id)
- ✅ Message grouping by sender
- ✅ Multiple unsubscribe methods (one-click, HTTP, mailto)
- ✅ Email cleanup (archive/trash)
- ✅ Protected keywords for safety
- ✅ Activity log (local)
- ✅ Dark mode
- ✅ IndexedDB storage (Dexie)
- ✅ Export/import data
npm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production build
npm run test # Run unit tests
npm run lint # Run ESLint- Test the OAuth flow: Sign in with Google to verify your OAuth setup
- Run a scan: Test scanning your inbox for subscriptions
- Customize protected keywords: Edit settings to add your own protected keywords/domains
- Add tests: Write more tests for edge cases
- Deploy: Deploy to Vercel, Netlify, or your preferred platform
To deploy SubZero:
- Update the OAuth redirect URIs in Google Cloud Console with your production domain
- Set
VITE_GOOGLE_CLIENT_IDenvironment variable in your hosting platform - Build and deploy:
npm run build
# Upload the 'dist' folder to your hosting serviceIf you encounter Tailwind CSS errors, make sure you have @tailwindcss/postcss installed:
npm install -D @tailwindcss/postcss- Verify your redirect URI exactly matches what's in Google Cloud Console
- Make sure the Gmail API is enabled in your project
- Check that your Client ID is correct in
.env
The project requires Node.js 20.19+ or 22.12+. If you have an older version, upgrade Node.js.
SubZero is designed with privacy first:
- All data stored locally in IndexedDB
- No server-side storage
- No analytics or telemetry
- OAuth uses PKCE for security
- Protected keywords prevent accidental deletions
See README.md for full privacy guarantees.
See README.md for contribution guidelines.
- Report issues: GitHub Issues
- Discussions: GitHub Discussions