Skip to main content
Version: v0.16

Cinema Ticket Booking Tutorial

Build a cinema ticket booking system using Conduit's Database module.

Overview

We'll create schemas for:

  • Movies
  • Theaters
  • Showtimes
  • Bookings

Step 1: Create Movies Schema

  1. Go to Database > Schemas > Create New
  2. Name: Movies
  3. Add fields:
FieldTypeRequired
titleTextYes
descriptionTextNo
durationNumberYes
releaseDateDateNo
  1. Enable CRUD: Create (Auth), Read (Public)

Step 2: Create Theaters Schema

Name: Theaters

FieldTypeRequired
nameTextYes
locationTextYes
seatsNumberYes

Step 3: Create Showtimes Schema

Name: Showtimes

FieldTypeRequired
movieRelation (Movies)Yes
theaterRelation (Theaters)Yes
datetimeDateYes
priceNumberYes
availableSeatsNumberYes

Step 4: Create Bookings Schema

Name: Bookings

FieldTypeRequired
showtimeRelation (Showtimes)Yes
userRelation (Users)Yes
seatsNumberYes
totalPriceNumberYes

Usage

List Movies

curl 'http://localhost:3000/database/Movies'

Get Showtimes with Movie Details

curl 'http://localhost:3000/database/Showtimes?populate=movie,theater'

Create Booking

curl -X POST 'http://localhost:3000/database/Bookings' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"showtime": "showtimeId",
"seats": 2,
"totalPrice": 25.00
}'

Next Steps

  • Add validation with custom endpoints
  • Implement seat selection logic
  • Add payment integration