Skip to content
Merged

docs #412

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
96 changes: 86 additions & 10 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Thank you for your interest in contributing to 0.email! We're excited to have yo

- [Getting Started](#getting-started)
- [Development Workflow](#development-workflow)
- [Database Management](#database-management)
- [Coding Guidelines](#coding-guidelines)
- [Testing](#testing)
- [Documentation](#documentation)
Expand All @@ -16,34 +17,56 @@ 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/Mail-0.git`
- Clone your fork locally: `git clone https://github.com/YOUR-USERNAME/Zero.git`

2. **Set Up Development Environment**
- Install Node.js (v16 or higher)
- Install required dependencies: `pnpm install`
- Copy `.env.example` to `.env` and configure your environment variables
- 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`
- 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`

## Development Workflow

1. **Create a New Branch**
1. **Start the Development Environment**

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

# Start the development server
pnpm dev
```

2. **Create a New Branch**

Always create a new branch for your changes:

```bash
git checkout -b feature/your-feature-name
# or
git checkout -b fix/your-bug-fix
```

2. **Make Your Changes**
3. **Make Your Changes**

- Write clean, maintainable code
- Follow our coding standards
- Add/update tests as needed
- Update documentation if required

3. **Commit Your Changes**
4. **Test Your Changes**

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

5. **Commit Your Changes**

- Use clear, descriptive commit messages
- Reference issues and pull requests
Expand All @@ -54,17 +77,70 @@ Thank you for your interest in contributing to 0.email! We're excited to have yo
Implements #123"
```

4. **Push to Your Fork**
6. **Stay Updated**

Keep your fork in sync with the main repository:

```bash
git fetch upstream
git merge upstream/main
```

7. **Push to Your Fork**

```bash
git push origin your-branch-name
```

5. **Submit a Pull Request**
8. **Submit a Pull Request**
- Go to your fork on GitHub and click "New Pull Request"
- Fill out the PR template completely
- Link any relevant issues
- Add screenshots for UI changes

## Database Management

Zero uses PostgreSQL with Drizzle ORM. Here's how to work with it:

1. **Database Structure**

The database schema is defined in the `packages/db/src` directory.

2. **Common Database Tasks**

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

# Apply schema changes to development database
pnpm db:push

# Create migration files after schema changes
pnpm db:generate

# Apply migrations (for production)
pnpm db:migrate

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

3. **Database Connection**

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

For local development:
```
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/zerodotemail"
```

4. **Troubleshooting**

- **Connection Issues**: Make sure Docker is running
- **Schema Errors**: Check your schema files for errors

## Coding Guidelines

### General Principles
Expand Down
Loading