So after having a chat with my friend chatGPT on how best to structure the LMS infra, I decided to use the hexagonal architecture pattern. I have used this pattern in the past for two of my projects both of which are live in production with active usage and the benefits have been profound. I admit that at the beginning, using this pattern has some technical implementattion overhead, but overtime it pays off.
This architecture emphasizes a clean separation between the core business logic (domain) and the external services, ensuring that the application remains flexible, testable, and maintainable.
In Hexagonal Architecture, the application is divided into three main layers: