Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ RUN . $NVM_DIR/nvm.sh && \
nvm install --lts && \
nvm use --lts && \
nvm alias default 'lts/*' && \
npm install -g yarn pnpm
npm install -g bun

# Register Nvm in bashrc and zshrc
RUN echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bashrc
Expand Down
52 changes: 28 additions & 24 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,20 @@ Thank you for your interest in contributing to 0.email! We're excited to have yo

## Table of Contents

- [Getting Started](#getting-started)
- [Development Workflow](#development-workflow)
- [Database Management](#database-management)
- [Coding Guidelines](#coding-guidelines)
- [Testing](#testing)
- [Documentation](#documentation)
- [Areas of Contribution](#areas-of-contribution)
- [Community](#community)
- [Questions or Need Help?](#questions-or-need-help)
- [Contributing to 0.email](#contributing-to-0email)
- [Table of Contents](#table-of-contents)
- [Getting Started](#getting-started)
- [Development Workflow](#development-workflow)
- [Database Management](#database-management)
- [Coding Guidelines](#coding-guidelines)
- [General Principles](#general-principles)
- [JavaScript/TypeScript Guidelines](#javascripttypescript-guidelines)
- [React Guidelines](#react-guidelines)
- [Testing](#testing)
- [Documentation](#documentation)
- [Areas of Contribution](#areas-of-contribution)
- [Community](#community)
- [Questions or Need Help?](#questions-or-need-help)

## Getting Started

Expand All @@ -21,25 +26,24 @@ Thank you for your interest in contributing to 0.email! We're excited to have yo
- Clone your fork locally: `git clone https://github.com/YOUR-USERNAME/Zero.git`

2. **Set Up Development Environment**
- Install [Node.js](https://nodejs.org/en/download) (v18 or higher)
- Install pnpm: `npm install -g pnpm`
- Install dependencies: `pnpm install`
- Start the database locally: `pnpm docker:up`
- 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
- Set up your Google OAuth credentials (see [README.md](../README.md))
- Install database dependencies: `pnpm db:dependencies`
- Initialize the database: `pnpm db:push`
- Install database dependencies: `bun db:dependencies`
- Initialize the database: `bun db:push`

## Development Workflow

1. **Start the Development Environment**

```bash
# Start database locally
pnpm docker:up
bun docker:up

# Start the development server
pnpm dev
bun dev
```

2. **Create a New Branch**
Expand All @@ -63,8 +67,8 @@ Thank you for your interest in contributing to 0.email! We're excited to have yo

- Make sure the app runs without errors
- Test your feature thoroughly
- Run linting: `pnpm lint`
- Format code: `pnpm format`
- Run linting: `bun lint`
- Format code: `bun format`

5. **Commit Your Changes**

Expand Down Expand Up @@ -110,19 +114,19 @@ Zero uses PostgreSQL with Drizzle ORM. Here's how to work with it:

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

# Apply schema changes to development database
pnpm db:push
bun db:push

# Create migration files after schema changes
pnpm db:generate
bun db:generate

# Apply migrations (for production)
pnpm db:migrate
bun db:migrate

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

3. **Database Connection**
Expand Down
14 changes: 5 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,13 @@ jobs:
- name: Checkout Code πŸ›Ž
uses: actions/checkout@v4

- name: Setup pnpm πŸ“¦
uses: pnpm/action-setup@v3

- name: Setup Node.js 🟩
uses: actions/setup-node@v4
- name: Setup Bun 🌟
uses: oven-sh/setup-bun@v1
with:
cache: "pnpm"
node-version: "22"
bun-version: latest

- name: Install Dependencies πŸ“¦
run: pnpm install
run: bun install

- name: Check 🚨
run: pnpm format
run: bun format
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

bun-debug.log*
# env files (can opt-in for committing if needed)
.env

Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pnpm lint-staged
bun lint-staged
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pnpm-lock.yaml
bun.lockb
node_modules
.next
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Zero is built with modern and reliable technologies:
**Required Versions:**

- [Node.js](https://nodejs.org/en/download) (v18 or higher)
- [pnpm](https://pnpm.io/installation) (v8 or higher)
- [Bun](https://bun.sh) (v1.0 or higher)
- [Docker](https://docs.docker.com/engine/install/) (v20 or higher)

Before 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.
Expand All @@ -64,13 +64,13 @@ You can set up Zero in two ways:
cd Zero

# Install dependencies
pnpm install
bun install

# Install database dependencies
pnpm db:dependencies
bun db:dependencies

# Start database locally
pnpm docker:up
bun docker:up
```

2. **Set Up Environment**
Expand All @@ -80,13 +80,13 @@ You can set up Zero in two ways:
cp apps/mail/.env.example apps/mail/.env && cp packages/db/.env.example packages/db/.env
```
- Configure your environment variables (see below)
- Install database dependencies: `pnpm db:dependencies`
- Initialize the database: `pnpm db:push`
- Install database dependencies: `bun db:dependencies`
- Initialize the database: `bun db:push`

3. **Start the App**

```bash
pnpm dev
bun dev
```

4. **Open in Browser**
Expand Down Expand Up @@ -118,8 +118,8 @@ This option uses VS Code's Dev Containers feature to provide a fully configured
- For dependency issues inside the container:
```bash
rm -rf node_modules
rm pnpm-lock.yaml
pnpm install
rm bun.lockb
bun install
```
</details>

Expand Down Expand Up @@ -210,7 +210,7 @@ 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 `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:
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
Expand All @@ -228,7 +228,7 @@ Zero uses PostgreSQL for storing data. Here's how to set it up:
Run this command to start a local PostgreSQL instance:

```bash
pnpm docker:up
bun docker:up
```

This creates a database with:
Expand All @@ -252,27 +252,27 @@ Zero uses PostgreSQL for storing data. Here's how to set it up:

- **Install database dependencies**:
```bash
pnpm db:dependencies
bun db:dependencies
```

- **Set up database tables**:
```bash
pnpm db:push
bun db:push
```

- **Create migration files** (after schema changes):
```bash
pnpm db:generate
bun db:generate
```

- **Apply migrations**:
```bash
pnpm db:migrate
bun db:migrate
```

- **View database content**:
```bash
pnpm db:studio
bun db:studio
```

## Contribute
Expand Down
2 changes: 1 addition & 1 deletion apps/mail/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

bun-debug.log*
# env files (can opt-in for committing if needed)
.env

Expand Down
Loading