Skip to content
TheChatArchiveThe Chat Archive
Perplexitysonar-pro-high· PerplexityHugging Face LMArena Search Arena 24K

Tell me how to use mix phx.new to make a new elixir phoenix project with sqlite and…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with gpt-4o-search-preview-high-loc’s answer.
  1. User

    Tell me how to use mix phx.new to make a new elixir phoenix project with sqlite and without live view

  2. Perplexity Assistant

    To create a new Phoenix project using SQLite as the database and without LiveView, you can use the mix phx.new command with specific flags. Here's how:

    Command

    mix phx.new my_app --database sqlite3 --no-live
    

    Explanation of Flags

    • --database sqlite3: Specifies SQLite as the database for the project.
    • --no-live: Excludes Phoenix LiveView, which is used for building real-time and interactive web applications.

    Additional Optional Flags

    Depending on your project's requirements, you can also include other flags:

    • --no-html: Excludes HTML views and templates if you're building an API-only application.
    • --no-assets: Skips setting up assets like JavaScript and CSS.
    • --no-gettext: Excludes internationalization support.
    • --no-mailer: Excludes email functionality.

    For example, if you want a minimal API project with SQLite, you can run:

    mix phx.new my_app --database sqlite3 --no-live --no-html --no-assets --no-gettext --no-mailer
    

    Next Steps

    1. Navigate to the project directory:
      cd my_app
      
    2. Fetch and install dependencies:
      mix deps.get
      
    3. Create the SQLite database:
      mix ecto.create
      
    4. Start the Phoenix server:
      mix phx.server
      

    Your Phoenix project is now set up with SQLite and without LiveView. You can customize further as needed by editing configuration files and adding dependencies.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.