Thank you for your interest in contributing! This guide will help you get started.
- Go 1.24+
- PostgreSQL 15+ (or Docker)
- Make
-
Clone the repository:
git clone https://github.com/openjobspec/ojs-backend-postgres.git cd ojs-backend-postgres -
Start PostgreSQL:
make docker-up
-
Run the server locally:
make run
-
Run tests:
make test -
Run linter:
make lint
- Create a branch from
main - Make your changes
- Ensure tests pass:
make test - Ensure linting passes:
make lint - Open a pull request
We use Conventional Commits:
type(scope): description
feat(api): add rate limiting to fetch endpoint
fix(postgres): handle null visibility_timeout in fetch
docs(readme): update configuration section
chore(deps): update pgx to v5.8.0
Types: feat, fix, docs, chore, refactor, test, perf
- Follow standard Go conventions (
gofmt,go vet) - Use
log/slogfor structured logging - Wrap errors with context:
fmt.Errorf("operation: %w", err) - Use parameterized SQL queries (never string interpolation)
- Add
defer rows.Close()after everyQuery()call
The codebase follows a layered architecture:
internal/core/- Backend-agnostic interfaces and typesinternal/api/- HTTP handlers (chi router)internal/postgres/- PostgreSQL implementation of core interfacesinternal/scheduler/- Background task schedulerinternal/server/- HTTP router and configuration
When adding a new feature, changes typically touch multiple layers.
make docker-up # Start PostgreSQL + OJS server
make docker-down # Stop everythingOpen an issue if you have questions about contributing.