SmartSlot is a full-stack appointment booking platform built with Next.js. It supports two primary roles:
- Creators (businesses/providers) create appointment forms, generate slots, share booking links, and manage incoming bookings.
- Guests (customers) book available slots and view their booked appointments.
- Google-based authentication using Better Auth
- Creator dashboard for appointment forms
- Form builder with:
- title/description
- date and time window
- slot duration, gap, and count
- optional per-slot blocking
- active/inactive toggle
- Public booking page via shareable link (
/book?form=<slug>) - Slot reservation with conflict-safe booking flow
- Creator view of bookings per form
- Guest “My bookings” dashboard
- Phone-number capture after login
- Framework: Next.js (App Router), React, TypeScript
- Styling/UI: Tailwind CSS, shadcn-style UI components, Lucide icons, Framer Motion
- Auth: Better Auth (Google provider)
- Database: Neon Postgres + Drizzle ORM
- HTTP client: Axios
src/
app/
api/
appointments/
auth/[...all]/
bookings/me/
phone/
book/
bookings/
create/
login/
options/
components/ui/
db/
lib/
drizzle/
drizzle.config.ts
Create a .env file in the project root:
DATABASE_URL=
BETTER_AUTH_URL=http://localhost:3000
NEXT_PUBLIC_BETTER_AUTH_URL=http://localhost:3000
NEXT_PUBLIC_APP_URL=http://localhost:3000
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=DATABASE_URL: Postgres connection string (Neon)BETTER_AUTH_URL: server-side auth base URLNEXT_PUBLIC_BETTER_AUTH_URL: client-side auth base URLNEXT_PUBLIC_APP_URL: fallback origin for generated share linksGOOGLE_CLIENT_ID,GOOGLE_CLIENT_SECRET: Google OAuth credentials
npm installnpm run devOpen http://localhost:3000.
npm run lintnpm run build
npm run startDrizzle is configured via drizzle.config.ts and reads DATABASE_URL.
Common commands:
npx drizzle-kit generate
npx drizzle-kit migrate/– landing page/login– sign in/options– role selection and phone capture/create– creator dashboard/create/form– create appointment form and slots/create/bookings?slug=<slug>– creator bookings view for a form/book?form=<slug>– public booking page/bookings– guest’s booked slots
GET/POST /api/auth/[...all]– Better Auth handlerGET /api/phone– fetch current user phonePOST /api/phone– upsert current user phoneGET /api/appointments– list creator formsPOST /api/appointments– create form + slotsGET /api/appointments/[slug]– public form detailsGET /api/appointments/[slug]/slots– available slots (optional?date=YYYY-MM-DD)POST /api/appointments/[slug]/book– create bookingGET /api/appointments/[slug]/my-booking– current user booking for a formGET /api/appointments/[slug]/bookings– creator-only bookings for a formGET /api/bookings/me– all bookings for current guest
- Auth tables:
user,session,account,verification,phone_number - Booking tables:
appointment_formappointment_slotappointment_blocked_slotappointment_booking
- This project currently does not define automated test scripts in
package.json. - Authentication/session cookies are configured to be secure in production.