https://github.com/dacrab/beauty-salon-scheduling-api
Beauty Salon Scheduling API (Laravel 12, Docker, Nginx, SQLite). Endpoints: slots, book, cancel. Bearer auth. Seeders + tests.
https://github.com/dacrab/beauty-salon-scheduling-api
docker laravel nginx php rest-api sqlite
Last synced: 3 months ago
JSON representation
Beauty Salon Scheduling API (Laravel 12, Docker, Nginx, SQLite). Endpoints: slots, book, cancel. Bearer auth. Seeders + tests.
- Host: GitHub
- URL: https://github.com/dacrab/beauty-salon-scheduling-api
- Owner: dacrab
- Created: 2025-09-16T11:10:10.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2026-03-02T21:03:50.000Z (3 months ago)
- Last Synced: 2026-03-02T23:31:36.567Z (3 months ago)
- Topics: docker, laravel, nginx, php, rest-api, sqlite
- Language: PHP
- Homepage:
- Size: 229 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Beauty Salon API
Simple REST API for a beauty salon scheduling system built with Laravel 12. Fully containerized (Nginx + PHP-FPM) and ready to run with Docker.
## Quick Start (Docker)
1) Clone and enter the project
```bash
git clone https://github.com/dacrab/beauty-salon-scheduling-api.git
cd beauty-salon-scheduling-api
```
2) Create env file and set API token
```bash
cp .env.example .env
echo "API_TOKEN=your-secret-api-token" >> .env
```
3) Start the stack
```bash
docker compose up --build -d
```
4) App key, migrate, and seed
```bash
docker compose exec app php artisan key:generate
docker compose exec app php artisan migrate:fresh --seed
```
Base URL: `http://localhost:8081`
## Authentication
All endpoints require a bearer token header:
```
Authorization: Bearer
```
## Endpoints
1) List available slots
```bash
curl -H "Authorization: Bearer " \
"http://localhost:8081/api/slots?date=2025-09-16&service_id=1&specialist_id=1"
```
2) Book an appointment
```bash
curl -X POST \
-H "Authorization: Bearer " \
-H "Content-Type: application/json" \
-d '{"date":"2025-09-16","service_id":1,"specialist_id":1,"start_time":"14:30"}' \
"http://localhost:8081/api/book"
```
3) Cancel an appointment
```bash
curl -X DELETE -H "Authorization: Bearer " \
"http://localhost:8081/api/appointments/5"
```
## Tests
```bash
docker compose exec app php artisan test
```
## Reminder Command (bonus)
Simulates sending reminders for appointments starting in ~3 hours. Writes to `storage/logs/laravel.log`.
```bash
docker compose exec app php artisan appointments:send-reminders
```
## Assumptions
- Working hours: 09:00–18:00
- Slot starts every 30 minutes
- SQLite for portability
- Appointments are canceled via a `canceled` flag (not deleted)
## Project Structure (short)
```
app/ # Controllers, Middleware, Models
database/ # Migrations, seeders, SQLite file
docker/ # Nginx + PHP-FPM config
routes/ # API routes and console commands
tests/Feature/ # Feature tests for booking flow
docker-compose.yml # Services (app, web)
```