Generate a New Phoenix Application

Learn how to create a Phoenix application.

This is where the fun really begins. We’ll have a new web app up and serving pages with just a couple of shell commands. Phoenix will serve them faster than we might have thought possible.

Prerequisites

In the widget present in this lesson, we use Node.js to install front-end dependencies such as Brunch. Phoenix uses Brunch as a build tool. Node.js doesn’t play a role within Phoenix proper as such. Take a look at Appendix, Installing System Dependencies, if you need help installing them.

By default, the Phoenix project generator will install Ecto—the Elixir data wrapping and query generating package. The generator will also install Brunch by default.

We won’t need to use Ecto because we won’t be using a database. We will use Brunch because we need to serve some assets for our game’s web version.

We will call the Phoenix interface project islands_interface. We will pass that name into the phx.new Mix task that the installer archive exposes. We will also pass the name into the --no-ecto flag telling phx.new not to install Ecto.

Create a Phoenix project

We change the islands_engine directory into the islands_interface parent directory before we issue the following command. That way, when we run the phx.new task, we create the interface directory parallel to the engine directory:

mix phx.new islands_interface --no-ecto

Note: Run this command in the terminal below.

Get hands-on with 1200+ tech skills courses.