Developing large-scale applications has always been easy to think about but when it comes to implementation, complexities start laying themselves on the table especially when working in a collaborative team where decisions are peer-discussed and made over coffee or beer on a napkin. Moreover, with the rise of the microservice architecture trend, where dissecting the monolith you’ve always been working on becomes the next big thing in the project, the need for guidelines and standards becomes crucial for the task to reach success. In this opinionated architecture, you’ll learn about patterns that, when followed, will serve answering questions like "Where should this good piece of art code reside (folder, file, class, etc.)?”, "What design patterns should we apply to implement this feature?”, “What features are implemented in this project?”, “What are the different steps to accomplish a specific feature?”, and most importantly will make your monolith-to-service transition easier.
19. Lucid • Feature
• As described in business, as a class name
• Runs Jobs - Steps in the process of accomplishment
CreateArticleFeature
LoginUserFeature
Controller
Process
&
Respond
Feature
serve
25. Lucid • Job
A class that does one thing; responsible for the
business logic
• CreateArticleFeature
• Validate Article Input
• Generate Slug
• Upload Files To Cdn
• Save Article
• Respond With Json
26. Lucid • Job
A class that does one thing; responsible for the
business logic
• CreateArticleFeature
• ValidateArticleInputJob
• GenerateSlugJob
• UploadFilesToCdnJob
• SaveArticleJob
• RespondWithJsonJob
27. Lucid • Job
A class that does one thing; responsible for the
business logic
Controller Feature
serve
Validate Input
Generate Slug
Upload Files To CDN
Save Article
Respond With JSON
]Process
&
] Respond
41. Lucid • Principles ✍
1. Controllers serve Features
2. Avoid Cross-Domain Communication
3. Avoid Cross-Job Communication
42. Getting Started
> composer create-project lucid-arch/laravel my-project
1. Init a project
> lucid make:service Api
2. Scaffold a Service
> lucid make:feature Api LoginUser
3. Generate a Feature
> lucid make:job User CheckCredentials
4. Generate a Job