Ensure you have Erlang, Elixir, Node.js, and PostgreSQL installed.
# Install Phoenix
mix local.hex
mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez
A comprehensive cheat sheet covering essential Phoenix framework commands, directory structure, routing, Ecto interactions, and more, with examples.
Ensure you have Erlang, Elixir, Node.js, and PostgreSQL installed.
|
Create a new Phoenix project:
|
This generates a basic Phoenix application. Follow the instructions to set up the database and start the server. |
|
Compiled Elixir code. |
|
CSS, JavaScript, and static files. |
|
Application configuration files. |
|
Project dependencies. |
|
Source code for the application, including contexts, schemas, and web-related files. |
|
Database migrations and static assets. |
|
Tests for the application. |
Define routes in
|
Generate routes for a resource:
|
Use path helpers to generate URLs:
|
Access request data through the
|
Use
|
Generate a migration file:
|
Example migration:
|
Generate HTML resources using
|
Replace |