Skip to content

Web API developed in Golang, structured with a focus on scalability, testability and modularity. An API is designed based on Clean Architecture and Domain-Driven Design (DDD) concepts, which allows a clear separation of responsibilities and facilitates the maintenance and expansion of the application.

Notifications You must be signed in to change notification settings

dev-jpnobrega/webapi-go

Repository files navigation

Example API REST in GO

The implementation using ECHO web framework

Install "GO"

How do I use

  • Clone repository
 go mod download
  • Migration system
    Migrations will executation with gormigrate.
    gormigrate working together gorm for execute migrations

    • Execute initial migrations

      go run run-migrations.go
    • Create a new migration
      You'll add a new file in folder /migration. File name will migration id.

  • Run app

    • In terminal

      go run src/main.go
    • Or application Debugging for VSCODE.
      Install extension golang for VSCODE. In launch.json set your envs.
      Click F5 and add your breakpoints.

    • Or run in docker.
      Docker compose will create postgres db and its application.

      docker-compose up
  • Run Unit tests

    • In terminal
      go test  ./test/unit/... -race -covermode=atomic  -v -coverpkg=./src/... -coverprofile=coverage.out
  • Run Integration tests

    • In terminal
      go test  ./test/integration/... -race -covermode=atomic  -v -coverpkg=./src/... -coverprofile=coverage.out
  • Run All tests

    • In terminal
      go test  ./test/... -race -covermode=atomic  -v -coverpkg=./src/... -coverprofile=coverage.out
  • Export (HTML) collection coverage

    • In terminal
      go tool cover -html=coverage.out -o=coverage.html

Contributing

If you've ever wanted to contribute to open source, and a great cause, now is your chance!

See the contributing docs for more information

Contributors ✨


JP. Nobrega

💬 📖 👀 📢

License

MIT

About

Web API developed in Golang, structured with a focus on scalability, testability and modularity. An API is designed based on Clean Architecture and Domain-Driven Design (DDD) concepts, which allows a clear separation of responsibilities and facilitates the maintenance and expansion of the application.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published