Skip to content

Dobefu/go-web-starter

Repository files navigation

Go Web Starter

CI Status Quality Gate Status Coverage Go Report Card

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

  1. Clone the repository:

    git clone https://github.com/Dobefu/go-web-starter.git
    cd go-web-starter
  2. Install Go dependencies:

    go mod download
  3. Install frontend dependencies:

    bun install

Development

  1. Start the development server with live reloading:

    make dev

    Or run directly:

    go run main.go server
  2. 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.

Development Tools

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

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/cool-new-feature)
  3. Commit your changes (git commit -m 'Add a cool new feature')
  4. Push to the branch (git push origin feature/cool-new-feature)
  5. 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.

About

A starter kit to quickly start building a new website in Go

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Contributors 2

  •  
  •  

Languages