golang-integration-sample

command module
v0.0.0-...-844d4e4 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

README

golang-integration-sample

A sample production grade REST API application written in Golang with simple twilio integrations and other functionalities but have all non-functional areas covered up.

  • Microservices
  • Docker Containers
  • REST Api + GRPC for internal Communication
  • Distributed logging
  • Distributed tracing
  • Monitoring (grafana + Prometheus)
  • Performance analysis(pprof + benchmark testing + autocannon)
  • SQL database with Auto Migration and Seeding
  • Debugging capacity with inspector
  • Load .env files for configuration settings
  • 80% Unit testing coverage
  • Mocks (mockery)
  • Swagger OpenApi & Markdown Docs
  • ThunderClient requests for Testing APIs
  • Makefile
  • Docker-Compose for local running
  • Enforcing Coding standards with https://github.com/tekwizely/pre-commit-golang

TODO: AWS Cloud Specifics

  • NoSql database
  • S3 Storage
  • AWS SnS/SQS
  • ngrok for local dev testing
  • Configurations management using SOPs & AWS KMS

Generate Swagger documentation for the Server

  • Run command make generate

Test Application Server

  • Run command make test

Build Application Server

  • Run command make build

Run Application Server

  • Run command make run

Reload Application Server

  • Run command make reload
When we run above run or reload command, the db container and app container will be up and running then we can access APIs provided by the App
  • The terminal shell looks like this alt

  • The Swagger OpenAPI docs will be generated dynamically for the APIS like this alt

  • The swagger documentation UI will be available at http://localhost:8080/swagger/index.html alt

  • The PProf will be avilable at http://localhost:8080/debug/pprof alt

  • The Inspector UI will be available at http://localhost:8080/_inspector alt

  • The metrics api will be available at http://localhost:8080/metrics alt

  • The Logs terminal will be available on local machine and can be setup to sync with remote storage alt

  • The Newrelic UI will look like this alt

  • The Thunder-Client dashboard will look like this alt

  • The docker state will look like this alt

  • The Coding standard will be enforeced while commiting the code to the repository alt alt

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
app/usecases/diner
Package diner provides the use case for diner
Package diner provides the use case for diner
app/usecases/menu
Package menu provides the use case for menu
Package menu provides the use case for menu
app/usecases/message
Package message provides the use case for message
Package message provides the use case for message
app/usecases/order
Package order provides the use case for order
Package order provides the use case for order
app/usecases/verify
Package verify provides the use case for verify
Package verify provides the use case for verify
domain/diner
Package diner contains the business logic for the diner entity
Package diner contains the business logic for the diner entity
domain/errors
Package errors defines the domain errors used in the application.
Package errors defines the domain errors used in the application.
domain/menu
Package menu contains the business logic for the menu entity
Package menu contains the business logic for the menu entity
domain/message
Package message contains the business logic for the message entity
Package message contains the business logic for the message entity
domain/order
Package order contains the business logic for the order entity
Package order contains the business logic for the order entity
domain/verify
Package verify contains the business logic for the verify entity
Package verify contains the business logic for the verify entity
infrastructure/mocks/repository
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
infrastructure/repository/diner
Package diner contains the repository implementation for the diner entity
Package diner contains the repository implementation for the diner entity
infrastructure/repository/menu
Package menu contains the repository implementation for the menu entity
Package menu contains the repository implementation for the menu entity
infrastructure/repository/order
Package order contains the repository implementation for the order entity
Package order contains the repository implementation for the order entity
infrastructure/rest/adapter
Package adapter is a layer that connects the infrastructure with the application layer
Package adapter is a layer that connects the infrastructure with the application layer
infrastructure/rest/controllers
Package controllers contains the common functions and structures for the controllers
Package controllers contains the common functions and structures for the controllers
infrastructure/rest/controllers/diner
Package diner contains the diner controller
Package diner contains the diner controller
infrastructure/rest/controllers/errors
Package errors contains the error handler controller
Package errors contains the error handler controller
infrastructure/rest/controllers/menu
Package menu contains the menu controller
Package menu contains the menu controller
infrastructure/rest/controllers/message
Package message contains the message controller
Package message contains the message controller
infrastructure/rest/controllers/order
Package order contains the order controller
Package order contains the order controller
infrastructure/rest/controllers/verify
Package verify contains the verify controller
Package verify contains the verify controller
infrastructure/rest/middlewares
Package middlewares contains the middlewares for the rest api
Package middlewares contains the middlewares for the rest api
infrastructure/rest/routes
Package routes contains all routes of the application
Package routes contains all routes of the application

Jump to

Keyboard shortcuts

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