A modern, full-stack appointment booking platform built with Next.js 16, featuring role-based access control, real-time availability management, and a beautiful Aurora Mint themed UI.
- Browse available services and providers
- View real-time availability slots
- Book appointments with preferred providers
- Manage and cancel bookings
- View booking history
- Set and manage availability blocks
- View incoming bookings
- Mark appointments as completed or cancelled
- Track booking history
- Manage services (create, update, deactivate)
- Approve/reject provider registrations
- View comprehensive audit logs
- System-wide oversight
| Category | Technology |
|---|---|
| Framework | Next.js 16 (App Router, Turbopack) |
| Language | TypeScript 5 |
| Styling | Tailwind CSS 4 (OKLCH colors) |
| Database | PostgreSQL with Prisma ORM 7 |
| Authentication | JWT (HTTP-only cookies) |
| UI Components | shadcn/ui, Lucide React icons |
| Theme | next-themes (Light/Dark mode) |
| Validation | Zod |
| API Docs | Swagger UI |
- Node.js 20+
- PostgreSQL 14+
- npm or yarn
-
Clone the repository
git clone https://github.com/Laksopan23/appointment-booking-system.git cd appointment-booking-system -
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env
Update
.envwith your database credentials:DATABASE_URL="postgresql://username:password@localhost:5432/bookme?schema=public" JWT_SECRET="your-super-secret-jwt-key-min-32-chars"
-
Set up the database
# Generate Prisma client npx prisma generate # Run migrations npx prisma migrate dev # Seed the database with sample data npx prisma db seed
-
Start the development server
npm run dev
-
Open your browser Navigate to http://localhost:3000
After seeding, you can use these accounts:
| Role | Password | |
|---|---|---|
| Admin | admin@gmail.com | password123 |
| Provider | sarah.johnson@gmail.com | password123 |
| Provider | john.smith@gmail.com | password123 |
appointment-booking-system/
βββ .github/
β βββ workflows/
β βββ ci.yml # CI/CD pipeline
βββ prisma/
β βββ schema.prisma # Database schema
β βββ migrations/ # Database migrations
β βββ seed.ts # Seed data
βββ src/
β βββ app/
β β βββ admin/ # Admin pages
β β βββ api/ # API routes
β β βββ auth/ # Authentication pages
β β βββ customer/ # Customer pages
β β βββ provider/ # Provider pages
β β βββ docs/ # API documentation
β β βββ globals.css # Aurora Mint theme
β β βββ layout.tsx # Root layout
β β βββ page.tsx # Landing page
β βββ components/
β β βββ ui/ # shadcn/ui components
β β βββ Navbar.tsx # Navigation bar
β β βββ PageShell.tsx # Page wrapper
β β βββ EmptyState.tsx # Empty state component
β βββ lib/
β β βββ db.ts # Prisma client
β β βββ http.ts # API helper
β β βββ utils.ts # Utility functions
β βββ server/
β βββ common/ # Shared server logic
β βββ bookings/ # Booking schemas
β βββ audit/ # Audit logging
βββ middleware.ts # Route protection
βββ package.json
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/register |
Register new user |
| POST | /api/auth/login |
Login user |
| POST | /api/auth/logout |
Logout user |
| GET | /api/auth/me |
Get current user |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/services |
List all services |
| POST | /api/services |
Create service (Admin) |
| PATCH | /api/services/:id |
Update service (Admin) |
| DELETE | /api/services/:id |
Soft delete service (Admin) |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/providers |
List approved providers |
| GET | /api/admin/providers |
List all providers (Admin) |
| PATCH | /api/admin/providers/:id |
Approve/reject provider |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/availability |
Get availability blocks |
| POST | /api/availability |
Create availability (Provider) |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/bookings |
List user's bookings |
| POST | /api/bookings |
Create booking (Customer) |
| PATCH | /api/bookings/:id/cancel |
Cancel booking |
| PATCH | /api/bookings/:id/status |
Update status (Provider) |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/slots |
Get available time slots |
π Full API documentation available at: /docs
BookMe uses an Aurora Mint theme with OKLCH colors for perceptual uniformity:
- Primary: Mint Teal (
oklch(0.65 0.15 175)) - Accent: Cyan (
oklch(0.7 0.15 195)) - Success: Green (
oklch(0.65 0.2 145)) - Warning: Amber (
oklch(0.75 0.15 75)) - Destructive: Red (
oklch(0.6 0.2 25))
Supports Light and Dark modes with smooth transitions.
# Development
npm run dev # Start dev server with Turbopack
# Production
npm run build # Build for production
npm run start # Start production server
# Code Quality
npm run lint # Run ESLint
npm run lint:fix # Fix ESLint issues
npm run typecheck # Run TypeScript compiler
# Validation
npm run validate # Run lint + typecheck + build
npm run security # Run npm audit
# Database
npx prisma generate # Generate Prisma client
npx prisma migrate dev # Run migrations
npx prisma db seed # Seed database
npx prisma studio # Open Prisma Studio GUI- JWT Authentication with HTTP-only cookies
- Role-based access control (Customer, Provider, Admin)
- Route protection via middleware
- Input validation with Zod schemas
- Audit logging for sensitive operations
- CSRF protection built-in
docker-compose up -d- Push to GitHub
- Import to Vercel
- Add environment variables
- Deploy
npm run build
npm run startThe project includes a GitHub Actions CI/CD pipeline that runs:
- π Lint & Code Quality - ESLint checks
- π· TypeScript Check - Type validation
- ποΈ Build - Production build verification
- π Security Audit - npm vulnerability scan
- ποΈ Prisma Validation - Schema checks
This project is private and proprietary.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'feat: Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
Built with β€οΈ using Next.js, TypeScript, and Tailwind CSS