Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
1a0ad90
draft fixes:
ahmetskilinc Apr 19, 2025
1622cca
some fixes for saving attachments to draft
ahmetskilinc Apr 19, 2025
eea8827
fix for empty draft loading
ahmetskilinc Apr 19, 2025
3a2860e
fix draft list recipient name/address
ahmetskilinc Apr 19, 2025
397090c
also show 'No Recipient' if empty
ahmetskilinc Apr 19, 2025
cc52f73
remove comments
ahmetskilinc Apr 19, 2025
b66393c
Merge branch 'staging' into fix-some-draft-issues
ahmetskilinc Apr 20, 2025
aaf0678
Merge branch 'staging' into fix-some-draft-issues
ahmetskilinc Apr 21, 2025
0214edb
switch to mimetext for draft saving to keep formatting consistent
ahmetskilinc Apr 21, 2025
3253ec3
add message title to draft list
ahmetskilinc Apr 21, 2025
181f606
Merge branch 'staging' into fix-some-draft-issues
ahmetskilinc Apr 21, 2025
281e215
feat: single api for oauth connections
BlankParticle Apr 21, 2025
de0ea3f
Merge branch 'staging' into fix-some-draft-issues
ahmetskilinc Apr 21, 2025
80e1af9
Merge pull request #723 from Mail-0/fix-some-draft-issues
ahmetskilinc Apr 21, 2025
2763b45
fix: add extra error handling
BlankParticle Apr 21, 2025
3ac1712
Merge branch 'staging' into feat/single-point-of-oauth
ahmetskilinc Apr 21, 2025
37e5190
Merge pull request #741 from BlankParticle/feat/single-point-of-oauth
ahmetskilinc Apr 21, 2025
b3415c3
chore: simplify and fix the dev env
BlankParticle Apr 21, 2025
3364807
Merge branch 'staging' into chore/fix-dev-env
MrgSub Apr 21, 2025
d57570c
Merge pull request #742 from BlankParticle/chore/fix-dev-env
MrgSub Apr 21, 2025
1d37659
Ai generate security (#706)
ripgrim Apr 21, 2025
797a8cd
Add a new Vietnamese translation file to support Vietnamese language …
ncdai Apr 21, 2025
57936a1
Update es.json (#710)
danibaldomir Apr 22, 2025
3b338fb
Update app manifest and add new icons for PWA (#739)
humbernieto Apr 22, 2025
9a75453
feat: allow sending from email aliases added through gmail (#743)
atharvadeosthale Apr 22, 2025
acbf4b6
Refactor IP handling in early-access routes
MrgSub Apr 22, 2025
f59fb33
Add unauthorized error handling in sign out function
MrgSub Apr 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions apps/mail/.env.example → .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ BETTER_AUTH_TRUSTED_ORIGINS=http://localhost:3000
# Change to your project's client ID and secret, these work with localhost:3000 and localhost:3001
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_REDIRECT_URI=http://localhost:3000/api/v1/mail/auth/google/callback


GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
GITHUB_REDIRECT_URI=http://localhost:3000/api/auth/callback/github

# Upstash/Local Redis Instance
REDIS_URL="http://localhost:8079"
Expand Down
25 changes: 11 additions & 14 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ Thank you for your interest in contributing to 0.email! We're excited to have yo
## Getting Started

1. **Fork the Repository**

- Click the 'Fork' button at the top right of this repository
- Clone your fork locally: `git clone https://github.com/YOUR-USERNAME/Zero.git`

2. **Set Up Development Environment**
- Install [Bun](https://bun.sh)
- Clone the repository and install dependencies: `bun install`
- Start the database locally: `bun docker:up`
- Copy `.env.example` to `.env` in both `apps/mail` and `packages/db` folders
- Copy `.env.example` to `.env` in project root
- Set up your Google OAuth credentials (see [README.md](../README.md))
- Install database dependencies: `bun db:dependencies`
- Initialize the database: `bun db:push`

## Development Workflow
Expand All @@ -42,7 +42,7 @@ Thank you for your interest in contributing to 0.email! We're excited to have yo
```bash
# Start database locally
bun docker:up

# Start the development server
bun dev
```
Expand Down Expand Up @@ -112,29 +112,24 @@ Zero uses PostgreSQL with Drizzle ORM. Here's how to work with it:
2. **Common Database Tasks**

```bash
# Install database dependencies
bun db:dependencies

# Apply schema changes to development database
bun db:push

# Create migration files after schema changes
bun db:generate

# Apply migrations (for production)
bun db:migrate

# View and edit data with Drizzle Studio
bun db:studio
```

3. **Database Connection**

Make sure your database connection string is in both:
- `apps/mail/.env`
- `packages/db/.env`

Make sure your database connection string is in `.env`
For local development:

```
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/zerodotemail"
```
Expand Down Expand Up @@ -181,13 +176,15 @@ Zero uses PostgreSQL with Drizzle ORM. Here's how to work with it:
When implementing new features, follow these guidelines:

1. **Add English Source Strings**

- Place all user-facing text in `apps/mail/locales/en.json`
- Organize strings according to the existing structure
- Use descriptive, hierarchical keys that identify the feature and context
- Example: `"pages.settings.connections.disconnectSuccess": "Account disconnected successfully"`

2. **Follow i18n Formatting Standards**
- Variables: `{variableName}`

- Variables: `{variableName}`
- Pluralization: `{count, plural, =0 {items} one {item} other {items}}`
- Avoid string concatenation to ensure proper translation

Expand Down
60 changes: 7 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,18 @@ You can set up Zero in two ways:
# Install dependencies
bun install

# Install database dependencies
bun db:dependencies

# Start database locally
bun docker:up
```

2. **Set Up Environment**

- Copy `.env.example` to `.env` in both `apps/mail` and `packages/db` folders
- Copy `.env.example` to `.env` in project root
```bash
cp apps/mail/.env.example apps/mail/.env && cp packages/db/.env.example packages/db/.env
cp .env.example .env
```
- Configure your environment variables (see below)
- Install database dependencies: `bun db:dependencies`
- Start the database with the provided docker compose setup: `bun docker:up`
- Initialize the database: `bun db:push`

3. **Start the App**
Expand Down Expand Up @@ -152,16 +149,13 @@ bun install
- Add authorized redirect URIs:
- Development:
- `http://localhost:3000/api/auth/callback/google`
- `http://localhost:3000/api/v1/mail/auth/google/callback`
- Production:
- `https://your-production-url/api/auth/callback/google`
- `https://your-production-url/api/v1/mail/auth/google/callback`
- Add to `.env`:

```env
GOOGLE_CLIENT_ID=your_client_id
GOOGLE_CLIENT_SECRET=your_client_secret
GOOGLE_REDIRECT_URI=http://localhost:3000/api/v1/mail/auth/google/callback
```

- Add yourself as a test user:
Expand All @@ -171,30 +165,11 @@ bun install
- Add your email and click 'Save'

> [!WARNING]
> 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.

3. **GitHub OAuth Setup** (Optional)

<details>
<summary>Click to expand GitHub OAuth setup instructions</summary>

- Go to [GitHub Developer Setting](https://github.com/settings/developers)
- Create a new OAuth App
- Add authorized redirect URIs:
- Development: `http://localhost:3000/api/auth/callback/github`
- Production: `https://your-production-url/api/auth/callback/github`
- Add to `.env`:

```env
GITHUB_CLIENT_ID=your_client_id
GITHUB_CLIENT_SECRET=your_client_secret
```

</details>
> The authorized redirect URIs in Google Cloud Console must match **exactly** what you configure in the `.env`, including the protocol (http/https), domain, and path - these are provided above.

### Environment Variables

Copy `.env.example` located in the `apps/mail` folder to `.env` in the same folder and configure the following variables:
Copy `.env.example` located in the project folder to `.env` in the same folder and configure the following variables:

```env
# Auth
Expand All @@ -203,11 +178,6 @@ BETTER_AUTH_SECRET= # Required: Secret key for authentication
# Google OAuth (Required for Gmail integration)
GOOGLE_CLIENT_ID= # Required for Gmail integration
GOOGLE_CLIENT_SECRET= # Required for Gmail integration
GOOGLE_REDIRECT_URI= # Required for Gmail integration

# GitHub OAuth (Optional)
GITHUB_CLIENT_ID= # Optional: For GitHub authentication
GITHUB_CLIENT_SECRET= # Optional: For GitHub authentication

# Database
DATABASE_URL= # Required: PostgreSQL connection string for backend connection
Expand All @@ -217,16 +187,8 @@ REDIS_URL= # Redis URL for caching (http://localhost:8079 for local
REDIS_TOKEN= # Redis token (upstash-local-token for local dev)
```

To be able to run `bun 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:

```env
DATABASE_URL= # Required: PostgreSQL connection string for migrations
```

For local development a connection string example is provided in the `.env.example` file located in the same folder as the database.

**Note:** The `DATABASE_URL` connection string in the `apps/mail/.env` has to be the same as the one in `packages/db/.env`

### Database Setup

Zero uses PostgreSQL for storing data. Here's how to set it up:
Expand All @@ -248,10 +210,7 @@ Zero uses PostgreSQL for storing data. Here's how to set it up:

2. **Set Up Database Connection**

Make sure your database connection string is in:

- `apps/mail/.env`
- `packages/db/.env`
Make sure your database connection string is in `.env` file.

For local development use:

Expand All @@ -261,12 +220,6 @@ Zero uses PostgreSQL for storing data. Here's how to set it up:

3. **Database Commands**

- **Install database dependencies**:

```bash
bun db:dependencies
```

- **Set up database tables**:

```bash
Expand All @@ -289,6 +242,7 @@ Zero uses PostgreSQL for storing data. Here's how to set it up:
```bash
bun db:studio
```
> If you run `bun dev` in your terminal, the studio command should be automatically running with the app.

## Contribute

Expand Down
1 change: 0 additions & 1 deletion apps/mail/.nvmrc

This file was deleted.

Loading