"First impressions start with a well-groomed haircut."
BarberPro is a production-ready, full-stack booking platform for barbershops. Customers pick a service, choose their favorite barber, and lock a real-time time slot in under a minute — while the owner manages everything from a premium admin dashboard with live stats, email & WhatsApp notifications.
🔗 Live demo: https://your-domain.vercel.app
- 🏠 Premium landing page with services, barber profiles & testimonials
- 💈 Real-time booking flow: service → barber → date → available slots
- 🚫 Fully-booked slots are automatically disabled (no double booking)
- 📧 Instant email confirmation (Resend)
- 📱 Mobile-first design that scales beautifully to desktop
- 🔐 Secure login (Supabase Auth) with server-side route protection
- 📊 Live dashboard: today's bookings, revenue estimate, busiest barber
- ✅ One-tap status management: confirm / complete / cancel
- 📲 WhatsApp notification for every new booking (Fonnte gateway)
| Layer | Technology |
|---|---|
| Framework | Next.js 16 (App Router, Server Actions, Server Components) |
| Language | TypeScript |
| Styling | Tailwind CSS v4 (custom design system, next/font) |
| Database | Supabase (PostgreSQL + Row Level Security + Auth) |
| Validation | Zod (server-side schema validation) |
| Resend | |
| Fonnte gateway | |
| Hosting | Vercel (auto CI/CD from GitHub) |
- Overlap-proof scheduling — a PostgreSQL
EXCLUDE ... USING gistconstraint withtstzrangemakes double-booked barbers impossible at the database level, not just in the UI. - Defense in depth — client validation for UX, Zod on Server Actions for security, and DB constraints as the final source of truth.
- Least-privilege data access — RLS policies per role, plus a
security definerRPC (get_booked_slots) that exposes only slot availability without leaking customer PII. - Failure isolation — a booking always commits even if email/WhatsApp
notifications fail (
Promise.allSettled). - Race-condition-safe UI —
useEffectcleanup prevents stale async responses from overwriting fresh slot data. - Timezone-correct by design — all times are stored as
timestamptzand computed with explicit WIB (+07:00) offsets, independent of server locale. - Two products, one codebase — marketing site, booking app, and admin panel are isolated via route groups with dedicated layouts.
services ──────┐
├──< bookings >──┐
barbers ───────┤ │
│ │ │
└──< working_hours │
│
auth.users ── (RLS: admin role) ┘
Full DDL, RLS policies, and seed data: database/schema.sql
git clone https://github.com/Rendyrta2405/BarberPro.git
cd BarberPro
npm install
# 1. Copy env template and fill in your keys
cp .env.example .env.local
# 2. Initialize the database
# → Supabase Dashboard → SQL Editor → run database/schema.sql
# 3. Create the admin account
# → Supabase Dashboard → Authentication → Add user (auto-confirm)
npm run devOpen http://localhost:3000.
Note (Android/Termux developers): Turbopack has no native bindings for
android/arm64. Thedev/buildscripts already include--webpack, sonpm run devworks out of the box on Termux.
- Push this repo to GitHub.
- Import it in Vercel (framework preset: Next.js).
- Add all variables from
.env.examplein Project → Settings → Environment Variables. - Deploy. Every push to
mainauto-deploys; other branches get preview URLs.
Optional: attach a custom domain in Vercel and verify it in Resend to unlock email delivery to any customer address.
src/
├── app/
│ ├── (marketing)/ # Landing site (hero, services, barbers, testimonials)
│ ├── (app)/ # Booking application (mobile app shell)
│ ├── (admin)/ # Admin dashboard & login
│ ├── layout.tsx # Root layout + fonts
│ └── globals.css # Design system (Tailwind v4 @theme)
├── components/ # UI components (cards, forms, stats)
└── lib/
├── supabase.ts # Browser/anon client
├── supabase-server.ts # Cookie-based server client
├── booking-actions.ts # Server Actions (create booking, slots)
├── admin-actions.ts # Server Actions (status updates)
├── auth-actions.ts # Login / logout
├── email.ts # Resend integration
├── whatsapp.ts # Fonnte integration
├── slots.ts # Time-slot engine
└── queries.ts # Shared data queries
database/
└── schema.sql # Full DDL + RLS + seed
- Real barber photos via Supabase Storage upload
- H-1 booking reminders (email + WhatsApp)
- Down payment (DP) with Midtrans
- Customer accounts & booking history
- Multi-outlet support
This entire project — every line of code, every database migration, every debug session — was built on an Android tablet using Termux and Acode. No laptop involved. Proof that shipping real products is about understanding, not hardware.
MIT — free to use for learning and commercial projects.
Built with ☕by Rafael.dev