I need to create a project that has a chat inside of it and probably will need to create this chat again for other projects.
I thought to create everything into a single app for this first project. Learn with it and then simply extract the chat part into a separate app to use the same for other projects later or create microservice with this chat and call it as s service.
One member of my team wants to create an umbrella from the beginning and separate the project into 3 apps. One Phoenix gateway app, the project itself ( witch is already an API ) and a chat server.
I think we should create everything together and separate only if we need to reuse in the future.
I’m not very familiar with Elixir’s umbrellas, but used clean architecture with ASP.NET.
Splitting an app from the beginning without knowing the final result adds “unnecessary” complexity to the project, unless you’re crystal clear how things will work. You’ll need to figure out a bunch of things, like the purpose of every app inside the umbrella or how to connect them working together. Reusing certain parts of your application in other projects doesn’t mean you must strip them from the main app, sometimes creating a library is the best solution.
To me, the project seems to be small / medium size, so I’d say start simple and see how is going. These kind of architecture things are meaning to help developers, not to hurt them.
After building and maintaining several applications and services, both umbrellas and not, I would highly recommend avoiding umbrellas while you’re building something new. Umbrellas bring a number of challenges with them around configuration and dependencies (amongst other things). Once you’ve gone down the road a ways you can re-evaluate your need to start splitting your app into smaller apps. I don’t personally like to use umbrellas at all and I definitely wouldn’t do it up-front with a new app.