A feature-rich web forum application built with Go.
The project demonstrates clean layered architecture, server-side rendering, authentication, moderation workflows, and secure HTTP handling using the Go standard library with minimal external dependencies.
This project showcases practical Go backend development and architectural decisions commonly used in production systems.
It demonstrates:
- Layered architecture with clear separation of concerns (handler, service, repository)
- Clean dependency injection without frameworks
- Server-side rendering using Go
html/template - Authentication and authorization with session management
- OAuth 2.0 integration (Google and GitHub)
- Moderation and approval workflows
- SQLite database design with foreign key constraints
- HTTPS setup with TLS
- Dockerized deployment workflow
- User registration and authentication
- OAuth login via Google and GitHub
- Role system: user, moderator, administrator
- Post creation with categories and optional images
- Threaded comments
- Like and dislike reactions
- Post approval workflow
- Content reporting and moderation
- Notification system
- Secure sessions and CSRF protection
The application follows a layered architecture pattern:
- Handler layer: HTTP request handling, routing, and response rendering
- Service layer: business logic and use cases
- Repository layer: database access abstraction
- Entities: domain models
- UI layer: embedded HTML templates and static assets
Each layer communicates through interfaces, allowing independent testing and future replacement of implementations.
cmd/ – application entry point
internal/ – core application logic
handler/ – HTTP handlers and routing
service/ – business logic
repository/ – data access
entities/ – domain models
session/ – session management
pkg/ – reusable packages and configuration
ui/ – HTML templates and static assets
schema/ – database schema
This structure follows Go conventions and keeps implementation details encapsulated inside the internal package.
- Go 1.22
- SQLite
net/httphtml/template- OAuth 2.0
- Docker
- TLS (HTTPS)
- Go 1.22+
- Git
- SQLite
- OpenSSL
Clone the repository:
git clone https://github.com/asari92/forum
cd forumInitialize database and TLS certificates:
make initRun the server:
go run ./cmd/web/main.goThe application will be available at:
Build the image:
make buildRun the container:
make runStop the container:
make stopTechnology choices were made intentionally to emphasize core Go concepts: explicit dependency management, clear separation of concerns, and predictable HTTP and data-access flows.