Generating Your Project

It’s easy to generate a project with Mithril’s code generator.

$ mix gen mithril <project-name> [options]

By default, Mithril will generate an extremely plain, bare-bones umbrella application. Use the options below to add functionality.

Options

  • --accounts: Generates a token-based authentication domain. Requires the following options to be included to work properly: --ecto, --email. See their documentation below.

  • --api [type]: Generates an API app. Supported types:

  • --assets: Generates the Phoenix app with an asset pipeline for javascript and css.

  • --asset-bundler [bundler] The asset bundler to use for the asset pipeline. Supported options:

    • brunch
    • webpack
  • --ci [type]: The CI server you intend to use. Supported options:

    • semaphore: Generates configuration for Semaphore.
  • --deploy [host]: The host you intend to serve your Mithril application from.

    • heroku: Generates configuration for Heroku
  • --ecto [adapter]: Include Ecto for persistence. Supported adapters:

    • postgres
  • --email: Generate email notification domain using Swoosh.

  • --gettext: Generates internationalization support using Gettext.

  • --html [template-lang]: Generates HTML-related files in the Phoenix app, such as views, controllers, and templates. Supported template languages:

  • --sass-syntax [syntax]: The variant of Sass syntax to use if you have an asset pipeline. Supported options:

    • sass
    • scss
  • --websockets: Generates needed files for websocket support in both the Phoenix and GraphQL API apps (if you have one).