{"id":26222729,"url":"https://github.com/Mail-0/Zero","last_synced_at":"2025-03-12T17:02:20.112Z","repository":{"id":275505863,"uuid":"926252103","full_name":"Mail-0/Zero","owner":"Mail-0","description":"Experience email the way you want with 0 – the first open source email app that puts your privacy and safety first (coming soon). Join the discord: https://discord.gg/0email","archived":false,"fork":false,"pushed_at":"2025-03-10T07:20:50.000Z","size":5856,"stargazers_count":4116,"open_issues_count":23,"forks_count":306,"subscribers_count":22,"default_branch":"staging","last_synced_at":"2025-03-10T08:37:44.177Z","etag":null,"topics":["ai","email","privacy","security"],"latest_commit_sha":null,"homepage":"https://0.email/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mail-0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS.md","security":null,"support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["nizzyabi"]}},"created_at":"2025-02-02T22:25:26.000Z","updated_at":"2025-03-10T08:34:16.000Z","dependencies_parsed_at":"2025-02-20T01:37:38.128Z","dependency_job_id":"56c43be2-9f06-48de-b5ea-6a7dadc390c7","html_url":"https://github.com/Mail-0/Zero","commit_stats":null,"previous_names":["nizzyabi/mail","nizzyabi/mail0","mail-0/mail-0","mail-0/zero"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mail-0%2FZero","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mail-0%2FZero/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mail-0%2FZero/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mail-0%2FZero/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mail-0","download_url":"https://codeload.github.com/Mail-0/Zero/tar.gz/refs/heads/staging","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243258488,"owners_count":20262298,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","email","privacy","security"],"created_at":"2025-03-12T17:02:18.710Z","updated_at":"2025-03-12T17:02:20.094Z","avatar_url":"https://github.com/Mail-0.png","language":"TypeScript","readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://0.email\"\u003e\n    \u003cimg src=\"apps/mail/public/white-icon.svg\" alt=\"Zero Logo\" width=\"64\" style=\"background-color: #000; padding: 10px;\"/\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n# Zero\n\n[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fnizzyabi%2FMail0\u0026env=DATABASE_URL,BETTER_AUTH_SECRET,BETTER_AUTH_URL,BETTER_AUTH_TRUSTED_ORIGINS,GOOGLE_CLIENT_ID,GOOGLE_CLIENT_SECRET,GOOGLE_REDIRECT_URI,GITHUB_CLIENT_ID,GITHUB_CLIENT_SECRET,GITHUB_REDIRECT_URI\u0026envDescription=For%20more%20info%20on%20setting%20up%20your%20API%20keys%2C%20checkout%20the%20Readme%20below\u0026envLink=https%3A%2F%2Fgithub.com%2Fnizzyabi%2FMail0%2Fblob%2Fmain%2FREADME.md\u0026project-name=0\u0026repository-name=0\u0026redirect-url=0.email\u0026demo-title=0\u0026demo-description=An%20open%20source%20email%20app\u0026demo-url=0.email)\n\nAn Open-Source Gmail Alternative for the Future of Email\n\n## What is Zero?\n\nZero is an open-source AI email solution that gives users the power to **self-host** their own email app while also integrating external services like Gmail and other email providers. Our goal is to modernize and improve emails through AI agents to truly modernize emails.\n\n## Why Zero?\nMost email services today are either **closed-source**, **data-hungry**, or **too complex to self-host**.\n0.email is different:\n  - ✅ **Open-Source** – No hidden agendas, fully transparent.\n  - 🦾 **AI Driven** - Enhance your emails with Agents \u0026 LLMs.\n  - 🔒 **Data Privacy First** – Your emails, your data. No tracking, no selling, no middlemen.\n  - ⚙️ **Self-Hosting Freedom** – Run your own email app with ease.\n  - 📬 **Unified Inbox** – Connect multiple email providers like Gmail, Outlook, and more.\n  - 🎨 **Customizable UI \u0026 Features** – Tailor your email experience the way you want it.\n  - 🚀 **Developer-Friendly** – Built with extensibility and integrations in mind.\n\n## Tech Stack\n\nZero is built with modern and reliable technologies:\n\n- **Frontend**: Next.js, React, TypeScript, TailwindCSS, Shadcn UI\n- **Backend**: Node.js, Drizzle ORM\n- **Database**: PostgreSQL\n- **Authentication**: Better Auth, Google OAuth\n\u003c!-- - **Testing**: Jest, React Testing Library --\u003e\n\n## Getting Started\n\n### Prerequisites\n\n**Required Versions:**\n\n- [Node.js](https://nodejs.org/en/download) (v18 or higher)\n- [pnpm](https://pnpm.io/installation) (v8 or higher)\n- [Docker](https://docs.docker.com/engine/install/) (v20 or higher)\n\nBefore running the application, you'll need to set up services and configure environment variables. For more details on environment variables, see the [Environment Variables](#environment-variables) section.\n\n### Setup Options\n\nYou can set up Zero in two ways:\n\n\u003cdetails open\u003e\n\u003csummary\u003e\u003cb\u003eOption 1: Standard Setup (Recommended)\u003c/b\u003e\u003c/summary\u003e\n\n#### Quick Start Guide\n\n1. **Clone and Install**\n\n   ```bash\n   # Clone the repository\n   git clone https://github.com/Mail-0/Zero.git\n   cd Mail-0\n   \n   # Install dependencies\n   pnpm install\n\n   # Install database dependencies\n   pnpm db:dependencies\n   \n   # Start database locally\n   pnpm docker:up\n   ```\n\n2. **Set Up Environment**\n\n   - Copy `.env.example` to `.env` in both `apps/mail` and `packages/db` folders\n   - Configure your environment variables (see below)\n   - Install database dependencies: `pnpm db:dependencies`\n   - Initialize the database: `pnpm db:push`\n\n3. **Start the App**\n\n   ```bash\n   pnpm dev\n   ```\n\n4. **Open in Browser**\n\n   Visit [http://localhost:3000](http://localhost:3000)\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eOption 2: Dev Container Setup (For VS Code Users)\u003c/b\u003e\u003c/summary\u003e\n\nThis option uses VS Code's Dev Containers feature to provide a fully configured development environment with all dependencies pre-installed. It's great for ensuring everyone on the team has the same setup.\n\n1. **Prerequisites**\n   - [Docker](https://docs.docker.com/get-docker/)\n   - [VS Code](https://code.visualstudio.com/) or compatible editor\n   - [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)\n\n2. **Open in Dev Container**\n   - Clone the repository: `git clone https://github.com/Mail-0/Zero.git`\n   - Open the folder in VS Code\n   - When prompted, click \"Reopen in Container\" or run the \"Dev Containers: Open Folder in Container\" command\n   - VS Code will build and start the dev container (this may take a few minutes the first time)\n\n3. **Access the App**\n   - The app will be available at [http://localhost:3000](http://localhost:3000)\n\n4. **Troubleshooting**\n   - If you encounter issues with the container, try rebuilding it using the \"Dev Containers: Rebuild Container\" command\n   - For dependency issues inside the container:\n     ```bash\n     rm -rf node_modules\n     rm pnpm-lock.yaml\n     pnpm install\n     ```\n\u003c/details\u003e\n\n### Environment Setup\n\n1. **Better Auth Setup**\n\n   - Open the `.env` file and change the BETTER_AUTH_SECRET to a random string. (Use `openssl rand -hex 32` to generate a 32 character string)\n\n     ```env\n     BETTER_AUTH_SECRET=your_secret_key\n     ```\n\n2. **Google OAuth Setup** (Required for Gmail integration)\n\n   - Go to [Google Cloud Console](https://console.cloud.google.com)\n   - Create a new project\n   - Add the following APIs in your Google Cloud Project: [People API](https://console.cloud.google.com/apis/library/people.googleapis.com), [Gmail API](https://console.cloud.google.com/apis/library/gmail.googleapis.com)\n     - Use the links above and click 'Enable' or\n     - Go to 'APIs and Services' \u003e 'Enable APIs and Services' \u003e Search for 'Google People API' and click 'Enable'\n     - Go to 'APIs and Services' \u003e 'Enable APIs and Services' \u003e Search for 'Gmail API' and click 'Enable'\n   - Enable the Google OAuth2 API\n   - Create OAuth 2.0 credentials (Web application type)\n   - Add authorized redirect URIs:\n     - Development:\n       - `http://localhost:3000/api/auth/callback/google`\n       - `http://localhost:3000/api/v1/mail/auth/google/callback`\n     - Production:\n       - `https://your-production-url/api/auth/callback/google`\n       - `https://your-production-url/api/v1/mail/auth/google/callback`\n   - Add to `.env`:\n\n     ```env\n     GOOGLE_CLIENT_ID=your_client_id\n     GOOGLE_CLIENT_SECRET=your_client_secret\n     GOOGLE_REDIRECT_URI=http://localhost:3000/api/v1/mail/auth/google/callback\n     ```\n\n   - Add yourself as a test user:\n\n     - Go to [`Audience`](https://console.cloud.google.com/auth/audience)\n     - Under 'Test users' click 'Add Users'\n     - Add your email and click 'Save'\n\n\u003e [!WARNING]\n\u003e The `GOOGLE_REDIRECT_URI` must match **exactly** what you configure in the Google Cloud Console, including the protocol (http/https), domain, and path - these are provided above.\n\n3. **GitHub OAuth Setup** (Optional)\n\n   \u003cdetails\u003e\n   \u003csummary\u003eClick to expand GitHub OAuth setup instructions\u003c/summary\u003e\n\n   - Go to [GitHub Developer Setting](https://github.com/settings/developers)\n   - Create a new OAuth App\n   - Add authorized redirect URIs:\n     - Development: `http://localhost:3000/api/auth/callback/github`\n     - Production: `https://your-production-url/api/auth/callback/github`\n   - Add to `.env`:\n\n     ```env\n     GITHUB_CLIENT_ID=your_client_id\n     GITHUB_CLIENT_SECRET=your_client_secret\n     ```\n   \u003c/details\u003e\n\n### Environment Variables\n\nCopy `.env.example` located in the `apps/mail` folder to `.env` in the same folder and configure the following variables:\n\n```env\n# Auth\nBETTER_AUTH_SECRET=     # Required: Secret key for authentication\n\n# Google OAuth (Required for Gmail integration)\nGOOGLE_CLIENT_ID=       # Required for Gmail integration\nGOOGLE_CLIENT_SECRET=   # Required for Gmail integration\nGOOGLE_REDIRECT_URI=    # Required for Gmail integration\n\n# GitHub OAuth (Optional)\nGITHUB_CLIENT_ID=       # Optional: For GitHub authentication\nGITHUB_CLIENT_SECRET=   # Optional: For GitHub authentication\n\n# Database\nDATABASE_URL=           # Required: PostgreSQL connection string for backend connection\n\n# Redis\nREDIS_URL=              # Redis URL for caching (http://localhost:8079 for local dev)\nREDIS_TOKEN=            # Redis token (upstash-local-token for local dev)\n```\n\nTo be able to run `pnpm db:push` and push the schemas to the database you also have to add a `.env` file to the `packages/db` folder (so `packages/db/.env`) with the following content:\n\n```env\nDATABASE_URL=          # Required: PostgreSQL connection string for migrations\n```\nFor local development a connection string example is provided in the `.env.example` file located in the same folder as the database.\n\n**Note:** The `DATABASE_URL` connection string in the `apps/mail/.env` has to be the same as the one in `packages/db/.env`\n\n### Database Setup\n\nZero uses PostgreSQL for storing data. Here's how to set it up:\n\n1. **Start the Database** \n\n   Run this command to start a local PostgreSQL instance:\n\n   ```bash\n   pnpm docker:up\n   ```\n\n   This creates a database with:\n   - Name: `zerodotemail`\n   - Username: `postgres`\n   - Password: `postgres`\n   - Port: `5432`\n\n2. **Set Up Database Connection**\n\n   Make sure your database connection string is in:\n   - `apps/mail/.env`\n   - `packages/db/.env`\n\n   For local development use:\n   ```\n   DATABASE_URL=\"postgresql://postgres:postgres@localhost:5432/zerodotemail\"\n   ```\n\n3. **Database Commands**\n\n   - **Install database dependencies**:\n     ```bash\n     pnpm db:dependencies\n     ```\n\n   - **Set up database tables**:\n     ```bash\n     pnpm db:push\n     ```\n\n   - **Create migration files** (after schema changes):\n     ```bash\n     pnpm db:generate\n     ```\n\n   - **Apply migrations**:\n     ```bash\n     pnpm db:migrate\n     ```\n\n   - **View database content**:\n     ```bash\n     pnpm db:studio\n     ```\n\n## Contribute\n\nPlease refer to the [contributing guide](.github/CONTRIBUTING.md).\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=Mail-0/Zero\u0026type=Timeline)](https://star-history.com/#Mail-0/Zero\u0026Timeline)","funding_links":["https://github.com/sponsors/nizzyabi"],"categories":["TypeScript","🔒 Security \u0026 Privacy","Projects (Open Source, \u003e1k stars)","ai"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMail-0%2FZero","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMail-0%2FZero","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMail-0%2FZero/lists"}