Laravel Sail's DevContainer setup is great, except when it relies on VSC and some weird extensions to keep up with; let alone Docker not outsmarting everybody! Meanwhile, I might as well just do my TALL stack development locally...
With this setup, one doesn't have to worry about the things I've mentioned, in addition to gaining the following advantages too:
- Performance boost on potatops.
- Running multiple sites at the same time and developing simultaneously, which is crazy creative when it comes to simple ideas here and there!
- Customizations such as SSL and 3rd party tools integration is way easier if you deal with it locally; and doesn't necessarily mean that you'd have a messy setup if every operation is managed through an organized script.
- Packages, and native apps development soon enough, are just natural when having most of the tools installed out of boxes!
And, yes, these are valid reasons considering that Laravel itself created Herd AFTER I started this pro- kidding, but for the record, I was actually first- just to offer this sort of setup on MacOS of all things! And then they ported it to bloody Windows. And when they're asked about Linux, they raised a huge middle f-lag. (╬ Ò﹏Ó)
-
Packages
- Active
- git
- gt [@withgraphite/graphite-cli@stable]
- curl
- php
- npm (Until all package migrates away!)
- bun (Opinionated)
- composer
- mkcert (Requires
mkcert -install
to be ran manually once after the setup script) - expose (Installed if
EXPOSE_TOKEN
is provided in [.env
] file. Useexpose share https://[site-name].test
to work properly)
- Passive
- Active
-
Services
- apache2
- sqlite3
- mysql-server (port 3306)
- memcached (port 11211)
- mailpit (http://localhost:8025)
- minio (http://localhost:9000)
-
Applications
- google-chrome-stable (Required for Laravel Dusk, sadly!)
-
Either download the project zipped, or
git clone
it. -
Extract the scripter somewhere and navigate into it:
cd ~/Downloads && unzip ./lara-stacker-x.x.x.zip -d ./ && cd lara-stacker-x.x.x
-
Create a [
.env
] file from the [.env.example
] one and fill in its content; replacing the<placeholders>
.cp .env.example .env && nano .env
-
Run the script with super-user permissions:
chmod +x ./lara-stacker.sh && sudo ./lara-stacker.sh
-
Choose to setup your Ubuntu environment first, which will install everything necessary for local Laravel development, and eventually create a [
done-setup.flag
] file in the directory. -
Then choose to either:
- Create a TALL project through its management section, then continue onwards with the installed TALL-Stacker package via its Artisan command (soon™).
- Or just create a raw Laravel one, instead.
- You can also import an already existing project into the same TALL setup.
That's it. You'll have your first project accessible in the end (displaying the site's URL too). And just praise Allah instead of wasting the waiting time! :)
Note
If you want to debug the process or display all output during the scripts, change the LOGGING_LEVEL
variable in your [.env
] file.
curl -fsSL https://bun.sh/install | bash
bun add -g @withgraphite/graphite-cli@stable
ln -s $projects_directory/
(Creating a shortcut for [/var/www/html
] directory in a [~/Code
] directory)sudo mkdir $projects_directory/.packages
(Creating a [/var/www/html/.packages
] directory)sudo cp $lara_stacker_dir/files/.opinionated/project.code-workspace ./$escaped_project_name.code-workspace
(Creating VSC workspaces on Desktop)sudo cp $lara_stacker_dir/files/.opinionated/.prettierrc ./.prettierrc
(Adding Prettier config files to projects)- Adding Bash aliases to the user's [
~/.bashrc
] file:echo -e "\n# Laravel Aliases\nalias cda='composer dump-autoload'\nalias art='php artisan'\nalias wipe='php artisan db:wipe'\nalias fresh='php artisan migrate:fresh'\nalias mfs='php artisan migrate:fresh --seed'\nalias opt='php artisan optimize:clear'\nalias dev='bun run dev'\n" >>/home/$USERNAME/.bashrc
- If you had provided an Expose token, remove the project [bootstrap/app.php]'s middleware
trust
configuration.
There is another package on the way to complement tall-stack packages installation; soon, (in sha' allah)...
You can check out the package's changelogs online via WTD.
You can also checkout the project's roadmap from here.
Support ongoing package maintenance as well as the development of other projects through sponsorship or one-time donations if you prefer.
And may Allah accept your strive; aameen.
This package is open-sourced software licensed under the MIT license.
- ChatGPT
- Graphite
- Laravel
- Spatie
- BeyondCode
- The Contributors
- All the technologies used to set up this whole development environment...
- And the generous individuals that we've learned from and been supported by throughout our journey...
والحمد لله رب العالمين