Thank you for considering contributing to SereniBase! This document provides guidelines and instructions for contributing to the project.
- Code of Conduct
- Getting Started
- Development Setup
- Making Changes
- Pull Request Process
- Coding Standards
- Testing
- Documentation
- Community
This project adheres to a Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to support@aptlogica.com.
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR-USERNAME/sereni-base.git cd sereni-base - Add the upstream remote:
git remote add upstream https://github.com/aptlogica/sereni-base.git
- Create a branch for your changes:
git checkout -b feature/your-feature-name
- Go 1.24 or later
- Docker and Docker Compose
- PostgreSQL 15+ (or use Docker)
- Make
-
Copy the environment template:
cp .env.example .env
-
Update
.envwith your configuration -
Start dependencies:
docker-compose up -d postgres minio
-
Run the application:
make run
-
Run tests:
make test
Use descriptive branch names following these patterns:
feature/<description>- New featuresfix/<description>- Bug fixesdocs/<description>- Documentation changesrefactor/<description>- Code refactoringtest/<description>- Test additions or changeschore/<description>- Maintenance tasks
We follow Conventional Commits:
<type>(<scope>): <description>
[optional body]
[optional footer(s)]
Types:
feat: New featurefix: Bug fixdocs: Documentation onlystyle: Formatting, missing semicolons, etc.refactor: Code change that neither fixes a bug nor adds a featureperf: Performance improvementtest: Adding or updating testsbuild: Build system or external dependenciesci: CI configuration fileschore: Other changes that don't modify src or test files
Examples:
feat(auth): add password reset functionality
fix(api): handle nil pointer in user handler
docs(readme): update installation instructions
-
Update your fork with the latest upstream changes:
git fetch upstream git rebase upstream/main
-
Ensure your changes pass all checks:
make lint make test -
Push your branch:
git push origin feature/your-feature-name
-
Create a Pull Request on GitHub with:
- Clear title following commit conventions
- Description of changes
- Link to related issues
- Screenshots for UI changes
-
Address review feedback promptly
-
Squash commits if requested before merge
- Code follows the project's coding standards
- Tests added/updated for changes
- Documentation updated if needed
- All CI checks pass
- No merge conflicts with main
- Follow Effective Go
- Use
gofmtfor formatting (enforced by CI) - Run
golangci-lintbefore committing - Keep functions small and focused
- Use meaningful variable and function names
- Add comments for exported functions and types
sereni-base/
├── cmd/server/ # Application entry point
├── internal/ # Private application code
│ ├── app/ # Application setup
│ ├── config/ # Configuration
│ ├── handlers/ # HTTP handlers
│ ├── middleware/ # HTTP middleware
│ ├── models/ # Data models
│ ├── services/ # Business logic
│ └── utils/ # Utilities
├── tests/ # Test files
└── docs/ # Documentation
- Always check and handle errors
- Use custom error types for domain errors
- Include context in error messages
- Log errors with appropriate levels
# Run all tests
make test
# Run with coverage
make test-coverage
# Run specific package tests
go test -v ./internal/handlers/...- Place tests in
tests/directory mirroringinternal/structure - Use table-driven tests where appropriate
- Mock external dependencies
- Aim for >80% coverage on new code
- Include both positive and negative test cases
func TestFunctionName_Scenario_ExpectedBehavior(t *testing.T)- Update README.md for user-facing changes
- Add/update API documentation in
docs/ - Include code comments for complex logic
- Update CHANGELOG.md for notable changes
We use Swagger/OpenAPI for API documentation:
make swagger- Open an issue for bugs or feature requests
- Use discussions for questions
- Check existing issues before creating new ones
Contributors will be recognized in:
- CONTRIBUTORS.md
- Release notes
- Project documentation
By contributing, you agree that your contributions will be licensed under the Apache License, Version 2.0.
Thank you for contributing to SereniBase! ainer must approve before merging.