Contributing to Arches
Thank you for your interest in contributing to Arches! This document provides guidelines and instructions for contributing to the project.
Code of Conduct
By participating in this project, you agree to abide by our Code of Conduct:
- Be respectful: Treat all contributors with respect
- Be constructive: Provide helpful feedback and suggestions
- Be inclusive: Welcome contributors of all backgrounds and experience levels
- Be professional: Keep discussions focused on the project
Getting Started
Prerequisites
Before contributing, ensure you have:
- Go 1.21+ installed
- PostgreSQL 15+ with pgvector extension
- Node.js 20+ and pnpm 8+
- Git configured with your GitHub account
- Make installed for running build commands
Setting Up Your Development Environment
-
Fork the repository on GitHub
-
Clone your fork:
Code -
Add upstream remote:
Code -
Set up the project:
Code -
Verify setup:
Code
Development Workflow
Branch Naming
Use descriptive branch names:
feature/add-webhook-support
fix/auth-token-expiry
docs/update-api-guide
refactor/optimize-queries
test/add-workflow-tests
Making Changes
-
Create a branch:
Code -
Make your changes following our coding standards
-
Generate code if needed:
Code -
Run tests:
Code -
Lint your code:
Code -
Format your code:
Code -
Commit your changes:
Code
Commit Message Format
We follow Conventional Commits:
Code
Types:
feat
: New featurefix
: Bug fixdocs
: Documentation changesstyle
: Code style changes (formatting, etc.)refactor
: Code refactoringtest
: Adding or updating testschore
: Maintenance tasksperf
: Performance improvements
Examples:
Code
Submitting a Pull Request
-
Push to your fork:
Code -
Create a Pull Request on GitHub
-
Fill out the PR template with:
- Description of changes
- Related issue numbers
- Testing performed
- Screenshots (if UI changes)
-
Wait for review - maintainers will review your PR
-
Address feedback - make requested changes and push updates
Coding Standards
Go Code
- Follow Effective Go guidelines
- Use
gofmt
for formatting - Write descriptive variable and function names
- Add comments for exported functions
- Handle errors explicitly
- Use interfaces for dependency injection
- Write table-driven tests
Example:
Code
TypeScript/React Code
- Use TypeScript for all new code
- Follow React best practices and hooks
- Use functional components
- Implement proper error boundaries
- Write meaningful component and prop names
- Add JSDoc comments for complex functions
Example:
Code
SQL Queries
- Use lowercase for SQL keywords
- Use snake_case for column names
- Add comments for complex queries
- Use parameterized queries (never concatenate)
- Follow SQLC conventions
Example:
Code
API Design
- Follow RESTful principles
- Use proper HTTP status codes
- Implement pagination for list endpoints
- Use consistent error responses
- Document all endpoints in OpenAPI
Testing Guidelines
Go Tests
Write table-driven tests:
Code
TypeScript Tests
Use Vitest for unit tests:
Code
Documentation
Code Documentation
- Add package-level documentation
- Document all exported functions and types
- Include examples for complex functionality
- Keep documentation up to date with code changes
README Updates
Update the README when:
- Adding new features
- Changing setup procedures
- Modifying configuration options
- Adding new dependencies
API Documentation
- Update OpenAPI spec for API changes
- Add x-codegen annotations for code generation
- Include request/response examples
- Document error responses
- Add descriptions for all parameters
- Define repository operations needed
Architecture Guidelines
Hexagonal Architecture
Follow the hexagonal architecture pattern:
-
Domain Layer (Core):
- Business logic
- Domain entities
- Use cases
- Port interfaces
-
Infrastructure Layer (Adapters):
- Database implementations
- External service clients
- File system operations
-
Application Layer (Handlers):
- HTTP handlers
- Middleware
- Request/response mapping
Adding New Features
When adding a new feature:
- Define the API in
api/openapi.yaml
with x-codegen annotations - Create database migration if needed
- Write SQL queries in
queries/
for complex operations - Generate code:
make generate
(creates repository, service, server) - Implement business logic in
service.go
- Wire dependencies in application bootstrap
- Write tests using generated mocks
- Update documentation
The unified code generator handles most boilerplate:
- Repository interfaces and implementations (PostgreSQL/SQLite)
- Service interfaces and HTTP servers
- Test mocks for all interfaces
- Type definitions from OpenAPI
Review Process
What We Look For
- Code quality: Clean, maintainable, efficient code
- Tests: Adequate test coverage for new functionality
- Documentation: Clear comments and updated docs
- Architecture: Follows project patterns and conventions
- Performance: No significant performance regressions
- Security: No security vulnerabilities introduced
Review Timeline
- Initial review: Within 2-3 business days
- Follow-up reviews: Within 1-2 business days
- Small fixes: Usually same day
Getting Help
Resources
Communication
- GitHub Issues: Bug reports and feature requests
- GitHub Discussions: General questions and discussions
- Pull Requests: Code contributions and reviews
Release Process
Versioning
We use Semantic Versioning:
- MAJOR: Breaking changes
- MINOR: New features (backward compatible)
- PATCH: Bug fixes (backward compatible)
Release Cycle
- Patch releases: As needed for critical fixes
- Minor releases: Monthly
- Major releases: Quarterly or as needed
Recognition
Contributors are recognized in:
- Release notes
- Contributors file
- Project documentation
Thank you for contributing to Arches! Your efforts help make the project better for everyone.