Categorygithub.com/jwzk/go-http-api-boilerplate
repository
0.0.0-20240506123410-2c5e7ab7c69b
Repository: https://github.com/jwzk/go-http-api-boilerplate.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

Go-HTTP-API-Boilerplate

Golang HTTP API Boilerplate using REST and Hexagonal architectural style and SOLID design principles.

Requirements

Development requirements

Install the mockery tool:

$ go install github.com/vektra/mockery/v2@latest

Project architecture

The project is built on top of this structure:

  • cmd: Application main
  • internal: Private application
    • adapter: Adapter layer
      • dao: Data access object layer
      • http: HTTP layer
    • domain: Domain business layer
      • model: Entity layer
      • port: Interface adapter layer
      • usecase: Application business rules layer
  • pkg: External library code

Local setup

Diplay make commands with:

$ make help

Run Go API with:

$ make run

Run Docker project with:

$ make start

Run tests with:

$ make test

Generate mocks with:

$ mockery

Access to your local service:

  • HTTP API on port :4100