diff --git a/.github/CODEOWNERS.md b/.github/CODEOWNERS.md new file mode 100644 index 0000000..0d1d49d --- /dev/null +++ b/.github/CODEOWNERS.md @@ -0,0 +1,40 @@ + +# Code Owners for Aurganize V6.2 +# +# These owners will be automatically requested for review +# when someone opens a pull request. +# +# Format: path/pattern @github-username + +# Default owners for everything +* @developer1 @developer2 + +# Backend code +/backend/ @developer1 +/backend/internal/handlers/ @developer1 +/backend/internal/services/ @developer1 +/backend/internal/repositories/ @developer1 + +# Frontend code +/frontend/ @developer2 +/frontend/src/routes/ @developer2 +/frontend/src/lib/components/ @developer2 + +# Infrastructure requires both reviewers +/infrastructure/ @developer1 @developer2 +/docker-compose.yml @developer1 @developer2 + +# Database migrations require backend lead +/backend/migrations/ @developer1 + +# Documentation can be reviewed by anyone +/docs/ @developer1 @developer2 + +# CI/CD workflows require both +/.github/workflows/ @developer1 @developer2 + +# Package files require review +/backend/go.mod @developer1 +/backend/go.sum @developer1 +/frontend/package.json @developer2 +/frontend/package-lock.json @developer2 \ No newline at end of file diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..1665750 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,250 @@ +# Contributing to Aurganize V6.2 + +Thank you for contributing to Aurganize! This document provides guidelines and instructions for contributing to the project. + +## 📋 Table of Contents + +- [Code of Conduct](#code-of-conduct) +- [Getting Started](#getting-started) +- [Development Workflow](#development-workflow) +- [Coding Standards](#coding-standards) +- [Commit Message Guidelines](#commit-message-guidelines) +- [Pull Request Process](#pull-request-process) +- [Testing Requirements](#testing-requirements) + +## 🤝 Code of Conduct + +- Be respectful and inclusive +- Provide constructive feedback +- Accept constructive criticism gracefully +- Focus on what is best for the project + +## 🚀 Getting Started + +1. **Fork the repository** +2. **Clone your fork:** +```bash + git clone https://github.com/YOUR_USERNAME/aurganize-v62.git + cd aurganize-v62 +``` +3. **Add upstream remote:** +```bash + git remote add upstream https://github.com/yourorg/aurganize-v62.git +``` +4. **Setup development environment:** Follow [README.md](README.md) + +## 🔄 Development Workflow + +### 1. Sync with Upstream +```bash +git checkout develop +git fetch upstream +git merge upstream/develop +git push origin develop +``` + +### 2. Create Feature Branch +```bash +# Branch from develop +git checkout develop +git checkout -b feature/your-feature-name +``` + +**Branch naming conventions:** +- `feature/` - New features +- `bugfix/` - Bug fixes +- `hotfix/` - Urgent production fixes +- `refactor/` - Code refactoring +- `docs/` - Documentation changes +- `test/` - Adding/improving tests + +### 3. Make Changes + +- Write code following our [coding standards](#coding-standards) +- Write/update tests +- Update documentation if needed +- Test locally before committing + +### 4. Commit Changes +```bash +git add . +git commit -m "feat: add user authentication" +``` + +See [commit message guidelines](#commit-message-guidelines) below. + +### 5. Push to Your Fork +```bash +git push origin feature/your-feature-name +``` + +### 6. Create Pull Request + +- Go to GitHub repository +- Click "New Pull Request" +- Select your feature branch +- Fill out PR template completely +- Request review from team members + +## 📝 Coding Standards + +### Go (Backend) + +**Style Guide:** +- Follow [Effective Go](https://golang.org/doc/effective_go) +- Use `gofmt` for formatting +- Use `golangci-lint` for linting + +**File Organization:** +```go +package handlers + +// Imports grouped and sorted +import ( + "context" + "fmt" + + "github.com/labstack/echo/v4" + + "github.com/yourorg/aurganize-v62/backend/internal/models" +) + +// Constants first +const ( + DefaultTimeout = 30 * time.Second +) + +// Types next +type AuthHandler struct { + service *services.AuthService +} + +// Constructor +func NewAuthHandler(service *services.AuthService) *AuthHandler { + return &AuthHandler{service: service} +} + +// Methods +func (h *AuthHandler) Login(c echo.Context) error { + // Implementation +} +``` + +**Naming Conventions:** +- **Packages:** lowercase, single word (e.g., `handlers`) +- **Files:** lowercase, underscore-separated (e.g., `auth_handler.go`) +- **Functions:** PascalCase for exported, camelCase for private +- **Variables:** camelCase +- **Constants:** PascalCase or SCREAMING_SNAKE_CASE for globals + +**Error Handling:** +```go +// Always check errors +result, err := someFunction() +if err != nil { + return fmt.Errorf("failed to do something: %w", err) +} + +// Use %w to wrap errors (enables errors.Is and errors.As) +``` + +**Comments:** +```go +// Package-level comment +// package handlers provides HTTP request handlers for the API. +package handlers + +// Exported functions must have doc comments +// Login handles user authentication requests. +// It validates credentials and returns a JWT token. +func Login(c echo.Context) error { + // Implementation comments for complex logic + // ... +} +``` + +### TypeScript (Frontend) + +**Style Guide:** +- Follow [TypeScript Style Guide](https://google.github.io/styleguide/tsguide.html) +- Use ESLint and Prettier (configured) + +**File Organization:** +```typescript +// Imports +import type { User } from '$lib/types'; +import { authStore } from '$lib/stores/auth'; + +// Types/Interfaces +interface LoginForm { + email: string; + password: string; +} + +// Constants +const MAX_LOGIN_ATTEMPTS = 5; + +// Functions +export async function login(form: LoginForm): Promise { + // Implementation +} +``` + +**Naming Conventions:** +- **Files:** kebab-case (e.g., `auth-service.ts`) +- **Components:** PascalCase (e.g., `LoginForm.svelte`) +- **Functions:** camelCase +- **Constants:** SCREAMING_SNAKE_CASE +- **Types/Interfaces:** PascalCase + +**Svelte Components:** +```svelte + + +
+ +
+ + +``` + +### SQL (Database) + +**Style:** +- Keywords in UPPERCASE +- Table/column names in lowercase with underscores +- Indent for readability +```sql +-- Good +SELECT + u.id, + u.email, + t.name AS tenant_name +FROM users u +INNER JOIN tenants t ON u.tenant_id = t.id +WHERE u.is_active = TRUE +ORDER BY u.created_at DESC; + +-- Bad +select u.id, u.email, t.name from users u join tenants t on u.tenant_id=t.id where u.is_active=true; +``` + +## 💬 Commit Message Guidelines + +We follow [Conventional Commits](https://www.conventionalcommits.org/). + +### Format \ No newline at end of file