Files
NextChair/README.md
T
2026-09-05 09:31:59 +01:00

79 lines
2.0 KiB
Markdown

# NextChair
NextChair is a multi-tenant, white-label booking platform for barbershops.
The application is being rebuilt as a conventional Laravel web application
using PHP, MySQL, Blade, Tailwind CSS, Alpine.js, and Vite.
The audited Next.js implementation is preserved in [`legacy-nextjs`](legacy-nextjs)
as the functional and visual migration reference. The Laravel application has
its own deployment-neutral Docker option at the repository root; files inside
`legacy-nextjs` are not used by it.
## Local development
```bash
composer install
cp .env.example .env
php artisan key:generate
npm install
npm run build
php artisan serve
```
Configure the MySQL connection in `.env` before running migrations. The
application resolves a business from the request hostname through the
`business_domains` table. Local development can use a configured local domain
or the `APP_DEFAULT_BUSINESS_SLUG` fallback.
## Docker deployment
The root `compose.yaml` runs Laravel with PHP 8.4 FPM, Nginx, MySQL 8,
the database-backed queue worker, and the scheduler. It does not include or
configure Caddy; an existing reverse proxy can forward traffic to Nginx on
`127.0.0.1:8085`.
First run:
```bash
cp .env.example .env
```
Set private values in `.env`, including:
```dotenv
APP_URL=http://localhost:8085
APP_KEY=
DB_HOST=db
DB_DATABASE=nextchair
DB_USERNAME=nextchair
DB_PASSWORD=replace-with-a-private-password
DB_ROOT_PASSWORD=replace-with-a-private-root-password
```
Then build and start the stack:
```bash
docker compose build
docker compose up -d
docker compose exec app php artisan key:generate
docker compose exec app php artisan migrate
```
Migrations are intentionally not run by container startup. To inspect the
application logs:
```bash
docker compose logs -f app nginx queue scheduler db
```
The default host binding is `127.0.0.1:8085:80`. Override it with
`NEXTCHAIR_HTTP_BIND` and `NEXTCHAIR_HTTP_PORT` in `.env` when needed. MySQL
has no published host port and is reachable only as `db:3306` inside Compose.
## Verification
```bash
php artisan test
npm run build
```