mirror of
https://github.com/Mail-0/Zero.git
synced 2026-06-30 07:46:15 +00:00
# Added Agent Documentation and Enhanced Production Thread Syncing
## Description
This PR adds comprehensive agent documentation for Zero Email and enhances the thread synchronization in production environments.
1. Added a new `AGENT.md` file with detailed documentation about the project structure, commands, tech stack, and development workflow.
2. Enhanced the `ZeroDriver` class to sync additional folders ("sent" and "spam") when running in production environments.
---
## Type of Change
- [x] ✨ New feature (non-breaking change which adds functionality)
- [x] 📝 Documentation update
## Areas Affected
- [x] Email Integration (Gmail, IMAP, etc.)
- [x] Documentation
## Testing Done
- [x] Manual testing performed
## Checklist
- [x] I have performed a self-review of my code
- [x] I have updated the documentation
- [x] My changes generate no new warnings
## Additional Notes
The additional thread syncing in production will ensure that users have a more complete view of their email data by including sent and spam folders alongside the inbox.
---
_By submitting this pull request, I confirm that my contribution is made under the terms of the project's license._
3.5 KiB
3.5 KiB
Agent Configuration for Zero Email
Zero is an open-source AI email solution built with a modern TypeScript/Next.js stack in a monorepo setup.
Project Structure
This is a pnpm workspace monorepo with the following structure:
apps/mail/- Next.js frontend email clientapps/server/- Backend serverapps/ios-app/- iOS mobile apppackages/cli/- CLI tools (nizzycommand)packages/db/- Database schemas and utilitiespackages/eslint-config/- Shared ESLint configurationpackages/tailwind-config/- Shared Tailwind configurationpackages/tsconfig/- Shared TypeScript configuration
Frequently Used Commands
Development
pnpm go- Quick start: starts database and dev serverspnpm dev- Start all development servers (uses Turbo)pnpm docker:db:up- Start PostgreSQL database in Dockerpnpm docker:db:down- Stop and remove database containerpnpm docker:db:clean- Stop and remove database with volumes
Build & Deploy
pnpm build- Build all packages (uses Turbo)pnpm build:frontend- Build only the mail frontendpnpm deploy:frontend- Deploy frontendpnpm deploy:backend- Deploy backend
Code Quality
pnpm check- Run format check and lintpnpm lint- Run ESLint across all packagespnpm format- Format code with Prettierpnpm check:format- Check code formatting
Database
pnpm db:push- Push schema changes to databasepnpm db:generate- Generate migration filespnpm db:migrate- Apply database migrationspnpm db:studio- Open Drizzle Studio
Testing & Evaluation
pnpm test:ai- Run AI testspnpm eval- Run evaluation suitepnpm eval:dev- Run evaluation in dev modepnpm eval:ci- Run evaluation in CI mode
Utilities
pnpm nizzy env- Setup environment variablespnpm nizzy sync- Sync environment variables and typespnpm scripts- Run custom scripts
Tech Stack
- Frontend: Next.js, React 19, TypeScript, TailwindCSS, Shadcn UI
- Backend: Node.js, tRPC, Drizzle ORM
- Database: PostgreSQL
- Authentication: Better Auth, Google OAuth
- Package Manager: pnpm (v10+)
- Build Tool: Turbo
- Linting: ESLint, Oxlint, Prettier
Code Style & Conventions
Formatting
- 2-space indentation
- Single quotes
- 100 character line width
- Semicolons required
- Uses Prettier with sort-imports and Tailwind plugins
File Organization
- TypeScript strict mode enabled
- Workspace packages use catalog versioning for shared dependencies
- Monorepo managed with pnpm workspaces
Important Environment Variables
BETTER_AUTH_SECRET- Auth secret keyGOOGLE_CLIENT_ID&GOOGLE_CLIENT_SECRET- Gmail integrationAUTUMN_SECRET_KEY- Encryption serviceTWILIO_*- SMS integrationDATABASE_URL- PostgreSQL connection string
Development Setup
- Install dependencies:
pnpm install - Setup environment:
pnpm nizzy env - Sync environment:
pnpm nizzy sync - Start database:
pnpm docker:db:up - Initialize database:
pnpm db:push - Start development:
pnpm dev
Common Workflow
- Always run
pnpm checkbefore committing - Use
pnpm nizzy syncafter environment variable changes - Run
pnpm db:pushafter schema changes - Use
pnpm gofor quick development startup
Notes
- Uses Husky for git hooks
- Integrates with Sentry for error tracking
- Uses Cloudflare Workers for backend deployment
- iOS app is part of the monorepo
- CLI tool
nizzyhelps manage environment and sync operations