Git Product home page Git Product logo

microservices-boilerplate's Introduction

microservices-boilerplate

Microservices boilerplate built using Hexagonal architecture, DDD principles & SOLID.

It was built in a Monorepo structure where all the services are part of a big repository, even though they're still running independently.

Application Guide

This project has been automated with Makefile to simplify the configuration and how to run the services. To execute the functions bellow, it's required that you CD at the project root folder -> microservices-boilerplate.

Installation

The application depends on Kong API Gateway to manage the microservices. It's important to configure everything before executing the API itself. Spoiler: Kong will take care of the service discovery, defining routes and set a JWT
authentication method.

To install and configure the app, run make install.

Running API

This command will start the API by executing the docker-compose files. Make sure you have installed the application before executing the running step.

To execute the app, run make run.

You can run make stop to stop the application and shut down the docker containers.

Running Tests

This command executes all test cases in coverage mode and generates an HTML page with the output. The files generated with this command will be at test/coverage.

Run make tests to execute all tests.

Dependencies Packages

Tests

Ginkgo: Test Framework

Ref: https://github.com/onsi/ginkgo/v2

Gomega: Assertion

Ref: https://github.com/onsi/gomega

Mocks

Testify: Mocks implementation

Ref: https://github.com/stretchr/testify

Vektra Mockery: Mocks Generator

Ref: https://github.com/vektra/mockery

GORM

Entities & DB operations

Ref: https://gorm.io/

Redis

Cache management

Ref: https://github.com/gomodule/redigo/redis

UUID

Secure ID generator

Ref: https://github.com/satori/go.uuid

Cors Middleware

Enable API to external origins

Ref: https://github.com/itsjamie/gin-cors

Observability

Application monitoring using Prometheus and Grafana

Ref: https://grafana.com/ Ref: https://prometheus.io/

API Documentation

Gin-Swagger: Swagger API Definitions

Ref: https://github.com/swaggo/gin-swagger

Swaggo Files: Doc files manager

Ref: https://github.com/swaggo/files

Swaggo: Doc Generator

Ref: https://github.com/swaggo/swag

API Doc: ${service_host}/swagger/index.html

Application High Level Architecture

Microservices Boilerplate drawio (1)

microservices-boilerplate's People

Contributors

felipeaz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.