Go Web Starter

[!WARNING]
This repository is still a work-in-progress
A modern, production-ready Go web application starter template with best practices and common features pre-configured. This template includes both backend (Go) and frontend (TypeScript) components.
Features
- ๐ Fast and efficient web server using Gin
- ๐ฆ Clean project structure following Go best practices
- ๐ง Live reloading for development
- ๐งช Built-in testing setup
- ๐ Code quality tools (SonarQube, ESLint, Prettier)
- ๐ CI/CD pipeline ready
- ๐ก๏ธ Security best practices
- ๐ป Modern frontend development with TypeScript and Bun
- ๐จ Consistent code formatting with Prettier
- ๐ Type safety with TypeScript
Prerequisites
- Go 1.24 or higher
- Bun (for frontend development)
- Air (optional, for live reloading)
- Make (optional, for using Makefile commands)
- Docker (optional, for containerization)
Getting Started
Installation
-
Clone the repository:
git clone https://github.com/Dobefu/go-web-starter.git
cd go-web-starter
-
Install Go dependencies:
go mod download
-
Install frontend dependencies:
bun install
Development
-
Start the development server with live reloading:
make dev
Or run directly:
go run main.go server
-
The server will start on port 4000 by default. You can change the port using the -p flag:
go run main.go server -p 8080
Testing
Run the test suite:
make test
Building
Build the application:
make build
This will build both the frontend and backend components.
Air (For live Reloading)
The project uses Air for live reloading during development. Configuration can be found in .air.toml.
Frontend Development
The frontend uses:
- TypeScript for type safety
- Bun for package management and bundling
- ESLint for code linting
- Prettier for code formatting
Make Commands
make dev: Start development server with live reloading
make build: Build the application
make test: Run tests
make lint: Run linters
make bench: Run benchmarks
make clean: Clean build artifacts
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/cool-new-feature)
- Commit your changes (
git commit -m 'Add a cool new feature')
- Push to the branch (
git push origin feature/cool-new-feature)
- Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
For support, please open an issue in the GitHub repository.