Skip to main content

Basic Application Setup

In the beginning there was darkness.

App Generation

Let’s kick things off by using a Phoenix umbrella application as our trusty scaffold. We’re aiming to build three distinct Elixir applications under this umbrella:

  • The ‘Phoenix’ application – for the slick web frontend.
  • A ‘core’ application – responsible for all database interactions and, crucially, the game engine.
  • And a separate server instance – dedicated solely to TCP networking.

When we generate the Phoenix application, it will automatically include a ‘core’ application and a separate ‘web’ application. So, we can leverage that core application as our engine/core app. We will come back around later for the TCP server.

mix phx.new --umbrella elixir_mud

After running mix (and answering yes to install dependencies), our application scaffolding will be generated at ./elixir_mud_umbrella will be created. We should have a file structure that looks something like this:

elixir_mud_umbrella
  apps/
    elixir_mud
    elixir_mud_web

We now have our web front-end application and our core engine. This generation doesn’t automatically set up a Git repository for us, so we’ll need to tackle that setup ourselves:

git init
git add --all
git commit -m "initial project scaffolding"

Lets get make sure everything is running correctly:

mix deps.get
mix compile
mix ecto.migrate
mix phx.server

Now visit http://localhost:4000 and you should see a Phoenix welcome page.

Let there be light.
Updated on Jun 7, 2025