diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 4add6ab3..496aa556 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,138 +1,66 @@ -# CONTRIBUTING TO ZEPHYR +#### _
// Contribution in Zephyr
_ 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 +#### _
// Making Contributions
_ -### PREREQUISITES: -* Node.js v20+ -* pnpm -* Docker + Docker Compose -* Git +###### _
// Workflow
_ -### 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 -``` +###### _
// Development Commands
_ -## 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: `(): ` - 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 +#### _
// Code Standards
_ + +###### _
// Style rules
_ -### STYLE RULES: - Use TypeScript - Follow Biome config - Keep files focused - Comment complex logic - Use meaningful names -### COMMIT TYPES: +###### _
// Commit messages
_ + - `feat`: New feature - `fix`: Bug fix - `docs`: Documentation @@ -140,33 +68,20 @@ $ pnpm biome:fix - `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 -``` +#### _
// Troubleshooting
_ -### 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: +###### _
// Common Issues
_ 1. Database Connection: - Verify PostgreSQL is running @@ -183,43 +98,24 @@ $ docker-compose up - Rebuild dependencies - Check Docker logs -## 6. COMMUNITY GUIDELINES +#### _
// Community Guidelines
_ -### COMMUNICATION: +###### _
// Code of Conduct
_ - Be respectful - Stay on topic - Help others - Follow code of conduct -### ISSUE REPORTING: +###### _
// Reporting Issues
_ - Check existing issues - Provide reproduction - Be specific -- Follow templates +- Follow templates & labels +- Include logs or screenshots if needed -### PULL REQUESTS: +###### _
// Pull Requests
_ - 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. diff --git a/.github/README.md b/.github/README.md index 3f6c455d..1b6a52c3 100644 --- a/.github/README.md +++ b/.github/README.md @@ -1,8 +1,3 @@ ->[!IMPORTANT] -> In Process of adding proper documentation for SWOC, all the contibution guidelines / notes will be added today - -
-
@@ -10,15 +5,18 @@
---- - +

-
 Development 
   -
 Contribution 
   + +
 Development 
   +
 Contributing 
  
 Wiki 
  
 Roadmap 
   +
 Screenshots 
   +
 Troubleshoot 
   +
