# Contributing to ClaraVerse First off, thank you for considering contributing to ClaraVerse! 🎉 ClaraVerse is built by the community, for the community. We welcome contributions from developers of all skill levels. ## Table of Contents - [Code of Conduct](#code-of-conduct) - [How Can I Contribute?](#how-can-i-contribute) - [Development Setup](#development-setup) - [Pull Request Process](#pull-request-process) - [Coding Standards](#coding-standards) - [Commit Messages](#commit-messages) - [Testing](#testing) ## Code of Conduct This project adheres to a Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to [hello@claraverse.space](mailto:hello@claraverse.space). **In Short:** - Be respectful and inclusive - Welcome newcomers and help them learn - Accept constructive criticism gracefully - Focus on what's best for the community - Show empathy towards other community members ## How Can I Contribute? ### 🐛 Reporting Bugs Before creating bug reports, please check existing issues to avoid duplicates. When creating a bug report, include: - **Clear title and description** - **Steps to reproduce** the issue - **Expected vs actual behavior** - **Screenshots** if applicable - **Environment details**: OS, browser, versions - **Error messages and logs** ### 💡 Suggesting Features Feature suggestions are welcome! Please: - **Check existing issues** for duplicates - **Describe the problem** you're trying to solve - **Explain your proposed solution** with examples - **Consider alternatives** you've thought about - **Explain why** this benefits the community ### 📝 Improving Documentation Documentation improvements are always appreciated: - Fix typos and grammar - Add missing information - Improve clarity and examples - Add tutorials and guides - Translate to other languages ### 🔧 Code Contributions We especially welcome contributions in these areas: - **Bug Fixes**: Check [open issues labeled "bug"](https://github.com/claraverse-space/ClaraVerse-Scarlet/labels/bug) - **Features**: Check [open issues labeled "enhancement"](https://github.com/claraverse-space/ClaraVerse-Scarlet/labels/enhancement) - **UI/UX**: Design improvements and accessibility - **Testing**: Unit tests, integration tests, E2E tests - **Integrations**: Connectors for new tools and services - **Models**: Support for new LLM providers ## Development Setup ### Prerequisites - **Go**: 1.24 or higher - **Node.js**: 20 or higher - **Python**: 3.11 or higher (for E2B service) - **Docker**: Latest version (optional, for containerized development) - **Git**: Latest version ### Quick Start 1. **Fork and clone the repository** ```bash git clone https://github.com/YOUR_USERNAME/ClaraVerse-Scarlet.git cd ClaraVerse-Scarlet ``` 2. **Install dependencies** ```bash make install ``` 3. **Set up environment variables** ```bash cp .env.example .env cp backend/providers.example.json backend/providers.json # Edit .env and providers.json with your configuration ``` 4. **Start development environment** **Option A: Using tmux (recommended)** ```bash ./dev.sh ``` **Option B: Manual (separate terminals)** ```bash # Terminal 1 - Backend cd backend go run ./cmd/server # Terminal 2 - Frontend cd frontend npm run dev # Terminal 3 - E2B Service (optional) cd backend/e2b-service python -m venv venv source venv/bin/activate pip install -r requirements.txt uvicorn main:app --reload --port 8001 ``` 5. **Access the application** - Frontend: http://localhost:5173 - Backend: http://localhost:3001 - E2B Service: http://localhost:8001 ### Project Structure ``` ClaraVerse-Scarlet/ ├── frontend/ # React + TypeScript + Vite │ ├── src/ │ │ ├── components/ # Reusable UI components │ │ ├── pages/ # Page components │ │ ├── services/ # API clients, WebSocket │ │ ├── store/ # Zustand state management │ │ └── utils/ # Utility functions │ └── package.json │ ├── backend/ # Go + Fiber API server │ ├── cmd/server/ # Application entry point │ ├── internal/ │ │ ├── handlers/ # HTTP & WebSocket handlers │ │ ├── services/ # Business logic │ │ ├── models/ # Data structures │ │ └── middleware/ # Auth, CORS, etc. │ ├── e2b-service/ # Python code execution service │ └── docs/ # Backend documentation │ └── docs/ # Project documentation ``` ## Pull Request Process ### Before Submitting 1. **Create a feature branch** ```bash git checkout -b feature/your-feature-name # or git checkout -b fix/bug-description ``` 2. **Make your changes** - Write clean, maintainable code - Follow coding standards (see below) - Add tests for new functionality - Update documentation as needed 3. **Test your changes** ```bash # Frontend tests cd frontend npm run test npm run lint npm run type-check # Backend tests cd backend go test ./... go vet ./... ``` 4. **Commit your changes** ```bash git add . git commit -m "feat: add amazing feature" ``` ### Submitting the PR 1. **Push to your fork** ```bash git push origin feature/your-feature-name ``` 2. **Open a Pull Request** - Go to the [ClaraVerse repository](https://github.com/claraverse-space/ClaraVerse-Scarlet) - Click "New Pull Request" - Select your fork and branch - Fill out the PR template 3. **PR Title Format** ``` type(scope): description Examples: feat(chat): add streaming message support fix(auth): resolve token refresh issue docs(readme): update installation instructions refactor(api): simplify error handling test(chat): add WebSocket connection tests ``` 4. **PR Description Should Include** - **What** changed and **why** - **How** to test the changes - **Screenshots** for UI changes - **Breaking changes** if any - **Related issues** (e.g., "Fixes #123") ### Review Process - Maintainers will review your PR within 2-3 business days - Address feedback by pushing new commits - Once approved, a maintainer will merge your PR - Your contribution will be included in the next release! ## Coding Standards ### Frontend (TypeScript/React) ```typescript // ✅ Good: Use functional components with TypeScript interface ButtonProps { label: string; onClick: () => void; variant?: 'primary' | 'secondary'; } export const Button: React.FC = ({ label, onClick, variant = 'primary' }) => { return ( ); }; // ❌ Bad: Avoid any types and unclear naming const Btn = (props: any) =>