A complete overhaul of a legacy forum, architected from the ground up as a modern, high-performance web application. This project uses a modular Golang backend and a server-rendered React frontend to deliver a fast, scalable, and developer-friendly experience.
- π¨ Modern, Responsive UI: Built with Tailwind CSS for a utility-first design that is fast and looks great on all devices
- β‘ Optimized for Performance & SEO: Leverages Next.js for Server-Side Rendering (SSR), ensuring fast initial page loads and excellent search engine visibility
- π‘οΈ Robust Backend: Engineered with a modular, RESTful API in Golang using the Gin framework for high-performance routing
- π Type-Safe Database Interaction: Utilizes GORM to interact with a PostgreSQL database, providing type safety and preventing common SQL injection vulnerabilities
- π Secure Authentication: Implements a secure user registration and login system using JWT (JSON Web Tokens)
| Area | Technology |
|---|---|
| Frontend | React, Next.js, Tailwind CSS |
| Backend | Golang, Gin, GORM |
| Database | PostgreSQL |
| Dev & Deploy | Docker, Docker Compose |
This project is structured as a monorepo to keep the frontend and backend code in a single, easy-to-manage repository.
geekhack-reimagined/
βββ .github/ # GitHub Actions workflows
βββ backend/ # Golang REST API
β βββ cmd/ # Main application entry point
β βββ internal/ # Private application logic (handlers, services, repos)
β βββ pkg/ # Public library code
β βββ Dockerfile # Backend Docker image definition
β βββ go.mod # Go module dependencies
βββ frontend/ # Next.js Web Application
β βββ app/ # Next.js App Router structure
β βββ components/ # Reusable React components
β βββ lib/ # Helper functions, API clients
β βββ public/ # Static assets
β βββ Dockerfile # Frontend Docker image definition
βββ docker-compose.yml # Local development environment setup
βββ .env.example # Example environment variables
βββ README.md # This file
Follow these instructions to get the project up and running on your local machine for development and testing purposes.
You must have the following software installed on your machine:
- Go (v1.18+)
- Node.js (v18+)
- Docker & Docker Compose
Clone the repository:
git clone https://github.com/AlanKha/GeekHack-Reimagined.git
cd GeekHack-ReimaginedConfigure Environment Variables:
Create a .env file in the project root by copying the example file. This file will be used by Docker Compose to configure all services.
cp .env.example .envNow, open the .env file and fill in the values. The defaults are suitable for local development.
Build and Run with Docker Compose:
This single command will build the Docker images for the frontend and backend, start the PostgreSQL database container, and run the entire application.
docker-compose up --buildYou should now be able to access:
- Frontend Application: http://localhost:3000
- Backend API: http://localhost:8080
This is the development plan. Check off items as they are completed.
- Initialize Git repository
- Set up monorepo folder structure (frontend, backend)
- Create initial docker-compose.yml for local development
- Create .env.example with necessary variables (DB credentials, ports, JWT secret)
- Write initial README.md file
- Initialize Go module in
/backend - Integrate Gin for routing
- Set up GORM and establish a database connection module
- Database Design: Define GORM models for User, Thread, and Post
- Implement GORM AutoMigrate to create tables on startup
-
/registerendpoint (hash password before saving) -
/loginendpoint (verify credentials, issue JWT) - JWT authentication middleware to protect routes
-
POST /api/threads(Create, protected) -
GET /api/threads(Read all) -
GET /api/threads/:id(Read one) -
PUT /api/threads/:id(Update, protected) -
DELETE /api/threads/:id(Delete, protected)
-
POST /api/threads/:id/posts(Create, protected) -
GET /api/posts/:id(Read one, likely not needed) -
PUT /api/posts/:id(Update, protected) -
DELETE /api/posts/:id(Delete, protected) -
Implement robust error handling and standardized JSON responses
-
Set up basic unit tests for service logic
- Initialize Next.js project in
/frontendwith TypeScript and Tailwind CSS
- Build reusable UI components (Button, Input, Card, Navbar)
- API Client: Create a library in
/lib/api.tsto handle all fetch requests to the backend
- Create main application layout with Navbar and Footer
- Build Homepage (
/) to fetch and display all threads - Build
/loginand/registerpages with forms
- Build Thread Detail page (
/thread/[id]) to fetch and display a single thread and its posts
- Create a React Context for managing authentication state
- On login, store JWT securely (HttpOnly cookie)
- Create protected routes/components that are only visible to logged-in users
- Build form for creating new threads
- Build form for creating new posts/replies within a thread
- Implement logic for updating/deleting threads and posts
- Create a production-ready Dockerfile for the Go backend (multi-stage build)
- Create a production-ready Dockerfile for the Next.js frontend
- Provision a managed PostgreSQL instance (e.g., AWS RDS, Google Cloud SQL)
- Set up a container registry (e.g., Docker Hub, Google Artifact Registry)
- Write deployment scripts/configuration for a cloud provider (e.g., cloudbuild.yaml for Google Cloud Run)
- Deploy backend and frontend services
- Configure DNS and secure with SSL/TLS
- User Profiles
- Markdown support for posts with preview
- Pagination for threads and posts
- Full-text search functionality
- Admin roles and moderation tools
- Backend: Implement Redis for caching frequently accessed data (e.g., threads, posts) to reduce database load and improve API response times.
- Frontend: Integrate Redux Toolkit for more robust and scalable state management, particularly for handling user authentication and caching fetched data.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with β€οΈ using modern web technologies
- Inspired by the original GeekHack forum community