Structuring an umbrella app for a larger project

I am working on my largest project to date and am trying to establish the best way to structure my application. I am currently working on the web interface, but ultimately most users are going to be using the service through a native phone app.

I was considering creating my first umbrella application. My current application has a user interface that allows users to register and view their profile and it has an admin page that allows admins to create/edit/delete users and a few other CRUD resources. Right now an admin is just a %User{ … admin: true}.

For security purposes, I have a completely separate domain name I am going to use to serve the admin dashboard pages (main app -> www.appexample.com; admin dashboard -> appexample.management). So I will more than likely serve them on different ports with the umbrella app and then use Nginx in production to direct them to the correct domain.

I was also considering decoupling the database from the web application and serving it from within it’s own application within the umbrella, but I am not sure if this defeats the purpose of using Contexts. What would be the difference between keeping the database attached to the web application and using well named Contexts versus creating a separate phoenix app with a sole purpose of serving the database.

The application itself is currently an iOS app that I was asked to redevelop and I chose Elixir for the majority. I have only developed a small number of iOS apps in the past, but that was before Swift so my experience right now with mobile development is lacking. Here is how I am currently thinking about structuring the umbrella app:

umbrella_app
|> database_app (Phx 1.4 + Ecto)
|> User interface web application (Phx 1.4)
|> Admin interface web application (Phx 1.4)

After the above project is complete I will begin working on the mobile side of the app. There is a lot to do with Geolocation and notifications based on a person’s location. I’ve read some about PWA, but because I am not a mobile developer and haven’t done a terribly large amount of research into that field of development I am not sure how effective a PWA would be when I need to rely on notifying a user based on their location when they have their phone in their pocket and the site not open.

What are your opinions for a structure like this?

2 Likes