#### _
// Project Overview
_ @@ -29,31 +27,50 @@ #### _
// Sub-services under Zephyr
_ -- **[Repository](https://share.zephyyrr.in/s/repo)**: Main repository for zephyr & its services. -- **[Zephyr](https://development.zephyyrr.in)**: Main platform for zephyr. +- **[Repository](https://share.zephyyrr.in/s/repo)**: Mirrored Zephyr services and repositories (self hosted). +- **[Zephyr](https://development.zephyyrr.in)**: Development preview for zephyr (development branch). - **[Zephyr Support](https://development.zephyyrr.in/support)**: Support platform for zephyr. -- **[Zephyr AI](https://devai.zephyyrr.in)**: AI platform for zephyr uses ollama & open web ui with llama 3.2 1B & 2B models. -- **[Velastria / Zephyr chat](https://dev-chat.zephyyrr.in)**: Chat platform for zephyr. +- **[Velastria / Zephyr chat](https://dev-chat.zephyyrr.in)**: Chat platform for zephyr (WIP). +- **[Zephyr Forge](https://forge.zephyyrr.in)**: Easily setup zephyr on your own localhost with a single command. #### _
// Local Development Setup
_ -###### _
// Prerequisites
_ +###### _
// Prerequisites
_ - [Node.js](https://nodejs.org/) (v20 or higher) -- [pnpm](https://pnpm.io/installation) (Package manager) -- [Docker](https://www.docker.com/) (For development environment) +- [pnpm](https://pnpm.io/installation) (Workspace management) +- [Docker](https://www.docker.com/) (Containerization) - [Git](https://git-scm.com/) (Version control) -###### _
// Installation
_ +###### _
// Installation
_

We use pnpm and turbo for managing the dependencies and the monorepo structutre. To install the dependencies and start the development server, run the following commands:

-> [!IMPORTANT] -> Use the format in `.env.example` file to create a `.env` file in the root directory. -> `dev-server` is a script that runs the development server for postgres, redis, minio and creates a temp `.env` to start with. +###### _
Using Zephyr Forge (recommended)
_ + +[Zephyr Forge](https://github.com/parazeeknova/zephyr-forge) is a powerful utility designed to streamline the setup process for Zephyr development environments. It automates the entire configuration process, handling everything from dependency checks to Docker container management. + +
+ +###### *
Linux & MacOS
* + +```bash +curl -fsSL https://forge.zephyyrr.in/install.sh | bash +``` + +###### *
Windows
* + +```powershell +irm https://forge.zephyyrr.in/install.ps1 | iex +``` + +
+ +###### _
Manual Installation
_ + ```bash # 1. Clone the repository @@ -63,69 +80,127 @@ git clone https://github.com/zephyr.git && cd zephyr pnpm install # 3. First time setup or after clean -pnpm run dev:server - -# Subsequent starts -pnpm run docker:start +pnpm run start +(This will start the development server using docker and create the required services & migrations) # Clean everything and start fresh -pnpm run docker:clean:dev && pnpm run dev:server +pnpm run docker:clean:dev && pnpm run start # 4. Set `.env` variables form `.env.example` file (optional if you want auth and other services) cp .env.example .env # Unix/Linux/Mac copy .env.example .env # Windows # Read the `.env.example` file for more information -# 5.Start development server -pnpm run dev:start - -# OR Manually +# 5. Start the development server pnpm turbo dev + +# Check package.json for more scripts in the root directory ``` +> [!TIP] +> **start** script uses docker-compose to start the required services & migrations. Check individual script in `docker/scripts` folder for more information. ###### _
// Ports:
_ +If everything goes well, you should be able to access the following services: - Next.js: http://localhost:3000 -- PostgreSQL: localhost:5433 -- Redis: localhost:6379 -- MinIO Console: http://localhost:9001 +- PostgreSQL: http://localhost:5433 +- Redis: http://localhost:6379 +- MinIO Console: http://localhost:9001 or http://localhost:9000 + + +#### _
// Project Structure
_ +This is a high-level overview of the monorepo structure, check the individual package for more sub-packages and details. +``` +/zephyr - Root directory + /apps + /web - web app (main) + /packages + /aggregator - Aggregator service + /auth - Authentication & Email + /config - Shared configs & utils + /db - Database & Cache + /ui - UI components + /docker - Container configs & scripts +``` + +#### _
// Screenshots
_ + +| Homepage | Notifications | Bookmarks | +| :---------------------------------------------: | :------------------------------------------------------: | :----------------------------------------------: | +| ![homepage](./assets//screenshots/homepage.png) | ![notifications](./assets/screenshots/notifications.png) | ![bookamrks](./assets/screenshots/bookmarks.png) | + +| Profile | Chat | Users | +| :------------------------------------------: | :----------------------------------------: | :--------------------------------------: | +| ![profile](./assets/screenshots/profile.png) | ![settings](./assets/screenshots/chat.png) | ![users](./assets/screenshots/users.png) | + + +#### _
// Troubleshooting
_ -#### _
// Troubleshooting Common Issues
_ +> [!TIP] +> Try `pnpm run docker:interactive`: Docker utility to clean and manage the docker services for Zephyr. -###### _
// Prisma
_ +###### _
// pre commit hooks
_ + +If you encounter any issues with the pre-commit hooks, try running the following commands: -- If you encounter any issues with Prisma, try running the following commands: ```bash +# Ensure that your code is formatted and linted +pnpm run biome:fix +``` + +If you encounter any issues with the development setup, try the following steps: + +###### _
// Database
_ + +If you encounter any issues with Prisma or the migrations failed, try running the following commands: + +```bash +# Navigate to the db package cd packages/db + +# Run the following commands pnpm prisma generate pnpm prisma db push ``` -###### _
// Minio
_ +###### _
// Minio (Object Storage)
_ -- If you encounter any issues with Minio, create bucket manually: +If you encounter any issues with Minio or the buckets are not created, try the following steps: ```bash +# Ensure MinIO is running Access MinIO Console at http://localhost:9001 -Login with default credentials: + +# Login with default credentials: Username: minioadmin Password: minioadmin + ``` -- Create buckets manually: +Create the following buckets: + ```bash - uploads - temp - backups ``` +If you still encounter any issues with the development server, report the issue on the [Issues](https://github.com/parazeeknova/zephyr/issues) page. + #### _
// Analytics
_ ![Alt](https://repobeats.axiom.co/api/embed/21d8d944036757fcd0624e71d0b2598ca8b8041f.svg "Repobeats analytics image") -#### _
// License
_ +
+
+ +
+ + Catppuccino Cat + +

Zephyr is licensed under the AGPL License.

---- +##### *
// Copyright © 2025 Parazeeknova
* diff --git a/.github/assets/screenshots/bookmarks.png b/.github/assets/screenshots/bookmarks.png new file mode 100644 index 00000000..c792a8f6 Binary files /dev/null and b/.github/assets/screenshots/bookmarks.png differ diff --git a/.github/assets/screenshots/chat.png b/.github/assets/screenshots/chat.png new file mode 100644 index 00000000..79832c25 Binary files /dev/null and b/.github/assets/screenshots/chat.png differ diff --git a/.github/assets/screenshots/homepage.png b/.github/assets/screenshots/homepage.png new file mode 100644 index 00000000..d95e62e4 Binary files /dev/null and b/.github/assets/screenshots/homepage.png differ diff --git a/.github/assets/screenshots/notifications.png b/.github/assets/screenshots/notifications.png new file mode 100644 index 00000000..907ecea4 Binary files /dev/null and b/.github/assets/screenshots/notifications.png differ diff --git a/.github/assets/screenshots/profile.png b/.github/assets/screenshots/profile.png new file mode 100644 index 00000000..a4e46202 Binary files /dev/null and b/.github/assets/screenshots/profile.png differ diff --git a/.github/assets/screenshots/users.png b/.github/assets/screenshots/users.png new file mode 100644 index 00000000..03262d7f Binary files /dev/null and b/.github/assets/screenshots/users.png differ