mix live_table.install

View Source

Installs and configures LiveTable in your Phoenix application.

Usage

mix live_table.install

With Oban for exports (optional):

mix live_table.install --oban

What It Does

The install generator automatically configures your Phoenix application:

1. Configuration (config/config.exs)

Adds LiveTable configuration with your app name, Repo, and PubSub:

config :live_table,
  app: :your_app,
  repo: YourApp.Repo,
  pubsub: YourApp.PubSub

The :app option is required for exports to work correctly in production releases.

2. Oban Configuration (Optional)

If you use the --oban flag (for CSV/PDF exports):

config :your_app, Oban,
  repo: YourApp.Repo,
  plugins: [Oban.Plugins.Pruner],
  queues: [exports: 10]

Manual Steps Required

After running the installer, you must:

1. Add Static Paths

In your lib/your_app_web.ex, add "exports" to your static paths:

def static_paths, do: ~w(assets fonts images favicon.ico robots.txt exports)

2. Start Oban (if using exports)

Add Oban to your supervision tree in lib/your_app/application.ex:

children = [
  # ... other children
  {Oban, Application.fetch_env!(:your_app, Oban)}
]

3. Restart Your Server

mix phx.server

Options

OptionDescription
--obanConfigure Oban for CSV/PDF exports
--yesSkip confirmation prompts

Troubleshooting

"Could not find config/config.exs"

The installer expects a standard Phoenix project structure. If your config is in a different location, you'll need to manually add the configuration.

See Also