Prerequisites
Before you begin, ensure you have:Go 1.25+
Download from go.dev
PostgreSQL
Running locally or accessible via connection string
Git
For version control
make (optional)
For using Makefile commands
Initial Setup
Configure Environment
Copy the example environment file and edit if needed:Default
.env contents:If your PostgreSQL uses different credentials, update
DATABASE_URL accordingly:Open in Browser
Navigate to http://localhost:8080
Create Test Admin User
You’ll need an admin account to access the admin panel.- Using Seed Data
- Manual Promotion
The quickest way is to seed demo data:This creates:
- 30 users (first user “alice” is admin)
- 50 posts with varied content
- 200 comments in threaded discussions
- 300 upvotes distributed across content
Hot Reload Development
For faster development, use air to auto-restart the server on file changes:With
air running, changes to templates and handlers take effect immediately without manual restart.Common Development Commands
Using Make
Manual Commands
Running Tests
oForum includes tests for core functionality:Database Management
Reset Database
To start fresh during development:Inspect Database
Troubleshooting
”Failed to connect to database”
-
Ensure PostgreSQL is running:
-
Check your
DATABASE_URLin.env -
Verify database exists:
“Migration failed”
- Ensure no other instance is running
- Check migration files in
migrations/are numbered sequentially - Reset the database if needed
Port Already in Use
Change the port in.env:
Next Steps
Understand Architecture
Learn how the codebase is structured
Work with Database
Explore query patterns and migrations
Edit Templates
Modify the UI and template functions
Authentication Flow
Understand security and sessions