# Contributing to Depl0y Thank you for your interest in contributing to Depl0y! We welcome contributions from the community. ## Code of Conduct By participating in this project, you agree to maintain a respectful and inclusive environment for everyone. ## How to Contribute ### Reporting Bugs Before creating a bug report, please check the existing issues to avoid duplicates. When filing a bug report, include: - **Clear title**: Describe the issue concisely - **Steps to reproduce**: Detailed steps to recreate the problem - **Expected behavior**: What you expected to happen - **Actual behavior**: What actually happened - **Environment**: - Depl0y version - Operating system - Proxmox VE version - Browser (if UI-related) - **Screenshots**: If applicable - **Logs**: Relevant log output from `/var/log/depl0y/` or systemd journal ### Suggesting Enhancements Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion: - **Use a clear title** that describes the enhancement - **Provide detailed description** of the proposed functionality - **Explain why this enhancement would be useful** to most users - **List alternatives you've considered** - **Include mockups or examples** if applicable ### Pull Requests 1. **Fork the repository** and create your branch from `main` 2. **Make your changes** with clear, logical commits 3. **Test your changes** thoroughly 4. **Update documentation** if needed 5. **Follow the code style** guidelines below 6. **Write good commit messages** (see below) 7. **Submit a pull request** #### Pull Request Process 1. Update the README.md or documentation with details of changes if applicable 2. Update the CHANGELOG.md following the existing format 3. The PR will be merged once you have the sign-off of a maintainer ## Development Setup ### Prerequisites - Python 3.10 or higher - Node.js 18 or higher - SQLite 3 - Git ### Local Development 1. **Clone the repository**: ```bash git clone https://github.com/agit8or1/Depl0y.git cd Depl0y ``` 2. **Backend setup**: ```bash cd backend python3 -m venv venv source venv/bin/activate pip install -r requirements.txt ``` 3. **Frontend setup**: ```bash cd frontend npm install npm run dev ``` 4. **Database setup**: ```bash # The installer script handles this in production # For development, you can manually initialize the database sqlite3 /var/lib/depl0y/db/depl0y.db < backend/schema.sql ``` 5. **Run backend**: ```bash cd backend source venv/bin/activate uvicorn app.main:app --reload --host 0.0.0.0 --port 8000 ``` 6. **Run frontend**: ```bash cd frontend npm run dev ``` ### Testing Before submitting a PR, ensure: 1. **Backend tests pass**: ```bash cd backend pytest ``` 2. **Frontend builds successfully**: ```bash cd frontend npm run build ``` 3. **Manual testing**: - Test the specific feature you added/modified - Test related features that might be affected - Test in both fresh install and upgrade scenarios ## Code Style Guidelines ### Python (Backend) - Follow PEP 8 style guide - Use type hints where appropriate - Write docstrings for functions and classes - Keep functions focused and single-purpose - Maximum line length: 100 characters Example: ```python def create_vm(vm_config: VMConfig) -> VM: """ Create a new VM in Proxmox. Args: vm_config: Configuration for the new VM Returns: The created VM object Raises: ProxmoxException: If VM creation fails """ # Implementation ``` ### JavaScript/Vue (Frontend) - Use ES6+ syntax - Follow Vue.js style guide - Use composition API for new components - Keep components small and focused - Use descriptive variable names Example: ```javascript const deployVM = async (vmConfig) => { try { const response = await api.post('/vms', vmConfig) return response.data } catch (error) { console.error('Failed to deploy VM:', error) throw error } } ``` ### Bash (Scripts) - Use `#!/bin/bash` shebang - Add error checking with `set -e` where appropriate - Use meaningful variable names in UPPER_CASE - Add comments for complex logic - Quote variables to prevent word splitting ## Commit Message Format Use clear, descriptive commit messages: ``` :