Pheonix Framework

$ mix help


Creates a new Phoenix project.

It expects the path of the project as an argument.

    $ mix PATH [--module MODULE] [--app APP]

A project at the given PATH will be created. The application name and module
name will be retrieved from the path, unless --module or --app is given.

## Options

  • --umbrella - generate an umbrella project, with one application for
    your domain, and a second application for the web interface.
  • --app - the name of the OTP application
  • --module - the name of the base module in the generated skeleton
  • --database - specify the database adapter for Ecto. One of:
    • postgres - via
    • mysql - via
    • mssql - via
    • sqlite3 - via

    Please check the driver docs for more information and requirements.
    Defaults to "postgres".

  • --no-assets - do not generate the assets folder. When choosing this
    option, you will need to manually handle JavaScript/CSS if building HTML
  • --no-ecto - do not generate Ecto files
  • --no-html - do not generate HTML views
  • --no-gettext - do not generate gettext files
  • --no-dashboard - do not include Phoenix.LiveDashboard
  • --no-live - comment out LiveView socket setup in assets/js/app.js and
    also on the endpoint (the latter also requires --no-dashboard)
  • --no-mailer - do not generate Swoosh mailer files
  • --binary-id - use binary_id as primary key type in Ecto schemas
  • --verbose - use verbose output
  • -v, --version - prints the Phoenix installer version

When passing the --no-ecto flag, Phoenix generators such as phx.gen.html,
phx.gen.json,, and phx.gen.context may no longer work as expected
as they generate context files that rely on Ecto for the database access. In
those cases, you can pass the --no-context flag to generate most of the HTML
and JSON files but skip the context, allowing you to fill in the blanks as

Similarly, if --no-html is given, the files generated by phx.gen.html will no
longer work, as important HTML components will be missing.

## Installation

mix by default prompts you to fetch and install your dependencies. You
can enable this behaviour by passing the --install flag or disable it with the
--no-install flag.

## Examples

    $ mix hello_world

Is equivalent to:

    $ mix hello_world --module HelloWorld

Or without the HTML and JS bits (useful for APIs):

    $ mix ~/Workspace/hello_world --no-html --no-assets

As an umbrella:

    $ mix hello --umbrella

Would generate the following directory structure and modules:

    hello_umbrella/   Hello.Umbrella
        hello/        Hello
        hello_web/    HelloWeb

You can read more about umbrella projects using the official Elixir guide

Location: /Users/user/.mix/archives/phx_new-1.6.6/phx_new-1.6.6/ebin

Leave a Comment

Your email address will not be published. Required fields are marked *