Hey everyone. During my journey to understand the flow of the Fineract project, I found the following videos which helped me to figure out multiple things, and found it useful to share, if it would help anyone. Modularizing Fineract <https://youtu.be/8qp3zQGh5s4> Monolith to Microservices: Modularizing Fineract 1.x <https://youtu.be/fn9uhpOWrHk> Expanding Fineract capabilities <https://youtu.be/sfp7ox3wMKk>
I took some bullet points here as a summary, but for sure the videos are much more valuable. - @aleksvidakovic is the release manager of Fineract and he contributes with frequent electricity outages (No excuses for you xD) - After community growth and time passes, things get more complicated with monolithic architecture (Loan.java exceeded 7000 LOC) - For that, the need for modularity and separation comes into the scene, check this Picture <https://martinfowler.com/bliki/images/microservice-verdict/productivity.png> . - The flow of the application goes as follows: - Requests are sent from the client to the Fineract server. - API layer (RESTful APIs developed with JAX-RS) receives the request - When receiving PUT or POST requests the attached JSON is stored as a string blob and is converted manually with GSON library to Java POJO. - A portion of the requests are translated into commands. - The commands are related to CQRS pattern for separation between Reads & Writes. (e.g. GLAccountReadPlatformService and GLAccountWritePlatformService) - The commands go to a spring injectable service for command processing (handler packages) which delegates the command to the service layer to be executed. - The execution flow happens synchronously. - Check this image <https://github.com/apache/fineract/assets/87117386/d66494ec-41b2-467d-9ba3-4c6de7a4f2a0> - The code structure consists of around 12 top-level categories listed here - Identifiable patterns in the codebase: - api => The API layer that receives the client requests and is implemented with JAX-RS, which exposes some end-points that the client communicates with. - data => The Data Transfer Objects which encapsulates the data and transports it among different parts of the application. - domain => Contain entities that map between database tables and java classes and contain some legacy logic in some files :) - serialization => responsible for de/serializing between JSON files and java POJOs - exception => hold the project custom exceptions. - utility => some utility classes that contain some shared and reusable code. - handler => delegate the commands to the suitable service. - mapper => contains the mapper classes that are responsible for mapping between entities and DTOs. - service => the service layer which applies the business logic. Finally, I'd like to highlight that these insights are just personal effort, there's a high possibility of mistakes (any feedback would be very appreciated). For sure I strongly recommend referring to the videos and documentation <https://fineract.apache.org/docs/current/> where you will find more info about the history and the challenges for scalability and consistency and how they have been tackled. Special thanks to @edcable and @aleksvidakovic for these wonderful sessions <3
