Coder Social home page Coder Social logo

ninjarmm's Introduction

NinjaRMM

NinjaRMM allows you to create a fleet of devices and associated services. This application has been created using practices such as:

Tactical DDD constructions

The project is organized using DDD concepts such as Bounded Contexts and Modules. There are two bounded contexts RMMCustomers and RMM.

boundedcontexts

Each bounded context is divided in several modules containing different Aggregate roots representing the different domain capabilities of the application.

modules

modules

CQRS & EDA

The communication beetween modules and bounded contexts is done using a Query bus and an Event bus. As this applications is in a mono ropo the differents bounded contexts could share some objects, for example RMMCustomers use several events from RMM to update their Read Model.

Also there are two apps rmm and rmmcustomers, both are rest api's that dispatch commands or querys to the RMM or RMMCustomers contexts.

For example, a customer could place an order for an existing device using rmmcustomers API and the API dispatch a command to the RMM contenxt and then Orders module handle this command in order to fulfill the customer request.

modules

Idempotency

Every command (PUT requests to the API) send along the UUID identifier of the aggregate. This favors the resolution of problems, for example of repeated/disordered events in case of a distributed infrastructure using message brokers systems. It also allows using commands without returning a result, so the client doesn't have to wait for the server to respond.

Framework agnostic models

I have not used annotations in the model to avoid concerns about data persistence in the aggregates roots. I have to say, however, that the development experience is affected by this decision, but not having the facility to use Annotations like @OneToMany have allowed me to think more about AR modeling, in fact no join is used in the implementation of the solution.

Testing

Three types of tests have been implemented:

  • Acceptance tests They attack the application from the controllers
  • Unit tests The entry points for these tests are the different command handlers and sometimes some more internal unit test if the logic is complex.
  • Infrastructure tests Isolates the persistence components to test agains a real database.

Also, there are one special test 'TechincalTaskAcceptanceTest' that tests an aproximation of the scenario provided in the instructions.

How to use the application

A Makefile has been provided to run the applications and their tests. There is a default configuration in the .env file located in apps > main > resources.

In order to execute the tests the environment must be started with make up

  • To execute all tests run: make tests
  • To run the rmm-backend application run: make run-rmm-backend
  • To run the rmm-customers application run: make run-rmmcustomers-backend

There is also an adminer services provided with docker-compose if you want to check for example the data on rmm-customers context after a test suit execution.

ninjarmm's People

Contributors

xavidev avatar

Stargazers

Suren Ayvazyan avatar

Watchers

 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.