Skip to content

Commit

Permalink
docs[README]: Updated readme & contirbution
Browse files Browse the repository at this point in the history
new intel
  • Loading branch information
parazeeknova committed Jan 12, 2025
1 parent d2cda8e commit 2dc2f66
Show file tree
Hide file tree
Showing 8 changed files with 163 additions and 192 deletions.
198 changes: 47 additions & 151 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,172 +1,87 @@
# CONTRIBUTING TO ZEPHYR
#### _<div align="left"><sub>// Contribution in Zephyr</sub></div>_

Thank you for your interest in contributing to Zephyr! This guide will help you start contributing to our community-driven platform.

## TABLE OF CONTENTS
1. [Development Setup](#development-setup)
2. [Project Structure](#project-structure)
3. [Making Contributions](#making-contributions)
4. [Code Standards](#code-standards)
5. [Troubleshooting](#troubleshooting)
6. [Community Guidelines](#community-guidelines)
1. [Making Contributions](#-making-contributions)
2. [Code Standards](#-code-standards)
3. [Troubleshooting](#-troubleshooting)
4. [Community Guidelines](#-community-guidelines)

## 1. DEVELOPMENT SETUP
#### _<div align="left"><sub>// Making Contributions</sub></div>_

### PREREQUISITES:
* Node.js v20+
* pnpm
* Docker + Docker Compose
* Git
###### _<div align="left"><sub>// Workflow</sub></div>_

### STEP-BY-STEP SETUP:

#### a) Clone Repository:
```sh
$ git clone https://github.com/YOUR_USERNAME/zephyr.git
$ cd zephyr
```
1. Fork the repository
2. Clone the forked repository
3. Create a new branch (git checkout -b feature/branch-name)
4. Make changes
5. Format changes (pnpm run biome:fix)
6. Commit changes (git commit -am 'feat[SOME]: Some changes')
7. Push changes (git push origin feature/branch-name)
8. Create a pull request

#### b) Install Dependencies:
```sh
$ pnpm install
```

#### c) Environment Setup:
1. Copy environment templates:
- `apps/web/.env.example``apps/web/.env`
- Create `packages/db/.env`

2. Configure Environment Variables:
```ini
[DATABASE]
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=zephyr
POSTGRES_PORT=5433
POSTGRES_HOST=localhost
DATABASE_URL=postgresql://postgres:postgres@localhost:5433/zephyr?schema=public

[REDIS]
REDIS_PASSWORD=zephyrredis
REDIS_PORT=6379
REDIS_HOST=localhost

[MINIO]
MINIO_ROOT_USER=minioadmin
MINIO_ROOT_PASSWORD=minioadmin
MINIO_PORT=9000
MINIO_CONSOLE_PORT=9001
```

#### d) Start Development:
- Windows: `./dev-start.ps1`
- Unix: `./dev-start.sh`

Or manually:
```sh
$ docker-compose -f docker-compose.dev.yml up -d
$ pnpm turbo dev
```
###### _<div align="left"><sub>// Development Commands</sub></div>_

## 2. PROJECT STRUCTURE
```sh
# Start development server
pnpm turbo dev

# Start development backend server (docker services)
pnpm run start
```
/zephyr
/apps
/web - Next.js application
/packages
/auth - Authentication
/config - Shared configs
/db - Database (Prisma)
/ui - UI components
/docker - Container configs
```

## 3. MAKING CONTRIBUTIONS

### WORKFLOW:

1. Fork & Branch
```sh
$ git checkout -b feature/your-feature
```

2. Development
- Write code
- Add tests
- Update docs
- Follow style guide

3. Commit
Format: `<type>(<scope>): <description>`
Example: `feat(auth): add password reset`

4. Pull Request
- Fill template
- Link issues
- Pass checks

### DEVELOPMENT COMMANDS:

Start servers:
```sh
$ pnpm turbo dev
# Formatting check
pnpm biome:check
```

Check code:
```sh
$ pnpm biome:check
# Docker clean
pnpm run docker:interactive
```

Fix style:
```sh
$ pnpm biome:fix
# Formatting fix
pnpm biome:fix
```

## 4. CODE STANDARDS
#### _<div align="left"><sub>// Code Standards</sub></div>_

###### _<div align="left"><sub>// Style rules</sub></div>_

### STYLE RULES:
- Use TypeScript
- Follow Biome config
- Keep files focused
- Comment complex logic
- Use meaningful names

### COMMIT TYPES:
###### _<div align="left"><sub>// Commit messages</sub></div>_

- `feat`: New feature
- `fix`: Bug fix
- `docs`: Documentation
- `style`: Formatting
- `refactor`: Code change
- `test`: Adding tests
- `chore`: Maintenance
- `perf`: Performance
- `ci`: Continuous integration
- `build`: Build system
- `revert`: Revert changes
- `wip`: Work in progress

## 5. TROUBLESHOOTING

### DATABASE ISSUES:
example: `feat[MODULE]: Add new module`

Check logs:
```sh
$ docker logs zephyr-postgres-dev
```

Manual Prisma setup:
```sh
$ cd packages/db
$ pnpm prisma generate
$ pnpm prisma db push
```
#### _<div align="left"><sub>// Troubleshooting</sub></div>_

### DOCKER ISSUES:
**Having trouble?** [Open an issue](https://github.com/parazeeknova/zephyr/issues)

Reset containers:
```sh
$ docker-compose down -v
$ docker-compose build --no-cache
$ docker-compose up
```

### COMMON FIXES:
###### _<div align="left"><sub>// Common Issues</sub></div>_

1. Database Connection:
- Verify PostgreSQL is running
Expand All @@ -183,43 +98,24 @@ $ docker-compose up
- Rebuild dependencies
- Check Docker logs

## 6. COMMUNITY GUIDELINES
#### _<div align="left"><sub>// Community Guidelines</sub></div>_

### COMMUNICATION:
###### _<div align="left"><sub>// Code of Conduct</sub></div>_
- Be respectful
- Stay on topic
- Help others
- Follow code of conduct

### ISSUE REPORTING:
###### _<div align="left"><sub>// Reporting Issues</sub></div>_
- Check existing issues
- Provide reproduction
- Be specific
- Follow templates
- Follow templates & labels
- Include logs or screenshots if needed

### PULL REQUESTS:
###### _<div align="left"><sub>// Pull Requests</sub></div>_
- Link related issues
- Describe changes
- Add tests
- Update docs

======================

## QUICK REFERENCE:

### Ports:
- Web: 3000
- PostgreSQL: 5433
- Redis: 6379
- MinIO: 9000/9001

### Commands:
- Setup: `pnpm install`
- Dev: `pnpm turbo dev`
- Style: `pnpm biome:check`
- Fix: `pnpm biome:fix`

======================

Thank you for contributing to Zephyr!
For detailed information, visit our GitHub repository.
Loading

0 comments on commit 2dc2f66

Please sign in to comment.