# Salon booking

An open-source online booking system for hair and beauty salons, built with Next.js 16, TypeScript and PostgreSQL. Clients pick a service, a stylist or anyone available and a real free time, then get a link to manage or cancel; staff run the diary, clients, time off, services and opening hours from a signed-in area.

- Framework: Next.js (JavaScript)
- Category: Apps / Booking and scheduling
- Creates: a server app and a PostgreSQL database on the Shared tier (1 GB)
- Plan: Lite or above
- Price: Free
- Author: Light Cloud
- Page: https://templates.light-cloud.com/apps/booking/salon-booking-app-template
- Updated: 2026-11-21

## Features

- Free times worked out from opening hours, each stylist's week, bookings plus clean-up buffers, time off and notice
- Each booking re-checks its slot in a transaction with a per-day lock, so two clients cannot take the same time
- Anyone available gives the booking to the free stylist with the least booked time that day
- A private manage link per booking, signed with AUTH_SECRET; online cancelling closes 24 hours before by default
- Staff diary with a day view of a column per stylist and a week view, time off and hours outside shifts shaded
- Clients matched by email, with visit history, total spent, no-shows and staff-only notes such as colour formulas
- Owner and staff roles: the first account is the owner and everyone else joins by a single-use invitation link
- HairSalon and FAQPage JSON-LD, sitemap.xml and /llms.txt from your salon's data; booking forms work without JavaScript

## What you need

- A paid plan: deploying creates a PostgreSQL database, which the Free plan does not include
- To run it locally: Node.js 22.12 or newer, npm, and Docker for a local PostgreSQL
- No API keys: it starts with nothing to configure
- Optional: RESEND_API_KEY and EMAIL_FROM to email confirmations and invitations; without them the manage link shows on screen

## About

Availability is a pure function in src/lib/availability.ts with no database or clock, so the booking rules are unit-tested on their own, and every booking write goes through src/lib/bookings.ts. Dates are stored as YYYY-MM-DD strings and times as minutes after midnight in the salon's own time zone, which keeps appointments right across clock changes. Most of what a salon changes needs no code: name, address, policies, booking rules, services, opening hours and stylists are edited under Staff, and Settings clears the demo clients, bookings and stylists while keeping the menu for you to edit. npm start applies the migrations and loads the demo salon once, and on Light Cloud each push to your copy redeploys.

## Variables

- `AUTH_SECRET`: generated

## Questions

### How does a salon booking app stop double bookings?

Every booking, online or by staff, goes through one function that takes a PostgreSQL advisory lock for that day, re-reads the diary and checks the time is still free before it writes. A second client confirming the same time is asked to pick another.

### Can clients book a salon appointment without creating an account?

Yes. Clients give their name, mobile number and email and get a private manage link instead of a password. Returning clients are matched by email, so the salon keeps one record per person.

### Does the salon booking app send confirmation emails?

With RESEND_API_KEY set, clients get a confirmation with their manage link and a note when they cancel, and staff get invitations and password resets. Without a key nothing is emailed: the confirmation page shows the manage link and the server log prints each email.

### Can I use it for a barber, nail or beauty salon?

Yes. Rename the categories and services under Staff, Services, add your stylists or therapists and their hours, and change the details in Settings. Booking rules such as the 15-minute start grid, 2 hours' notice and the cancellation window are in Settings too.

### Can I host this salon booking app without Light Cloud?

Yes. It is a standard Next.js app with no Light Cloud code: any host with Node.js 22.12 and PostgreSQL runs it with npm ci && npm run build and npm start, once DATABASE_URL and AUTH_SECRET are set.
