All Projects → serradura → from-fat-controllers-to-use-cases

serradura / from-fat-controllers-to-use-cases

Licence: other
Rails (API) app that shows different kinds of architecture (one per commit), and in the last one, how to use the Micro::Case gem to handle the application business logic.

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to from-fat-controllers-to-use-cases

Go Bank Transfer
Simple API for banking routines using a Clean Architecture in Golang. 💳 💰 💸
Stars: ✭ 123 (+66.22%)
Mutual labels:  architecture, clean-architecture
Cleanarchitecture.workerservice
A solution template using Clean Architecture for building a .NET Core Worker Service.
Stars: ✭ 142 (+91.89%)
Mutual labels:  architecture, clean-architecture
Swift Cleanarchitecture
Simple Swift project applying concepts inspired on the Clean Architecture
Stars: ✭ 133 (+79.73%)
Mutual labels:  architecture, clean-architecture
Polysemycleanarchitecture
Showcasing how the Polysemy library can be used to implement a REST application conforming to the guidelines of the Clean Architecture model.
Stars: ✭ 106 (+43.24%)
Mutual labels:  architecture, clean-architecture
Architecture
.NET 6, ASP.NET Core 6, Entity Framework Core 6, C# 10, Angular 13, Clean Code, SOLID, DDD.
Stars: ✭ 2,285 (+2987.84%)
Mutual labels:  architecture, clean-architecture
Deptrac
Keep your architecture clean.
Stars: ✭ 1,784 (+2310.81%)
Mutual labels:  architecture, clean-architecture
Android Modular Architecture
📚 Sample Android Components Architecture on a modular word focused on the scalability, testability and maintainability written in Kotlin, following best practices using Jetpack.
Stars: ✭ 2,048 (+2667.57%)
Mutual labels:  architecture, clean-architecture
Swift Design Patterns
🚀 The ultimate collection of various Software Design Patterns implemented in Swift [Swift 5.0, 28 Patterns].
Stars: ✭ 85 (+14.86%)
Mutual labels:  architecture, clean-architecture
Clean Architecture Swiftui
SwiftUI sample app using Clean Architecture. Examples of working with CoreData persistence, networking, dependency injection, unit testing, and more.
Stars: ✭ 2,925 (+3852.7%)
Mutual labels:  architecture, clean-architecture
Domain Driven Hexagon
Guide on Domain-Driven Design, software architecture, design patterns, best practices etc.
Stars: ✭ 4,417 (+5868.92%)
Mutual labels:  architecture, clean-architecture
Android Kotlin Clean Architecture
Android Sample Clean Architecture App written in Kotlin
Stars: ✭ 1,562 (+2010.81%)
Mutual labels:  architecture, clean-architecture
Android Mvp Architecture
🏛 A basic sample android application to understand MVP in a very simple way. Just clone, build, run and understand MVP.
Stars: ✭ 203 (+174.32%)
Mutual labels:  architecture, clean-architecture
Dev Stuff
😎 Programming stuff for everyone. Collection of articles, videos about architecture, Domain Driven Design, microservices, testing etc.
Stars: ✭ 105 (+41.89%)
Mutual labels:  architecture, clean-architecture
Rxviper
Android micro framework for developing apps based on clean VIPER architecture.
Stars: ✭ 112 (+51.35%)
Mutual labels:  architecture, clean-architecture
Ios Architectures
Sample app for iOS architectures
Stars: ✭ 90 (+21.62%)
Mutual labels:  architecture, clean-architecture
Go Clean Architecture
👨‍💻 REST API example, built by following Uncle Bob’s clean architecture principles
Stars: ✭ 133 (+79.73%)
Mutual labels:  architecture, clean-architecture
Cleanarchitecture
Clean Architecture Solution Template: A starting point for Clean Architecture with ASP.NET Core
Stars: ✭ 8,945 (+11987.84%)
Mutual labels:  architecture, clean-architecture
Cleanarchitecturetemplate
A template for a dotnet core api / mvc "clean architecture" project.
Stars: ✭ 50 (-32.43%)
Mutual labels:  architecture, clean-architecture
Android Clean Architecture Boilerplate
Apply clean architecture on Android
Stars: ✭ 141 (+90.54%)
Mutual labels:  architecture, clean-architecture
Enhanced Rails Architecture
A set of good architectural patterns beyond the pure Ruby on Rails architecture.
Stars: ✭ 185 (+150%)
Mutual labels:  architecture, ruby-on-rails

From fat controllers to use cases

Rails (API) app that shows different kinds of architecture (one per commit), and in the last one, how to use the Micro::Case gem to handle the application business logic.

Instructions to run this application

  • Ruby version: 2.6.5
  • System dependencies: sqlite3
  • Configuration and database creation: bin/setup
  • How to run the test suite: bin/rails test

The different kinds of architecture (project versions)

Version Description Rubycritic Score
1 Fat controller 91.53
2 Fat model, skinny controller 87.45
3 Concerns 89.25
4 Service objects 92.55
4.1 Service objects - Inheritance 92.93
4.2 Service objects - Inheritance overusing 93.15
5 Interactors 96.36
6 Domain objects 94.71
7 Use cases (Micro::Case) 94.97
7.1 Use cases - Dryer version 95.24
7.2 Use cases- Improving the SRP 95.11

Hint: in any of the versions above, use bin/rails rubycritic to see the full report result.

Extra: How to list all the use cases?

Use the use_cases task. e.g:

bin/rails use_cases

# Lines:
#     11 ./app/models/user/register/step/serialize_as_json.rb
#     12 ./app/models/user/register/step/validate_password.rb
#     17 ./app/models/user/register/step/create_record.rb
#     19 ./app/models/user/register/step/normalize_params.rb
#     10 ./app/models/user/register/flow.rb
#     18 ./app/models/todo/list/add_item.rb
#     16 ./app/models/todo/list/complete_item.rb
#     14 ./app/models/todo/list/delete_item.rb
#     12 ./app/models/todo/list/fetch_items.rb
#     14 ./app/models/todo/list/find_item.rb
#     19 ./app/models/todo/list/update_item.rb
#     16 ./app/models/todo/list/activate_item.rb
#     21 ./app/models/todo/serialize.rb
#    199 total
#
# Files: 13

Note: This task will only be available in the branches with use cases (v7, v7.1, v7.2).

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