The Phoenix framework and the Elixir language have rapidly increased in popularity. In terms of productivity, Phoenix is comparable to frameworks such as Ruby on Rails, but it’s also one of the quickest web frameworks on the market.
Due to Phoenix’s incredible speed, it can create real-time apps that are lightning-fast.
Let’s see how we can build a simple Phoenix LiveView.
The first step to developing LiveView applications is to install the following:
Note: Everything is already installed on the Educative platform.
With all of our dependencies installed, we are ready start building our Phoenix project.
To open up a terminal, click the “Run” button in the widget below and type the following commands:
mix phx.new pento --live
Note: While installing, press “Y” for every option.
mix phx.new command runs the Phoenix installer for a standard Phoenix project, and the
--live switch adds the library dependencies, configuration, and assets we’ll need to build live views.
We are almost there! Just a few steps are left. To configure the database in
config/dev.exs, we have to go to the project directory using the following command.
Then we’ll run the command below.
Finally, we can start our Phoenix app with the command below.
Note: To view the Phoenix app, click on the URL given with the “Run” button.
View all Courses