Introduction
Thanks for your interest in contributing to oForum! This forum application is intentionally simple — a single Go binary, server-rendered HTML, and PostgreSQL. Contributions that keep it that way are welcome. oForum is built to be:- Easy to self-host (one binary + one database)
- Fast (pages render in milliseconds)
- Simple to understand (plain SQL, no abstractions)
- Minimal dependencies (only essential packages)
Design Principles
These principles guide all development decisions:Single Binary
Everything compiles into one executable, including migrations and templates embedded via
//go:embedZero Config
One env var (
DATABASE_URL), sensible defaults for everything else. No config files.Server-Rendered
HTML is generated on the server using Go’s
html/template. No client-side framework.Plain SQL
No ORM — just pgx and handwritten queries. Queries live in
internal/db/.Minimal Dependencies
Only Gin, pgx, bcrypt, and golang-migrate. That’s the entire dependency tree.
Fast
The binary starts in under a second. Pages should render in milliseconds.
Code Style Guidelines
Formatting
All code must passgofmt before committing:
Architecture Rules
Keep it simple. No abstractions for the sake of abstractions.
- SQL queries go in
internal/db/, not in handlers - Handlers should be thin — get data, build template data, render
- No external JavaScript — if something needs interactivity, use vanilla JS in the template
- Database changes require migration files (
upanddown)
Code Quality
Pull Request Process
Commit with Clear Message
Write a descriptive commit message explaining the “why” not just the “what”:
If your PR adds a new database field, you must include both
.up.sql and .down.sql migration files.Development Resources
Key Files
| File | Purpose |
|---|---|
main.go:273-311 | Template function registration |
main.go:322-382 | Route definitions |
internal/models/models.go | All data structures |
internal/handlers/helpers.go | Template helper functions |
internal/auth/middleware.go | Authentication middleware |
Documentation
- Development Setup — Get your local environment running
- Architecture — Understand the codebase structure
- Database — Learn the query patterns
- Templates — Work with Go templates
- Authentication — Security and sessions
What to Contribute
Good First Issues
- Documentation improvements — clarify confusing sections
- Bug fixes — fix reported issues
- Tests — add test coverage
- Template refinements — improve UI/UX
Larger Features
Before starting work on a major feature:- Open an issue to discuss the approach
- Ensure it aligns with the design principles
- Keep the PR focused and reviewable
Getting Help
If you’re stuck or have questions:- Check the CONTRIBUTING.md in the repo
- Open a GitHub issue with the
questionlabel - Review existing code in
internal/to see patterns
Ready to start? Head to Development Setup to get your environment running.