Add Nix dev shell with local MariaDB and dev orchestration script

This commit is contained in:
kurogeek committed 2026-10-14 10:19:36 +00:00
1 parent 6f8c8d7dfa
commit c8b08fe258
5 files changed
+245

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
# think.greaterchiangmai.com
Two Laravel 10 apps sharing one MySQL database (`greaterc_db2024`):
- `think.greaterchiangmai.com/` — public site
- `think-backend.greaterchiangmai.com/` — CMS (`/login`)
- `upload-large-file/` — standalone S3 multipart upload helper (Node)
## Local development
Requires [Nix](https://nixos.org) with flakes (direnv optional: `.envrc` → `use flake`).
```sh
nix develop # php 8.3 + composer + mariadb + node on PATH
dev setup # composer install both apps, init MariaDB under .dev/
dev db import dump.sql # load a production dump — the article/category schema only exists in prod
dev up # http://127.0.0.1:8000 (site), http://127.0.0.1:8001 (CMS); Ctrl-C stops all
```
Other commands: `dev db start|stop|status|shell`, `dev serve frontend|backend`,
`dev artisan <app> ...`, `dev down`. See `dev help`.
The local DB listens on `127.0.0.1:3307` (override with `DEV_DB_PORT`); the `dev` script
injects `DB_*`, `APP_DEBUG=true`, `TEST_LOCAL=true` via the process environment so each
app's `.env` is left untouched. Ports: `DEV_FRONTEND_PORT`, `DEV_BACKEND_PORT`.