GithubHelp home page GithubHelp logo

giuliana-bezerra / gfood Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 1.0 409 KB

Gfood is an app for managing food delivery which was designed following a mudular monolith architecture. This project was based on this original monolith: https://github.com/microservices-patterns/ftgo-monolith.

Shell 1.66% Java 98.34%
modular-monolith monolith-architecture spring-boot java

gfood's Introduction

Gfood

Technologies   |    Project   |    Solution   |    Configuration   |    Build and Run   |    Developing

License Modular Monolith


✨ Technologies

💻 Project

Gfood is an app for managing food delivery which was designed following a mudular monolith architecture. This project was based on this original monolith.

💡 Solution

A modular monolith is an architecture more close to microsservices and therefore it has several benefits regarding reusability, dependency management, observability and teams workflow.

Gfood was designed in several modules, each with its own responsability:

  • gfood-application: The app itself which depends on all modules to run.
  • gfood-*-service: Domain service which provides business functionality.
  • gfood-*-service-api: API definitions for consumers of the domain service.
  • gfood-common: Common components reused by others.
  • gfood-domain: Domain classes and repositories that map database structures.
  • gfood-end-to-end-tests: Integration tests of all functionalities.
  • gfood-flyway: Migrations that create gfood database structures.
  • gfood-swagger: Swagger UI configuring all gfood APIs.

Each project generates its own jar file, which are dependencies of gfood-application. The following diagram shows gfood in terms of its services and related functionalities:

gfood

🛠️ Configuration

Gfood requires a mysql database for persisting data, so you have to configure an user and database as folows:

$ sudo mysql

CREATE USER 'user'@'%' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON *.* TO 'user'@'%' WITH GRANT OPTION;

exit

$ mysql -u user -p

CREATE DATABASE gfood;

exit

On building phase, the tables will be created by migrations configured using Flyway.

🚀 Build and Run

For building and testing, execute the script:

$ ./build-and-test.sh

For building and running, execute the script:

$ ./build-and-run.sh

The APIs will be available in Swagger-UI: http://localhost:8080/swagger-ui.html.

👩‍💻 Developing

Adding more functionality to gfood requires following the steps below to maintain consistency with modular monolith architecture:

  • Create a new spring boot project for the new service (ex: gfood-payment-service)
  • Create a new spring boot project for the service api (ex: gfood-payment-service-api)
  • Import the new ServiceConfig class in GfoodApplication
  • Create new domain classes and repositories inside gfood-domain
  • Create any common class inside gfood-common
  • Create new migrations inside gfood-flyway
  • Add unit tests inside the new service project
  • Add integration tests inside gfood-end-to-end-tests
  • Change scripts to build and test/run the new projects

gfood's People

Contributors

giuliana-bezerra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

nazarenoneto

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.