Skip to content

Commit

Permalink
[v4.2.0] Double-checked installed services and overhauled README.md (#14
Browse files Browse the repository at this point in the history
)
  • Loading branch information
GoodM4ven authored May 8, 2024
2 parents 83e0b4f + 049fb27 commit 73b880c
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 67 deletions.
138 changes: 79 additions & 59 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,54 +5,57 @@

## Introduction

Laravel Sail's [DevContainer](https://laravel.com/docs/sail#using-devcontainers) 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](https://tallstack.dev/) development <u>***locally***</u>.
Laravel Sail's [DevContainer](https://laravel.com/docs/sail#using-devcontainers) 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](https://tallstack.dev/) development <u>***locally***</u>...

With this setup, I don't have to worry about the things I've mentioned, plus I gain the following advantages too:
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 step is documented or sectioned through organized scripts; I hope.
- Packages, and native apps development soon enough, are just natural when having most of the tools installed out of boxes!
- 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](https://nativephp.com) 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](https://herd.laravel.com) 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. `(╬ Ò﹏Ó)`

### Tech Stack List

- Packages
- [git](https://github.com/git/git)
- [curl](https://github.com/curl/curl)
- **[php](https://www.php.net/)**
- **[apache2](https://httpd.apache.org/)**
- Active
- [git](https://github.com/git/git)
- [gt](https://graphite.dev/) [@withgraphite/graphite-cli@stable]
- [curl](https://github.com/curl/curl)
- **[php](https://www.php.net/)**
- [npm](https://nodejs.org/) (Until all package migrates away!)
- **[bun](https://bun.sh)** (Opinionated)
- **[composer](https://getcomposer.org/)**
- [mkcert](https://github.com/FiloSottile/mkcert) (Requires `mkcert -install` to be ran manually **once** after the setup script)
- [expose](https://expose.dev/docs) (Installed if `EXPOSE_TOKEN` is provided in [`.env`] file. Use `expose share https://[site-name].test` to work properly)
- Passive
- [libnss3-tools](https://packages.ubuntu.com/focal/libnss3-tools)
- [ghostscript](https://ghostscript.readthedocs.io)
- [ffmpeg](https://github.com/FFmpeg/FFmpeg)
- [php-curl](https://www.php.net/manual/en/book.curl.php)
- [php-xml](https://www.php.net/manual/en/refs.xml.php)
- [php-dom](https://www.php.net/manual/en/book.dom.php)
- [php-bcmath](https://www.php.net/manual/en/book.bc.php)
- [php-zip](https://www.php.net/manual/en/book.zip.php)
- [php-imagick](https://www.php.net/manual/en/book.imagick.php)
- [php-gd](https://www.php.net/manual/en/book.image.php)
- [php-xdebug](https://xdebug.org/)
- [php-mysql](https://www.php.net/manual/en/book.mysql.php)
- [php-sqlite3](https://www.php.net/manual/en/book.sqlite3.php)
- [php-memcached](https://www.php.net/manual/en/book.memcached.php)
- [firacode](https://github.com/tonsky/FiraCode)

- Services
- [apache2](https://httpd.apache.org/)
- [sqlite3](https://www.sqlite.org/index.html)
- **[npm](https://www.npmjs.com/)**
- [ghostscript](https://ghostscript.readthedocs.io)
- [ffmpeg](https://github.com/FFmpeg/FFmpeg)
- [google-chrome-stable](https://www.google.com/chrome/)
- **[bun](https://bun.sh)**
- **[composer](https://getcomposer.org/)**
- [mkcert](https://github.com/FiloSottile/mkcert)
- [libnss3-tools](https://packages.ubuntu.com/focal/libnss3-tools)

- PHP Extensions
- [php-curl](https://www.php.net/manual/en/book.curl.php)
- [php-xml](https://www.php.net/manual/en/refs.xml.php)
- [php-dom](https://www.php.net/manual/en/book.dom.php)
- [php-bcmath](https://www.php.net/manual/en/book.bc.php)
- [php-zip](https://www.php.net/manual/en/book.zip.php)
- [php-imagick](https://www.php.net/manual/en/book.imagick.php)
- [php-gd](https://www.php.net/manual/en/book.image.php)
- [php-xdebug](https://xdebug.org/)
- [php-mysql](https://www.php.net/manual/en/book.mysql.php)

- Bun Packages
- [@withgraphite/graphite-cli@stable](https://graphite.dev/)

- Passive Services
- [redis-server](https://redis.io/) (port 6379)
- [mysql-server](https://www.mysql.com/) (port 3306)
- [memcached](https://memcached.org/) (port 11211)
- [mailpit](https://github.com/axllent/mailpit) (http://localhost:8025)
- [minio](https://min.io/) (http://localhost:9000)

- Active Services
- [expose](https://expose.dev/docs) (Installed if `EXPOSE_TOKEN` is provided in [.env] file. Use `expose share https://[site-name].test` to work properly)
- Applications
- [google-chrome-stable](https://www.google.com/chrome/) (Required for Laravel Dusk, sadly!)


## Installation
Expand All @@ -62,7 +65,7 @@ With this setup, I don't have to worry about the things I've mentioned, plus I g
cd ~/Downloads && unzip ./lara-stacker-x.x.x.zip -d ./ && cd lara-stacker-x.x.x
```

- Create a [[.env](./.env)] file from the [[.env.example](./.env.example)] one and fill in its content; replacing the `<placeholders>`.
- Create a [[`.env`](./.env)] file from the [[`.env.example`](./.env.example)] one and fill in its content; replacing the `<placeholders>`.
```bash
cp .env.example .env && nano .env
```
Expand All @@ -72,55 +75,72 @@ With this setup, I don't have to worry about the things I've mentioned, plus I g
chmod +x ./lara-stacker.sh && sudo ./lara-stacker.sh
```

- Choose to [**setup**](./scripts/setup.sh) your Ubuntu environment first, which will install everything necessary for local PHP development, and eventually create a [done-setup.flag] file in the directory.
- Choose to [**setup**](./scripts/setup.sh) 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**](./scripts/TALL/create.sh) project through its management section, then continue onwards with the installed [TALL-Stacker](https://github.com/GoodM4ven/tall-stacker) package via its Artisan command.
- Create a [**TALL**](./scripts/TALL/create.sh) project through its management section, then continue onwards with the installed [TALL-Stacker](https://github.com/GoodM4ven/tall-stacker) package via its Artisan command (soon™).
- Or just create a [**raw**](./scripts/create_raw.sh) Laravel one, instead.
- You can also [**import**](./scripts/TALL/import.sh) an already existing project into the same setup.
- You can also [**import**](./scripts/TALL/import.sh) 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](./.env)] file.
> If you want to debug the process or display all output during the scripts, change the `LOGGING_LEVEL` variable in your [[`.env`](./.env)] file.
## Notes
## Before Production
### Opinionated Modifications
- If you'd provided an Expose token, reset [app/Http/Middleware/TrustedProxies.php]'s property to `protected $proxies;`.
- `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](./files/.opinionated/.prettierrc) to projects)
- Adding Bash aliases to the user's [`~/.bashrc`] file:
```bash
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
```

### Before Production

## Todos For Development:
- If you had provided an Expose token, remove the project [bootstrap/app.php]'s middleware `trust` configuration.
- [ ] Open VSC (or [Codium](https://vscodium.com/)) if available
- [ ] Consider `phpredis` extension instead of `predis` for both setup and creation scripts
- [ ] Find a consistant fix for `$USERNAME` env-variable
- [ ] Automate the `mkcert` installation command during setup script without password
- [ ] Turn the main skeleton scripter into a NativePHP app or hard-code a specific `PHP_VERSION` maybe
## Development
## Credits
There is [another package](https://github.com/VPremiss/TALL-Stacker) on the way to complement tall-stack packages installation; soon, (in sha' allah)...

- ( [Tech Stack List](#tech-stack-list) )
### Changelogs

- ( [VSC Extensions](./files/.opinionated/extensions.md) )
> [!TIP]
> The best way to deal with workspace settings or extensions is to separate them into their own "TALL" or "Laravel" VSC Profile.
You can check out the package's [changelogs](https://app.whatthediff.ai/changelog/github/GoodM4ven/lara-stacker) online via WTD.
> [!NOTE]
> Feel free to take a look at my VSC [settings](./.opinionated/settings.json), [keybindings](./.opinionated/keybindings.json), and their complete [extension list](./.opinionated/extensions.md) as well.
### Progress
- ( [Contributers](https://github.com/GoodM4ven/lara-stacker/graphs/contributors) )
You can also checkout the project's roadmap from [here](https://github.com/users/GoodM4ven/projects/2/views/1).


## Support

Support the maintenance as well as the development of [other projects](https://github.com/sponsors/GoodM4ven) through sponsorship or one-time [donations](https://github.com/sponsors/GoodM4ven?frequency=one-time&sponsor=GoodM4ven).
Support ongoing package maintenance as well as the development of **other projects** through [sponsorship](https://github.com/sponsors/GoodM4ven) or one-time [donations](https://github.com/sponsors/GoodM4ven?frequency=one-time&sponsor=GoodM4ven) if you prefer.

And may Allah accept your strive; aameen.

### License

This package is open-sourced software licensed under the [MIT license](LICENSE.md).

## Changelogs
### Credits

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
- [ChatGPT](https://chat.openai.com)
- [Graphite](https://graphite.dev)
- [Laravel](https://github.com/Laravel)
- [Spatie](https://github.com/spatie)
- [BeyondCode](https://beyondco.de)
- [The Contributors](../../contributors)
- All the [technologies](#tech-stack-list) used to set up this whole development environment...
- And the generous individuals that we've learned from and been supported by throughout our journey...
<div align="center">
Expand Down
10 changes: 2 additions & 8 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ fi
echo -e "\nInstalling system packages..." >&3

if $cancel_suppression; then
sudo apt install git curl php apache2 php-curl php-xml php-dom php-bcmath php-zip sqlite3 php-sqlite3 -y 2>&1
sudo apt install git curl php apache2 php-curl php-xml php-dom php-bcmath php-zip sqlite3 php-sqlite3 npm -y 2>&1
else
sudo apt install git curl php apache2 php-curl php-xml php-dom php-bcmath php-zip sqlite3 php-sqlite3 -y 2>&1 >/dev/null
sudo apt install git curl php apache2 php-curl php-xml php-dom php-bcmath php-zip sqlite3 php-sqlite3 npm -y 2>&1 >/dev/null
fi

# ? Dynamically get the PHP version
Expand Down Expand Up @@ -188,12 +188,6 @@ fi
EOF

echo -e "\nInstalled Graphite version control CLI." >&3
else
if $cancel_suppression; then
sudo apt install npm -y 2>&1
else
sudo apt install npm -y 2>&1 >/dev/null
fi
fi

# ? Install Composer (globally)
Expand Down

0 comments on commit 73b880c

Please sign in to comment.