go-project-template

command module
v0.0.0-...-a6b1af2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

README

Contributors Forks Stargazers Issues Apache License Go


Logo

go-project-template

Opinionated Go service template with Fiber API, OpenAPI docs, Telegram bot wiring, health endpoints, and Fx-based modular DI.
Explore the docs »

Report Bug · Request Feature

About The Project

This repository is a production-oriented starter for backend services in Go. It ships with:

  • HTTP server bootstrapped with Fiber and dependency injection via Uber Fx.
  • Version + health endpoints using healthfx.
  • Swagger/OpenAPI docs endpoint under /api/v1/docs.
  • Telegram bot integration (/start command handler included).
  • Modular business domain example to plug in real use-cases.

Use this template when you want a fast path to shipping APIs and bot workflows with a clean module layout.

(back to top)

Built With

  • Go
  • Fiber
  • Fx
  • Swagger
  • Telegram

(back to top)

Getting Started

Follow these steps to run the service locally.

Prerequisites

  • Go 1.25+
    go version
    
  • golangci-lint (optional but recommended)
    golangci-lint version
    
  • swag CLI for docs generation
    go install github.com/swaggo/swag/cmd/swag@latest
    

Installation

  1. Clone the repo.
    git clone https://github.com/capcom6/go-project-template.git
    cd go-project-template
    
  2. Download dependencies.
    make deps
    
  3. (Optional) Generate OpenAPI docs.
    make gen
    
  4. Build the binary.
    make build
    

(back to top)

Usage

Run the app:

go run .

Or use live reload:

make air

Default server address is 127.0.0.1:3000.

Helpful endpoints:

  • Health endpoints (via healthfx), typically under /health.
  • OpenAPI docs: http://127.0.0.1:3000/api/v1/docs.

Configuration:

  • Environment variables are loaded via go-core-fx/config.
  • You can point to a YAML file using:
    export CONFIG_PATH=./config.local.yaml
    
  • Telegram token is configured via the app config (telegram.token) and required to use bot handlers.

Quality checks:

make fmt
make lint
make test
make coverage

(back to top)

Roadmap

  • Fiber API scaffold
  • OpenAPI + Swagger integration
  • Telegram bot wiring
  • Database module integration
  • Auth middleware and RBAC
  • CI release pipeline hardening

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the Apache 2.0 License. See LICENSE for more information.

(back to top)

Contact

Maintainer: @capcom6

Project Link: https://github.com/capcom6/go-project-template

(back to top)

Acknowledgments

(back to top)

Documentation

Overview

Golang project template

@title			Project API
@version		1.0.0
@description	Project API documentation

@contact.name	API Support
@contact.url	https://github.com/capcom6
@contact.email	i@capcom.me

@license.name	Apache 2.0
@license.url	http://www.apache.org/licenses/LICENSE-2.0.html

@host			localhost:3000
@BasePath		/api/v1

Directories

Path Synopsis
bot
example
Package example provides a demonstration of a well-structured Go module using the Uber FX framework for dependency injection.
Package example provides a demonstration of a well-structured Go module using the Uber FX framework for dependency injection.
server/docs
Package docs Code generated by swaggo/swag.
Package docs Code generated by swaggo/swag.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL