Giter Site home page Giter Site logo

hexolan / stocklet Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 174 KB

An event-driven microservice e-commerce example application

License: GNU Affero General Public License v3.0

Makefile 0.14% Dockerfile 1.30% Go 98.57%
debezium demo docker event-driven golang grpc grpc-gateway kafka microservices monorepository opentelemetry protocol-buffers sagas swagger api-gateway jwt envoy

stocklet's Introduction

Stocklet

An event-driven microservices-based distributed e-commerce example application written in Golang. (mouthful)

๐Ÿ“˜ About

This project was originally built as an experiment with event-driven architecture. But I hope it can future serve as a beneficial demonstration of utilising the architecture and exemplify the implementation of some other miscellaneous microservice patterns.

Any ideas, suggestions or direct contributions to better conform with general and evolving industry practices are welcome and will be greatly appreciated, as I'd like for this project to evolve to the stage of being somewhat a reflection of a production-ready enterprise application.

โš ๏ธ The application should be considered in the experimental prototype stage. Breaking changes can be expected between any future commits to this repo, in order to ease the development process and allow for clean refactoring of the project.

๐Ÿ“ Features

  • Monorepository layout
  • Microservice architecture
  • Event-driven architecture
  • Interfacing with services using gRPC
  • User-facing RESTful HTTP APIs with gRPC-Gateway
  • Distributed tracing with OpenTelemetry
  • Transactional outbox pattern with Debezium
  • API gateway pattern using Envoy
  • Distributed transactions utilising the saga pattern

๐Ÿ—ƒ๏ธ Architecture

๐Ÿ”Ž Overview

Architecture Overview

๐Ÿงฐ Technical Stack

Libraries, Frameworks and Tools

Infrastructure

๐Ÿงฉ Services

Name gRPC (w/ Gateway) Produces Events Consumes Events
auth โœ”๏ธ โŒ โœ”๏ธ
order โœ”๏ธ โœ”๏ธ โœ”๏ธ
payment โœ”๏ธ โœ”๏ธ โœ”๏ธ
product โœ”๏ธ โœ”๏ธ โœ”๏ธ
shipping โœ”๏ธ โœ”๏ธ โœ”๏ธ
user โœ”๏ธ โœ”๏ธ โŒ
warehouse โœ”๏ธ โœ”๏ธ โœ”๏ธ

Each service is prepared by a service-init container; a deployment responsible for performing any database migrations and configuring Debezium outbox connectors for that service.

๐Ÿ“‡ Events

The events are schemed and serialised using protocol buffers. They are dispatched using the transactional outbox pattern, with Debezium used as a relay to read and publish events from database outbox tables to the message broker.

Further documentation on the events can be found at /docs/EVENTS.md

๐Ÿ’ป Deployment

Using Docker

The application can be deployed using Docker Compose (with the compose files located in /deploy/docker/). Ensure the correct configuration is in place by copying and removing .example from the end of the example environment files located in /deploy/configs/.

Deploy using the following command: docker compose -f deploy/docker/compose.yaml -f deploy/docker/compose.override.yaml up --build

๐Ÿงช Contributing

If you like this project then please leave a โญ to show your support. All forms of feedback and contributions are welcome and greatly appreciated!

Have any ideas for improvements? Please don't hesistate to open an issue to discuss, or a pull request with enhancements.

๐Ÿ““ License

This project is licensed under the GNU Affero General Public License v3.

stocklet's People

Contributors

hexolan avatar

Stargazers

 avatar

Watchers

 avatar  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.