vkryukov

vkryukov

Advice on setting up umbrella app structure

Hi,

I would appreciate advice on the best practice for organizing several interconnected Elixir apps. I suspect that what I need is an umbrella project, but I would like to confirm this with the community.

I have three apps (1 is in active development, 3 I’m just starting, 2 is planned):

  1. A command-line app with a database that I plan to distribute in binary form to customers
  2. A premium app that implements additional functionality and a web UI
  3. An internal app (development and debugging tools, also with a web UI)

Based on my understanding of umbrella projects, this would be the right solution if implemented like this:

my_umbrella
  apps/my_app        # command-line app
  apps/my_app_web    # web UI + premium features
  apps/my_dev_app    # internal development tools

In this scenario, my_app_web and my_dev_app will both have my_app as a dependency, giving them access to all the core functionality, Ash resources, and database access. At the same time, I can distribute the first two apps separately, while the third internal app will never be distributed outside our team.

Is this the right approach? Are there any things I should be aware of, or is everything fairly straightforward as described in the official docs?

Many thanks!
Victor

Most Liked

gregvaughn

gregvaughn

I wish we could remove this misunderstanding about umbrella projects (not apps). One umbrella project can map to N releases. Releases are the deployment unit. The umbrella represents a way to organize the code “at rest” on the filesystem before releases are built.

If they’re not intended to be distributed together then the two (or more) release definitions should not include them both.

al2o3cr

al2o3cr

Seems like a good use case - the compiler will ensure that no references to code in my_dev_app sneak into the other two.

jeremy.owensboggs

jeremy.owensboggs

Umbrella apps are intended to be distributed as a unit. I would not recommend an umbrella app for this purpose. I’m under the impression that umbrella apps get loaded all together, and that references can creep into apps under the same umbrella in ways that those references can’t if they are in independent projects.

If my_dev_app is not intended to be distributed with my_app & my_app_web, then I would strongly recommend that it is kept separate.

I have been a part of several large umbrella projects, and In general I have found over time that all of these projects generally get flattened - and if not fully turned into individual projects, that the core components get merged into a single project, and that only other apps in the umbrella are custom libraries that are under active development.

Where Next?

Popular in Questions Top

LegitStack
I’m hoping you guys can give me some general advice and perhaps code examples if you’re feeling up to it. I’m very interested in Elixir,...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
Mooodi
Given a string, how can I get access to its character by index? Enum.at("my_string", 2) doesn't work. Or rather, not char, but a substr...
New
jc00ke
Expanding on this topic: https://forum.elixirforum.net/t/map-typespec-question/19217 Let’s say I have a map with required and optional k...
New

Other popular topics Top

sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
977 41022 311
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 42633 214
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
Nvim
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New

We're in Beta

About us Mission Statement