marcxrand

marcxrand

Project - Automate common Phoenix tasks so you can start building your idea faster

Project

Why?

Every time I start a new Phoenix project, I find myself doing the same repetitive stuff: swapping esbuild for Bun, adding Oban, configuring Credo, removing DaisyUI components I don’t need, setting up pgvector, etc.

I also have very specific preferences that take forever to do manually on every project, like sorting mix.exs dependencies by name, implementing @PJUllrich’s Unaccented Name Search With Postres, and all the things in @JohnnyCurran’s The Modifications I Make to Every New Phoenix Project.

Igniter.install is great for getting started but isn’t available in many older projects, often has optional steps left out (adding Oban.Telemetry.attach_default_logger() in application.ex when installing Oban), and afaik hasn’t been used yet for removing code from Phoenix (like getting rid of all Topbar.js or DaisyUI code, not just the dependencies).

Project

Project saves you time by skipping the repetitive boilerplate setup and removal code at the start (or middle!) of every Phoenix project. Run custom, composed Igniter tasks at one time, with a single command.

Features

  • Add tasks - Install and configure packages like Bun, Oban, Credo, Pgvector, and more
  • Remove tasks - Clean up unwanted code like DaisyUI, Topbar, theme toggle
  • Gen tasks - Generate boilerplate code and run convenience tasks

Installation

Add project to your list of dependencies in mix.exs:

def deps do
  [
    {:project, "~> 1.0"}
  ]
end

Generate a custom setup task for your project:

mix project.gen.setup

This creates lib/mix/tasks/<your_app_name>.setup.ex which you can edit to control which tasks run and in what order.

Or run the default setup task directly

mix project.setup

Usage

Optional tasks can be added via flags:

mix project.setup --oban-pro --gigalixir --mix-test-watch
mix your_app_name.setup --oban-pro 

Any task can be run individually

Add a package:

mix project.add bun
mix project.add oban,credo,pgvector

Remove code:

mix project.remove daisy_ui
mix project.remove theme_toggle

Generate code:

mix project.gen home_page
mix project.gen app_layout

Available Tasks

Add Tasks

  • bun - Replace esbuild with Bun
  • credo - Add Credo for static analysis
  • dotenv_parser - Add DotenvParser for .env files
  • ex_sync - Add ExSync for auto-recompilation
  • libcluster - Add libcluster for node clustering
  • mix_test_watch - Add mix_test_watch for running tests on file changes (optional)
  • oban - Add Oban for background jobs
  • oban_pro - Add Oban Pro extensions (optional)
  • oban_web - Add Oban Web UI
  • pgvector - Add pgvector for vector similarity search
  • quokka - Add Quokka for code formatting
  • remix_icons - Add Remix Icons
  • tidewave - Add Tidewave MCO
  • uuidv7 - Add UUIDv7 support

Remove Tasks

  • daisy_ui - Remove DaisyUI components
  • live_title_suffix - Remove live title suffix
  • repo_credentials - Remove repo credentials from config
  • theme_toggle - Remove theme toggle functionality
  • topbar - Remove Topbar.js

Gen Tasks

  • app_layout - Generate a clean app layout
  • class_formatter - Generate TailwindCSS class formatter
  • gigalixir - Generate Gigalixir deployment config (optional)
  • gitignore - Generate .gitignore additions
  • graph_db - Generate graph database tables for nodes and edges (optional)
  • home_page - Generate a minimal home page
  • pg_extensions - Generate PostgreSQL extensions migration
  • repo_config - Generate repo configuration
  • schema - Generate schema helpers
  • sort_deps - Sort mix.exs dependencies alphabetically

Customization

After running mix project.gen.setup, edit the tasks/0 function in lib/mix/tasks/<your_app_name>.setup.ex.

  • Reorder tasks
  • Remove tasks you don’t need
  • Add your own custom tasks
  • Use {:optional, :flag_name} placeholders for custom flags

What’s next?

I’m be adding more tasks based on what I find myself needing and which tasks are contributed. Ideally, this becomes a community-led compendium of custom tasks! :heart::heart::heart::front_facing_baby_chick::fire:


Hex: project | Hex
Twitter: Marc Rand (@random) / X
GitHub:

https://github.com/marcxrand/project

First Post!

ghannam80

ghannam80

Looks great, maybe a good candidate would be items related to authentication and user/roles management plus things like 2FA as in most discussions the team opt against having it in the core skeleton generated by framework which makes sense due to different variations possible but that does not mean it is not repetitive in nature in most of cases

Most Liked

ghannam80

ghannam80

Correct but I am not aware of it handling things like access control whether you use RBAC or ABAC plus two factor authentication and those things mostly required in enterprise apps

Last Post!

marcxrand

marcxrand

you’re right, will update!

i personally don’t even push it to version control. i install it, generate what i need, and remove it :sweat_smile:

Where Next?

Popular in Announcing Top

mischov
import Meeseeks.CSS html = HTTPoison.get!("https://news.ycombinator.com/").body for story &lt;- Meeseeks.all(html, css("tr.athing")) do...
New
bryanjos
Hi, I wanted share a small library we at Revelry Labs made for rendering react components from the server side. There are instructions fo...
New
kip
ex_cldr provides localisation and internationalisation support based upon the data from the Unicode CLDR project. Unicode released CLDR ...
407 13366 120
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
kevinlang
Hey all, We have made an Ecto3 Adapter for SQLite3, ecto_sqlite3! We have successfully on-boarded the full suite of integration tests (...
New
martinthenth
Hello everybody :wave: Recently, some of my colleagues talked about database ids and uuids and their problems, and I remembered the pain...
New
scohen
Lexical Lexical is a next-generation language server for the Elixir programming language. Features Context aware code completion As-you...
New

Other popular topics Top

KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36820 110
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 44265 214
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID&lt;0.412.0&gt; terminating ** (Postgrex.Error) FATAL...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New

We're in Beta

About us Mission Statement