Skip to content

nghiack7/goforge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoForge

Scaffold production-ready Go services in seconds.

Install

go install github.com/nghiack7/goforge@latest

Usage

Create a new project

# REST API (default)
goforge new myapi

# gRPC service
goforge new myservice --template grpc

# Background worker
goforge new myworker --template worker

List available templates

goforge list

Templates

Template Description
rest-api REST API with health check, graceful shutdown, structured logging, Dockerfile, Makefile
grpc gRPC service with health check, proto scaffold, graceful shutdown, Dockerfile
worker Background worker with ticker loop, health endpoint, graceful shutdown, Dockerfile

What's included in every template

  • Structured logging (log/slog with JSON output)
  • Graceful shutdown (SIGINT/SIGTERM handling)
  • Health check endpoint
  • Dockerfile (multi-stage build)
  • Makefile (build, run, test, lint, docker)
  • .gitignore

Generated project structure (REST API)

myapi/
├── main.go                    # Entry point with graceful shutdown
├── go.mod
├── Dockerfile
├── Makefile
├── .gitignore
└── internal/
    ├── config/
    │   └── config.go          # Environment-based configuration
    └── handler/
        └── handler.go         # HTTP handlers with health check

Development

git clone https://github.com/nghiack7/goforge.git
cd goforge
go build ./...
go test ./... -v -race

License

MIT

About

Scaffold production-ready Go services in seconds

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors