DEV Community

Cover image for Frank: your supercharged Laravel Sail alternative
Json
Json

Posted on

Frank: your supercharged Laravel Sail alternative

Today I'm super excited to come out of the shadows (as a "corporate developer") and finally propose the community something that (maybe) can be useful if you're using Sail with Laravel: Frank.

(Actually my first post about my first "public" repo :D)

What's Frank about?

Frank is a supercharged Laravel development tool using Docker, with a lot of features that come from my daily frustrations working with complex Laravel projects.

What frustrations?

Right. Those are:

  • adapting copy/pasted commands from docs or other sources, from php to sail : sail artisan ... or sail composer, or even sail pnpm commands
  • needing a local PHP and Node installation, which get outdated fast and run into conflicts
  • forgetting to restart my queue workers after code changes
  • having Claude run pest tests with RefreshDatabase only to have my local database wiped (I got seeders but not specific implementations)
  • needing two monitors for my terminal holding all the various panes I need to run queues, claude, sidecar, npm run dev... (ok admittedly only one monitor)
  • installing Laravel via Docker only got removed from the docs

Features

Frank CLI features coming from Laravel Sail

From frustrations, ideas! (which turn into features) To keep things short, these are my favorite features:

Folder-aware local aliases! (+ custom ones)

Taking inspiration from Python and thanks to chpwd hooks, when you go into a frank-managed project, calling php, npm, composer, tinker, ... are directly working and using the containers underneath.

You may also edit the commitable frank.yml to add your favourite (and team-shareable) aliases, like trunc for the laravel.log truncation:

# Frank.yml
aliases:
    trunc: "truncate -s 0 /var/www/html/storage/logs/laravel.log"
Enter fullscreen mode Exit fullscreen mode

While aliases only interact with stuff inside the containers, you may also define "host" aliases:

browse:
  cmd: "open http://localhost"
  host: true

Enter fullscreen mode Exit fullscreen mode

Pure Docker install!

Not entirely "pure", as you still need to either use Brew or install Go to use Frank (plus lefthook and mkcert), but your new app is a frank new my-app away!

Support for Podman is considered

Automatic queue restart (+ scheduler) with a TUI!

Frank worker TUI

A gentle watcher observes as you code, and restarts workers when you're done. It's kind enough not to interrupt a running job, so you can code away while your big job finishes, then the queue restarts

You can even spawn ad-hoc workers if you need the extra power.

Useful keyboard shortcuts to restart your queues (like force restarting) if you need to interrupt those long running jobs on purpose.

PHP Runtime selection

Frank derives its name from FrankenPHP, but that doesn't mean you can't run your projects with FPM neither.

Choose between the classic Nginx + PHP-FPM or the shiny new FrankenPHP runtimes.

HTTPS out of the box!

Have mkcert installed locally? Reap from the HTTPS benefits, with automatic http/3 and http/2 from caddy and nginx respectively.

And more and more...

Not just that, but also:

  • MCP server
  • Git Worktrees support with separate databases (and another TUI!)
  • Single file configuration (frank.yml)
  • Testing that Just works (<insert todd_howard.png>) using the same database engine as your project
  • Auto .env patching, lefthook install with pint, larastan and rector configurations
  • Comes with a vite.config.js patch as a script to import for easy https usage.
  • Docs
  • Small status page when invoking frank on the terminal
  • Self-updater with discrete nag
  • Default Node package manager selection (supported: npm, pnpm, bun)

No lock-in by design

We Laravel developers have our habits and I don't wish to break them. Frank is designed to be used to as much as you like, even for solely installing a fresh new Sail project:

frank new my-app --sail
Enter fullscreen mode Exit fullscreen mode

And that's it!

You can also import a sail configuration and export one.

You may "adopt" Frank in any Laravel 12+ project with a simple frank setup, via interactive prompts or flags.

Limited dependencies

Besides Docker, I tried hard to keep external dependencies low. That's why I chose Go so I can ship a single binary on "any" platform (UNIX-like at least).

My personal choice for lefthook may not be yours, as well as other tools here. You can stay clear of these tools via frank.yml or interactive setups.

However, I recommend installing mkcert and lefthook. I use lefthook as my local CI (which modifies my code directly, except for PHPstan) so that coding with an agent makes them fox stuff directly.

For now, you will need either Brew or Go locally installed.

OS compatibility

Frank is solely developed and tested on Linux. No planned dedicated Windows support besides WSL. Mac support via Brew or Go, but didn't test much. So if you run into trouble please create an issue.

Ending notes

Frank's main objective is to be simple, intuitive and unobstrusive.

I currently use Frank for professional projects and is under active development, besides already versioned at 1.10.7 at the time of this post.

However, shamefully, I never managed to test FrankenPHP on a live server so I'm certain Frank is missing a few tweaks to make FrankenPHP support better. I would love some help there :)

Thank you for reading!

Link to the repo: https://github.com/phlisg/frank

Top comments (0)