Skip to content

Commit

Permalink
Feat: Use bun over npm
Browse files Browse the repository at this point in the history
Feat: Readme updates
  • Loading branch information
nikspyratos committed Apr 7, 2024
1 parent 9eb2d33 commit 42e154c
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 3,642 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ Principles
- **Self-containment**: With minimal extra commands, you should be able to clone this repo and get something running.
- **Tiny but mighty**: Minimising the different technologies used, using simpler & standardised alternatives to common tools.
- **Don't reinvent the wheel**: Use as much of the official & unofficial Laravel ecosystem where applicable. Use popular (i.e. sustainable, gets regular updates) tools & packages where applicable instead of rewriting boilerplate logic from scratch. We're in Laravel, not JS!
- **Stability**: Strict types. Automated linting & code analysis
- **Quality code**: Strict types. Automated linting & code analysis
- **Simplified Scaling**: It's cheaper to scale with load balancing & bigger servers, and with minor manual input instead of full automation.
- **Local is lekker**: Sometimes, building your own features is better in the long run than adding more dependencies.
- **Bleeding edge**: Let's play around with the latest tools out there!

## Support this project

Expand Down Expand Up @@ -72,6 +72,7 @@ There were a few more features in the past, but for the aims of the project they
- **Testing**: [PestPHP](https://pestphp.com/)
- **Observability/Metrics**: [Laravel Pulse](https://laravel.com/docs/11.x/pulse) and [Laravel Telescope](https://laravel.com/docs/11.x/telescope)
- **Linting, Code Quality, Static Analysis**: [Duster](https://github.com/tighten/duster) for linting, with Pint configuration compatible with PHP Insights. [Rustywind](https://github.com/avencera/rustywind) for Tailwind classes. for Tailwind classes. [Larastan](https://github.com/nunomaduro/larastan), [PHP Insights](https://phpinsights.com/) with custom configuration focused on compatibility.
- **Asset bundling**: Bun is supported by default, otherwise this uses a standard Laravel installation of Vite & Tailwind.
- **CI/CD**: Good old Bash scripts.
- **Cache, queues, etc.**: For some "easy" scaling and portability with SQLite and database drivers, Cache, Queue, Pulse & Telescope have their own separate SQLite database connections. This should theoretically avoid any potential write issues if one of the databases needs more frequent writes than others, and makes the app a little more portable (e.g. you can retain your cache as easily as copying a file when moving server).

Expand Down Expand Up @@ -232,7 +233,7 @@ Your first step is to download your project repository from your VCS. Then, run
- Ask you for some basic environment variables (database credentials) and edit your `.env` accordingly. App name, domain & database name will be used from the values in your `.env` (i.e. from when you ran `init_dev.sh`).
- Install PHP (with service config and extensions), Caddy, and Supervisor
- Install the Octane, queue config for Supervisor
- Setup your app (composer & npm install, key generate, migrate, install crontab, etc.). All you need to do is modify your `.env` as needed.
- Setup your app (composer & bun install, key generate, migrate, install crontab, etc.). All you need to do is modify your `.env` as needed.

Once this is done, update your local `.env`'s `DEPLOYMENT_PATH` and Caddyfile's `APP_PATH` as prompted by the output. This is to enable the `deploy.sh` script to work and to keep your Caddyfile in line with the production version.

Expand Down Expand Up @@ -262,9 +263,7 @@ DEPLOYMENT_SSH_KEY=
To deploy the latest application changes, run `./bin/deploy.sh`. It will:

- SSH into your server using the variables above
- Run `git pull`, `composer install`, `npm install`, `npm run build`, and `php artisan migrate`.

If you're in a rush/need to throw hotfixes up, `bin/quick_deploy.sh` will only pull new code & reset the optimisation caches.
- Run `git pull`, `composer install`, `bun install`, `bun run build`, and `php artisan migrate`.

#### Troubleshooting

Expand Down
4 changes: 2 additions & 2 deletions bin/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ ssh -i $DEPLOYMENT_SSH_KEY $DEPLOYMENT_USER@$DEPLOYMENT_IP <<ENDSSH
cd $DEPLOYMENT_PATH
git pull
composer install --no-interaction --optimize-autoloader --no-dev
npm install
npm run build
bun install
bun run build
php artisan optimize:clear
php artisan schedule:clear-cache
php artisan optimize
Expand Down
4 changes: 2 additions & 2 deletions bin/init_dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ touch database/telescope.sqlite
touch database/activities.sqlite
git config --local include.path ../.gitconfig
composer update --no-interaction --prefer-dist --optimize-autoloader
npm update
npm run build
bun update
bun run build
php artisan ide-helper:eloquent
cp .env.example .env
php artisan key:generate
Expand Down
6 changes: 3 additions & 3 deletions bin/provision_prod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ sudo apt install -y php8.3 php8.3-event php8.3-gd php8.3-intl php8.3-curl php8.3
sudo apt-get install -y
sudo mkdir /etc/systemd/service
sudo systemctl daemon-reload
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo bash -
curl -fsSL https://bun.sh/install | bash
# Application
echo "Setting up application";sleep 1;
composer install --no-interaction --optimize-autoloader --no-dev
npm install
npm run build
bun install
bun run build
php artisan key:generate
php artisan migrate --force --seed
php artisan storage:link
Expand Down
17 changes: 0 additions & 17 deletions bin/quick_deploy.sh

This file was deleted.

Binary file added bun.lockb
Binary file not shown.
Loading

0 comments on commit 42e154c

Please sign in to comment.