A full-stack car service booking platform built with Next.js, React, TypeScript, PostgreSQL, and Prisma.
The application allows customers to manage their vehicles, browse available automotive services, and create and track service bookings. Administrators can manage bookings and update their status throughout the service lifecycle.
- User registration and login
- Secure password hashing with
bcryptjs - Role-based access control
- User profiles
- Customer and administrator roles
Customers can:
- Add vehicles
- Store vehicle make, model, year, and color
- Store license plate and VIN information
- Manage multiple vehicles
- Associate vehicles with service bookings
The system supports configurable automotive services including:
- Oil changes
- Brake services
- Tire services
- Vehicle maintenance
- Other custom automotive services
Each service contains:
- Service name
- Description
- Category
- Price
- Estimated duration
- Active/inactive status
Customers can:
- Select a vehicle
- Select one or more services
- Schedule a service
- Add booking notes
- View booking details
- Track booking status
Bookings support the following statuses:
PendingApprovedRejectedIn ProgressCompletedCancelled
Administrators can manage the booking workflow and update booking statuses.
The system also supports administrator notes and stores the total booking price.
- Next.js 16
- React 19
- TypeScript
- Tailwind CSS
- Lucide React
- Next.js
- Node.js
- Prisma ORM
- PostgreSQL
bcryptjsfor password hashingjosefor authentication/token functionality- Role-based authorization
- ESLint
- TypeScript
- Prisma Studio
- npm
The project uses Prisma 7.9.1 and PostgreSQL, with database generation handled automatically during installation/build.
The application uses PostgreSQL with Prisma ORM.
User
โ
โโโ Vehicle
โ โ
โ โโโ Booking
โ โ
โ โโโ BookingService
โ โ
โ โโโ Service
โ
โโโ Booking
Stores customer and administrator accounts.
User
โโโ id
โโโ name
โโโ email
โโโ passwordHash
โโโ phone
โโโ role
โโโ createdAt
โโโ updatedAt
Stores customer vehicle information.
Vehicle
โโโ id
โโโ userId
โโโ make
โโโ model
โโโ year
โโโ color
โโโ licensePlate
โโโ vin
โโโ createdAt
Stores available automotive services.
Service
โโโ id
โโโ name
โโโ description
โโโ price
โโโ durationMinutes
โโโ category
โโโ isActive
โโโ createdAt
Stores customer service appointments.
Booking
โโโ id
โโโ userId
โโโ vehicleId
โโโ status
โโโ scheduledDate
โโโ notes
โโโ adminNotes
โโโ totalPrice
โโโ createdAt
โโโ updatedAt
Connects bookings with the services selected by the customer while preserving the service price at the time of booking.
This allows service prices to change later without changing historical booking records.
The database schema defines these relationships using Prisma and PostgreSQL.
booking-system/
โ
โโโ prisma/
โ โโโ schema.prisma
โ
โโโ src/
โ โโโ app/
โ โ โโโ dashboard/
โ โ โโโ login/
โ โ โโโ register/
โ โ โโโ ...
โ โ
โ โโโ components/
โ โ
โ โโโ db/
โ โ โโโ seed.ts
โ โ
โ โโโ generated/
โ โโโ prisma/
โ
โโโ .env.example
โโโ .gitignore
โโโ eslint.config.mjs
โโโ next.config.ts
โโโ package.json
โโโ postcss.config.mjs
โโโ prisma.config.ts
โโโ tsconfig.json
โโโ README.md
git clone https://github.com/ghost2468developer/booking-system.gitNavigate into the project:
cd booking-systemnpm installThe project's postinstall script automatically runs Prisma Client generation after installation.
Create a .env file in the root directory:
DATABASE_URL="postgresql://USERNAME:PASSWORD@localhost:5432/postgres"The repository includes a .env.example file with the expected PostgreSQL connection format.
โ ๏ธ Never commit your.envfile or database credentials to GitHub.
Make sure PostgreSQL is running, then run:
npm run db:pushThis synchronizes the Prisma schema with your PostgreSQL database.
To populate the database with sample services:
npm run db:seedYou can also use:
npm run seednpm run devThe application will be available at:
http://localhost:3000
| Command | Description |
|---|---|
npm run dev |
Start the development server |
npm run build |
Generate Prisma Client and build the application |
npm start |
Start the production server |
npm run lint |
Run ESLint |
npm run typecheck |
Run TypeScript type checking |
npm run db:push |
Push Prisma schema to the database |
npm run db:seed |
Seed the database |
npm run db:reset |
Reset the database and reseed |
npm run studio |
Open Prisma Studio |
These scripts are defined in the project's package.json.
The application currently supports two roles:
Customers can:
- Register and log in
- Manage their vehicles
- Browse services
- Create bookings
- View their bookings
- Track booking status
Administrators can:
- View bookings
- Manage booking statuses
- Add administrative notes
- Manage the booking workflow
The Prisma schema defines the available roles as admin and user.
A booking can move through the following lifecycle:
โโโโโโโโโโโ
โ Pending โ
โโโโโโฌโโโโโ
โ
โผ
โโโโโโโโโโโโ
โ Approved โ
โโโโโโฌโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโ
โ In Progress โ
โโโโโโโโฌโโโโโโโ
โ
โผ
โโโโโโโโโโโโโ
โ Completed โ
โโโโโโโโโโโโโ
A booking can also be:
Pending โ Rejected
Pending โ Cancelled
Approved โ Cancelled
This project demonstrates practical full-stack development concepts including:
- Full-stack application architecture
- Authentication and authorization
- Role-based access control
- Relational database design
- Prisma ORM
- PostgreSQL
- Database relationships
- Many-to-many relationships through join tables
- CRUD operations
- Booking state management
- Form handling
- Server-side functionality with Next.js
- Type-safe development with TypeScript
- Environment variable management
- Database seeding
- Responsive UI development
Potential improvements for future versions include:
- Email notifications for booking updates
- SMS notifications
- Online payments
- Customer booking cancellation/rescheduling
- Admin analytics dashboard
- Mechanic-specific accounts
- Mechanic assignment to bookings
- Service availability management
- Calendar-based scheduling
- Booking conflict prevention
- Customer reviews and ratings
- Invoice generation
- Service history per vehicle
- Automated testing
- CI/CD pipeline
- Production deployment
Add screenshots of the application here:
docs/
โโโ dashboard.png
โโโ booking.png
โโโ vehicles.png
โโโ services.png
โโโ login.png
Example:
Screenshots are highly recommended for portfolio projects because they allow recruiters to understand the application without running it locally.
Live Demo: Coming soon
GitHub Repository: https://github.com/ghost2468developer/booking-system