All Projects → sveredyuk → axr

sveredyuk / axr

Licence: MIT license
Simple architecture for the better ruby applications

Programming Languages

ruby
36898 projects - #4 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to axr

nota
"None Of The Above" - is going to be a secure online voting system, intended to give the electorate better choices. It always adds one additional choice to anything to be voted on: If more than 50% of voters choose "None of the Above", the election is considered null and void.
Stars: ✭ 17 (-22.73%)
Mutual labels:  ddd
radiopush
Create communities and share songs with Spotify users (https://radiopush.app)
Stars: ✭ 89 (+304.55%)
Mutual labels:  ddd
cqrs
A lightweight, opinionated CQRS and event sourcing framework targeting serverless architectures.
Stars: ✭ 155 (+604.55%)
Mutual labels:  ddd
DomainResult
Tiny package for decoupling domain operation results from IActionResult and IResult types of ASP.NET Web API
Stars: ✭ 23 (+4.55%)
Mutual labels:  ddd
ddd-house
🏠 Building a house with DDD
Stars: ✭ 38 (+72.73%)
Mutual labels:  ddd
UnitOfWork
DDD中实体、聚合、仓储、UOW相关实现。
Stars: ✭ 108 (+390.91%)
Mutual labels:  ddd
crossword
The game is implemented as an example of scalable and high load architecture combined with modern software development practices
Stars: ✭ 56 (+154.55%)
Mutual labels:  ddd
ema
External memory app - allows one to quickly post and search text notes
Stars: ✭ 43 (+95.45%)
Mutual labels:  ddd
nestjs-boilerplate-microservice
Nestjs Microservice boilerplate: apply DDD, CQRS, and Event Sourcing within an event driven architecture
Stars: ✭ 270 (+1127.27%)
Mutual labels:  ddd
permacoop
Open source and eco design ERP solution reserved for worker-owned business.
Stars: ✭ 167 (+659.09%)
Mutual labels:  ddd
backend
Ergonode backend repository
Stars: ✭ 100 (+354.55%)
Mutual labels:  ddd
example-ddd-cqrs-server
Example DDD/CQRS based on Implementing Domain Driven Design book written by Vaughn Vernon
Stars: ✭ 40 (+81.82%)
Mutual labels:  ddd
slack-community
Docs related to DDD-CQRS-ES Discord Community
Stars: ✭ 58 (+163.64%)
Mutual labels:  ddd
zhacker-framework
微服务实践公共类库,基于SpringBoot2
Stars: ✭ 28 (+27.27%)
Mutual labels:  ddd
eShopOnWeb
Sample ASP.NET Core 6.0 reference application, powered by Microsoft, demonstrating a layered application architecture with monolithic deployment model. Download the eBook PDF from docs folder.
Stars: ✭ 8,250 (+37400%)
Mutual labels:  ddd
TimeRecorder
工数管理アプリ
Stars: ✭ 51 (+131.82%)
Mutual labels:  ddd
buttons
🌱 buttons is a web service to help you keep doing things everyday
Stars: ✭ 21 (-4.55%)
Mutual labels:  ddd
nstate
A simple but powerful react state management library with low mind burden
Stars: ✭ 11 (-50%)
Mutual labels:  ddd
ddd-referenz
Deutsche Übersetzung der DDD Referenz von Eric Evans
Stars: ✭ 58 (+163.64%)
Mutual labels:  ddd
wolkenkit-todomvc
wolkenkit-todomvc is a todo application.
Stars: ✭ 15 (-31.82%)
Mutual labels:  ddd

AXR

Ruby architecture for simplicity and team adoption

Architecture's hard. It’s very easy to build a complex system. Much harder to build a simple and adaptable solution. The code doesn't matter. Coding for the sake of writing code is foolish.

Only a few of us get to write software that survives 5-10 years or longer. 90% of our work is garbage that becomes obsolete in 1-3 years after release. Most of our work hours are wasted on features that will never be useful.

This is just a reality.

(c) Volodya Sveredyuk

Motivation

Application engineering it's always about abstractions and how they describe the real world and business which pays our salaries for coding something that might improve it. Maybe. Sometimes.

I hate doing something alone. I am a team player and as a team player, I prefer conventions over configuration. But this is not working with knowledge responsibility segregation inside the software app. In the Ruby world (especially Rails) it's so easy to add a new feature. Just add one line, one dependency, one callback and now you share knowledge about one entity into another entity. More dependencies - more spaghetti and legacy that in future we should REWRITE EVERYTHING!

drawing

Architecture's about knowledge responsibility and not the code.

The worst thing that even we write the architecture document wherein a convenient way to agree on architecture and layers and entities, etc - We are not protected from violation of these conventions.

And this the place where AxR comes on the stage.

Please, welcome the DSL that helps:

  1. Describes your application layers (modules)
  2. Defines knowledge responsibilities between them
  3. Checks if you did not violate anything

Setup

In your Gemfile

gem 'axr', group: :development

DSL

In your ruby app: (for rails app put it into config/initializers/axr.rb file)

require 'axr'

AxR.app.define do
  layer 'Api'
  layer 'YourBusinessLogic'
  layer 'Repo'
end

By default, layers will get level from top to bottom.

Api -> 0
YourBusinessLogic -> 1
Repo -> 2

Layers with lower-level have less isolation.

  • Api knows about YourBusinessLogic and Repo
  • YourBusinessLogic knows about Repo but don't know anything about Api
  • Repo fully isolated and don't familiar with Api and YourBusinessLogic

Options

require 'axr'

AxR.app.define do
  layer 'A'
  layer 'B', familiar_with: 'C'
  layer 'C', familiar_with: 'B'
  layer 'D', isolated: true
  layer 'E', isolated: true
end
# app.define options
AxR.app.define(isolated: true) # All layers will be isolated by default
AxR.app.define(familiar_with: ['D', 'E') # All layers will be familiar with D and E by default

# layer options
familiar_with: [...] # Can operate with other layers
isolated: true # 100% isolated and should not operate with other layers
isolated: true, familiar_with: [...] # Isolated from all except familiars

Can organize knowledge structure like:

drawing

CLI

Run AxR checker in console

axr check . --load path/to/you/app/autoload.rb

For rails apps

axr check . --load config/environment

Run for a specific directory

axr lib/adapters

Run for a specific file

axr lib/adapters/youtube.rb

Finish scanning with status code 1 in case of any warnings (you can use in CI environment to fail pipeline step)

axr check --exit-on-warnings

More examples

ERP system

drawing

if Rails.env.development? || Rails.env.test?
  require 'axr'

  AxR.app.define(isolated: true) do
    layer 'UI',         familiar_with: %w[Docs Inventory Production]
    layer 'API',        familiar_with: %w[Docs Inventory Production]
    layer 'Docs',       familiar_with: %w[Inventory Accounts Repo]
    layer 'Accounts',   familiar_with: %w[Repo]
    layer 'Inventory',  familiar_with: %w[Repo]
    layer 'Production', familiar_with: %w[Repo]
    layer 'Repo'
  end
end

TODO

  • Ignore vendor or any other directories dir as configuration
  • Add sublayers
  • Add rubocop cop
  • Add more app examples
  • Migrate to AST analyzer
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].