Skip to content

Mohfazam/BookIt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 

Repository files navigation

🧭 BookIt

BookIt is a full-stack experience booking platform that allows users to browse experiences, view available slots, apply promo codes, and confirm bookings. It's built with Next.js, Express.js, and Prisma, offering a seamless and responsive experience.


🚀 Features

  • 🏝️ Browse and explore curated experiences
  • 🗓️ View available slots by date and time
  • 💰 Apply promo codes for discounts
  • 📦 Real-time slot availability updates
  • 🔐 Secure booking flow

🧩 Tech Stack

Frontend: Next.js, TypeScript, Tailwind CSS
Backend: Express.js, Prisma, Node.js
Database: PostgreSQL
Deployment: Vercel (Frontend) + Render / Railway (Backend)


⚙️ Project Setup

1️⃣ Clone the repository

git clone https://github.com/Mohfazam/BookIt.git
cd BookIt

2️⃣ Backend Setup

cd backend
npm install

Create a .env file in the backend folder:

DATABASE_URL="postgresql://<username>:<password>@localhost:5432/bookit"

Generate Prisma client and start the server:

npx prisma generate
npm run dev

3️⃣ Frontend Setup

cd ../frontend
npm install
npm run dev

The frontend will run on http://localhost:3000


🧱 Folder Structure

BookIt/
├── backend/
│   ├── prisma/
│   ├── src/
│   │   ├── routes/
│   │   └── index.ts
│   ├── package.json
│   └── .env
│
└── frontend/
    ├── src/
    │   ├── app/
    │   ├── components/
    │   └── lib/
    ├── package.json
    └── .env.local

🔗 API Endpoints

Public Endpoints

Method Endpoint Description
GET /api/public/experiences Fetch all experiences
GET /api/public/experiences/:id Fetch single experience details
GET /api/public/promos/:code Validate a promo code

Booking Endpoints

Method Endpoint Description
POST /api/book Create a booking

🧠 Promo Code Logic

  • Each promo has a code (SAVE10, FLAT100)
  • Can be percentage-based or flat value
  • Automatically checks validity and status before applying

🧑‍💻 Developer

Mohammed Sarwar Khan


📦 Deployment


Method Endpoint Description Access
GET /api/experiences Fetch all experiences (title, image, description, price, etc.) Public
GET /api/experiences/:id Fetch details of a single experience (with available slots) Public
POST /api/bookings Create a new booking (with user details, selected slot, and promo code if applicable) Public
POST /api/promo/validate Validate a promo code (e.g., SAVE10, FLAT100) Public

🔒 Developer-Only Endpoints (For Seeding / Admin Use)

Method Endpoint Description Access
POST /api/dev/experiences Add a new experience with title, image, description, price, location, etc. Developer Only - ✅
POST /api/dev/slots Add available date and time slots for a specific experience Developer Only
POST /api/dev/promos Add or update promo codes (type: percentage or flat discount) Developer Only

About

BookIt is a full-stack experience booking platform that allows users to browse experiences, view available slots, apply promo codes, and confirm bookings. It's built with Next.js, Express.js, and Prisma, offering a seamless and responsive experience.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages