- Overview
- Problem
- Solution
- Architecture
- Tech Stack
- Key Features
- Data Model
- System Flow
- Core Concepts
- API Endpoints
- Admin Panel
- Real-Time Event Stats
- Project Structure
- Setup Guide
- System Preview
- Demo
- What This Project Demonstrates
Renegade Urban Winery is a production-ready event ticketing system built by extending WooCommerce into a fully functional event management platform.
Instead of building infrastructure from scratch, the system leverages WordPress for content and WooCommerce for payments, while introducing a custom backend layer for ticket generation, validation, and real-time event tracking.
The result is a system capable of handling real-world event logistics including secure ticket distribution, fraud prevention, and check-in management.
Traditional WooCommerce setups are not designed for:
- Event-based seat allocation
- Secure ticket validation
- Preventing duplicate ticket usage
- Real-time check-in tracking
This project solves those limitations by introducing a custom ticketing engine on top of WooCommerce.
A custom backend layer was introduced that handles:
- Ticket generation
- Seat allocation
- QR validation
- Check-in tracking
The system is divided into 3 layers:
1. WordPress (Base Layer)
- Content management (events)
- Admin interface
2. WooCommerce (E-commerce Layer)
- Payments via Stripe
- Order lifecycle
- Emails
3. Custom Backend (Core Logic)
- Ticket generation
- Seat allocation (transactions)
- QR validation
- REST API
- Unique ticket ID generation (
RW-XXXXXXX) - Automatic seat assignment per event
- Ticket creation triggered on WooCommerce order completion
- Multiple tickets per order supported
- Dynamic PDF generation using Dompdf
- Each ticket includes event details, seat number, and a unique QR code
- Automatically attached to the confirmation email
Each ticket contains a secure QR code encoding the ticket_id and a cryptographic HMAC hash.
Validation flow:
- Scan QR code
- Call REST API endpoint
- Verify hash integrity
- Check ticket status
- Mark ticket as used
Prevents duplicate entry and forged tickets.
- Hash-based validation using
hash_hmac - Prevents manual ticket ID manipulation
- Stateless verification via REST API
Custom database tables:
| Table | Purpose |
|---|---|
event_tickets |
Stores all generated tickets and their status |
event_checkins |
Records each check-in event |
event_seat_counter |
Tracks seat allocation per event |
Custom tables were chosen for better performance, transaction support, and relational structure.
1. User purchases ticket via WooCommerce
2. Order is completed
3. System generates:
βββ Unique ticket ID (RW-XXXXXXXX)
βββ Seat number (atomic allocation)
βββ HMAC hash (security layer)
βββ PDF Ticket
4. PDF ticket is emailed to the user
5. At the event:
βββ QR code is scanned
βββ REST API validates ticket + hash
βββ Ticket is marked as used
βββ Check-in is recorded
Format: RW-XXXXXXXX
Non-sequential, generated via wp_generate_password
Race conditions are prevented using database transactions with row locking:
SELECT ... FOR UPDATEEach QR code encodes:
ticket_id + HMAC hash
hash_hmac('sha256', ticket_id, secret)
Ticket consumption is a single atomic operation:
UPDATE tickets
SET status = 'used'
WHERE ticket_id = ? AND status = 'valid'GET /wp-json/rw-tickets/v1/verify
| Param | Type | Description |
|---|---|---|
ticket |
string | The ticket ID |
hash |
string | HMAC hash from QR code |
Response: valid / used / invalid
GET /wp-json/rw-tickets/v1/stats
Returns tickets sold, check-ins, and remaining capacity.
Custom admin panel for managing events and tickets:
- Event overview with live statistics
- Tracking: tickets sold, check-ins, remaining capacity
- Manual ticket controls: cancel / reset / delete a ticket
- QR Scanner built with
html5-qrcodeβ works directly in browser, no external device required
- Live ticket statistics via REST API
- Auto-refresh every 3 seconds
- Displays: total sold, checked-in users, remaining tickets
```text
wp-content/
β
βββ plugins/
β βββ rw-tickets/ # CORE SYSTEM (ticket generation, validation, seat allocation, REST API)
β β βββ tickets.php
β β
β βββ my-events-plugin/ # AJAX filtering logic for events (category, status, pagination)
β β βββ my-events-plugin.php
β β βββ event-filter.js
β β
β βββ advanced-custom-fields/ # Event metadata (date, location, product mapping)
β βββ woocommerce/ # E-commerce engine (orders, checkout, cart)
β βββ woocommerce-gateway-stripe/ # Stripe payment integration
β βββ custom-post-type-ui/ # UI for registering Event CPT and taxonomies
β βββ updraftplus/ # Backup and restore system for WordPress
β βββ wp-mail-smtp/ # SMTP email configuration (ensures ticket email delivery)
β βββ elementor/ # Page builder used for layout and UI composition
β
βββ themes/
βββ blocksy-child/
βββ functions.php # Theme hooks, WooCommerce overrides, ticket system integration
βββ archive-event.php # Event listing page (uses filtering, pagination, event cards)
βββ single-event.php # Single event page (details, gallery, purchase entry point)
βββ scanner.js # QR scanner frontend logic (admin ticket validation)
βββ event-gallery.js # Gallery interactions (lightbox, navigation, animations)
βββ css/
βββ events/ # Event pages styling (cards, layout, filters)
βββ woocommerce/ # Custom WooCommerce styling (checkout, cart, UI tweaks)
βββ style.css # Global theme styles
βββ tickets.css # Ticket-related UI (scanner, validation states)
βββ template-parts/
βββ event-card.php # Reusable event card component (used in listings)
βββ event-gallery.php # Dynamic gallery rendering + lightbox system
- PHP 8+
- MySQL
- WordPress (local or server)
- Composer (optional)
Download WordPress and place the project inside wp-content/.
- WooCommerce
- Advanced Custom Fields
- Custom Post Type UI (if used)
rw-tickets(custom)my-events-plugin(custom)
Set up Stripe payments, create a ticket product, and enable stock management.
Using ACF, fill in:
event_datelocationwoo_product(links product β event)
Go to WordPress Settings β Permalinks and set to /post-name/.
Required for the /verify-ticket/ route to work.
Tables are auto-created via register_activation_hook() on plugin activation:
event_ticketsevent_checkinsevent_seat_counter
Valid ticket β marked and consumed:
Used ticket β rejected:
Event overview and ticket statistics:
Manual ticket controls:
Automatic ticket delivery with PDF attachment:
| π¬ Full System Overview | https://www.youtube.com/watch?v=LSsF2rVEQ9k |
| π Ticket Purchase Flow | https://www.youtube.com/watch?v=TJwqHD2TgBI |
| π Live Demo | https://renegade-winary.infinityfreeapp.com/ |
| π PDF Documentation | https://renegade-winary.infinityfreeapp.com/Dokumentacija.pdf |
- Extending WordPress beyond a CMS into a custom application platform
- Designing custom data models with transaction support
- Building REST APIs inside WordPress
- Handling real-world backend logic: tickets, validation, concurrency
- Integrating multiple systems: payments, email, QR scanning, admin tools