Skip to content
BillyMwangiDevPublic

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

QRify - Enterprise Event Ticketing Platform

QRify Logo Django Python License

A production-ready, enterprise-grade event ticketing and QR validation platform built with Django.

Features • Problem Statement • Quick Start • Architecture


Overview

QRify is a comprehensive event ticketing solution that combines secure QR code generation, cryptographic ticket signing, real-time analytics, and mobile payment integration. Built for event organizers who need enterprise-level reliability with developer-friendly APIs.

Key Highlights

  • Cryptographically Signed Tickets - Prevent fraud with tamper-proof QR codes
  • Real-time Analytics - Track sales, revenue, and attendance instantly
  • M-Pesa Integration - Accept mobile payments with STK Push
  • Bulk Operations - Generate hundreds of tickets via CSV upload
  • Modern UI - Beautiful dark-mode interface with HTMX interactivity
  • Docker Ready - Full containerization for easy deployment
  • REST API - Complete API with OpenAPI documentation

Problem Statement

The Challenge

Event organizers face significant challenges in managing ticketing operations:

  1. Ticket Fraud & Duplication: Traditional paper tickets and simple QR codes are easily forged or duplicated, leading to revenue loss and security concerns.

  2. Manual Processes: Bulk ticket generation and distribution require tedious manual work, consuming valuable time and resources.

  3. Payment Friction: Limited payment options, especially in mobile-first markets, create barriers to ticket sales.

  4. Lack of Real-time Insights: Organizers struggle to track sales performance, attendance patterns, and revenue in real-time.

  5. Fragmented Systems: Using multiple disconnected tools for ticketing, payments, analytics, and validation creates operational complexity.

Our Solution

QRify addresses these challenges by providing:

  • Cryptographic Security: Each ticket is cryptographically signed using Django's Signer, making forgery mathematically infeasible.
  • Automated Workflows: Bulk ticket generation via CSV upload with automated email delivery.
  • Integrated Payments: Built-in M-Pesa STK Push for seamless mobile payments.
  • Unified Dashboard: Single platform for event creation, ticket management, sales tracking, and check-in validation.
  • Developer-Friendly: REST API with comprehensive documentation for custom integrations.

Technology Stack

Backend Technologies

Technology Version Purpose
Python 3.11+ Core programming language
Django 5.0+ Web framework and ORM
Django REST Framework 3.14+ API development
PostgreSQL 14+ Production database
Redis 6+ Caching and message broker
Celery 5.3+ Asynchronous task processing
Gunicorn 21+ WSGI HTTP server

Frontend Technologies

Technology Purpose
Django Templates Server-side rendering
HTMX Dynamic interactions without heavy JS
Tailwind CSS Utility-first styling
Heroicons SVG icon library

Security & Authentication

Technology Purpose
Django Signer Cryptographic ticket signing
JWT (Simple JWT) API authentication
UUID Primary keys for enhanced security
django-ratelimit Rate limiting protection

DevOps & Deployment

Technology Purpose
Docker Containerization
Docker Compose Multi-container orchestration
Nginx Reverse proxy (recommended)
Git Version control

Third-Party Integrations

Service Purpose
M-Pesa Daraja API Mobile payment processing
SMTP (Gmail/SendGrid) Email delivery
Segno QR code generation
pyzbar QR code decoding

System Architecture

Entity Relationship Diagram (ERD)

erDiagram
    User ||--o{ Organization : "belongs to"
    Organization ||--o{ Event : "organizes"
    Event ||--o{ TicketTier : "has"
    Event ||--o{ Ticket : "generates"
    TicketTier ||--o{ Ticket : "categorizes"
    Ticket ||--o{ CheckInLog : "validates"
    User ||--o{ CheckInLog : "performs"

    User {
        uuid id PK
        string username
        string email
        string password_hash
        datetime created_at
    }

    Organization {
        uuid id PK
        string name
        string contact_email
        datetime created_at
    }

    Event {
        uuid id PK
        uuid organizer_id FK
        string title
        text description
        datetime start_datetime
        datetime end_datetime
        string location
        boolean is_published
        datetime created_at
    }

    TicketTier {
        uuid id PK
        uuid event_id FK
        string name
        decimal price
        int total_quantity
        int sold_quantity
        datetime created_at
    }

    Ticket {
        uuid id PK
        uuid event_id FK
        uuid tier_id FK
        string attendee_name
        string attendee_email
        string signed_token
        image qr_code_image
        boolean is_used
        datetime created_at
    }

    CheckInLog {
        uuid id PK
        uuid ticket_id FK
        uuid scanned_by_id FK
        datetime scanned_at
        string location
    }
Loading

Use Case Diagram

graph TB
    subgraph "Event Organizer"
        O[Organizer]
    end
    
    subgraph "Attendee"
        A[Attendee]
    end
    
    subgraph "Scanner/Staff"
        S[Staff Member]
    end
    
    subgraph "QRify System"
        UC1[Create Event]
        UC2[Manage Ticket Tiers]
        UC3[Generate Bulk Tickets]
        UC4[View Analytics Dashboard]
        UC5[Purchase Ticket]
        UC6[Pay via M-Pesa]
        UC7[Receive QR Ticket]
        UC8[Scan QR Code]
        UC9[Validate Ticket]
        UC10[Generate Public QR]
        UC11[Decode QR Image]
    end
    
    O --> UC1
    O --> UC2
    O --> UC3
    O --> UC4
    O --> UC8
    
    A --> UC5
    A --> UC6
    A --> UC7
    A --> UC10
    A --> UC11
    
    S --> UC8
    S --> UC9
    
    UC1 --> UC2
    UC2 --> UC3
    UC5 --> UC6
    UC6 --> UC7
    UC8 --> UC9
Loading

System Flow Diagram

graph LR
    A[User Browser] --> B[Nginx Reverse Proxy]
    B --> C[Django/Gunicorn]
    C --> D[PostgreSQL Database]
    C --> E[Redis Cache]
    C --> F[Celery Workers]
    F --> E
    F --> G[Email Service]
    C --> H[M-Pesa API]
    C --> I[Static Files]
Loading

User Stories

Epic 1: Event Management

As an event organizer, I want to:

  1. Create and publish events with detailed information (title, description, date, location)
  2. Define multiple ticket tiers (VIP, General, Early Bird) with different pricing
  3. Edit event details and ticket availability before and after publication
  4. Unpublish events if needed to prevent further ticket sales

Acceptance Criteria:

  • Events can be created with all required fields
  • Ticket tiers can be added, edited, and removed
  • Published events are visible to potential attendees
  • Unpublished events are hidden from public view

Epic 2: Ticket Generation & Distribution

As an event organizer, I want to:

  1. Generate individual tickets for walk-in customers
  2. Upload a CSV file with attendee details to generate bulk tickets
  3. Automatically email QR code tickets to attendees
  4. Download tickets as PDF for printing

Acceptance Criteria:

  • Single ticket generation completes in under 2 seconds
  • Bulk upload processes 100+ tickets within 5 minutes
  • Each ticket has a unique, cryptographically signed QR code
  • Emails are delivered within 10 minutes of generation

Epic 3: Payment Processing

As an attendee, I want to:

  1. Purchase tickets using M-Pesa mobile money
  2. Receive an STK Push notification on my phone
  3. Complete payment without leaving the platform
  4. Receive my ticket immediately after successful payment

Acceptance Criteria:

  • M-Pesa STK Push is initiated within 3 seconds
  • Payment status is updated in real-time
  • Tickets are generated only after confirmed payment
  • Failed payments show clear error messages

Epic 4: Ticket Validation

As a venue staff member, I want to:

  1. Scan QR codes using a mobile device or scanner
  2. Instantly see if a ticket is valid, already used, or fraudulent
  3. View attendee details upon successful validation
  4. Prevent duplicate entry with the same ticket

Acceptance Criteria:

  • QR scan validation completes in under 1 second
  • Invalid/forged tickets are clearly flagged
  • Already-used tickets cannot be scanned again
  • Check-in logs are recorded with timestamp and location

Epic 5: Analytics & Reporting

As an event organizer, I want to:

  1. View real-time sales statistics on my dashboard
  2. Track revenue by ticket tier
  3. Monitor attendance rates during the event
  4. Export sales reports for accounting purposes

Acceptance Criteria:

  • Dashboard updates in real-time as tickets are sold
  • Revenue calculations are accurate to 2 decimal places
  • Attendance tracking shows current vs. total capacity
  • Reports can be exported as CSV or PDF

Epic 6: Developer Integration

As a third-party developer, I want to:

  1. Access comprehensive API documentation
  2. Authenticate using JWT tokens
  3. Programmatically create events and generate tickets
  4. Receive webhook notifications for ticket sales

Acceptance Criteria:

  • API documentation is available at /api/docs/
  • JWT tokens are valid for 24 hours
  • All CRUD operations are supported via API
  • Webhooks deliver within 30 seconds of events

Features

For Event Organizers

Feature Description
Event Management Create, edit, and publish events with multi-tier pricing
Dashboard Analytics Real-time sales tracking, revenue reports, and attendance metrics
Bulk Ticket Issuance Upload CSV files to generate and email tickets automatically
QR Scanner Validate tickets at venue entrance with mobile scanner
Payment Processing Integrated M-Pesa STK Push for seamless mobile payments

For Developers

Feature Description
REST API Full-featured API with JWT authentication
OpenAPI Docs Interactive API documentation at /api/docs/
Webhooks Real-time event notifications (coming soon)
SDK Support Python SDK for easy integration

Security & Compliance

  • Cryptographic ticket signing with Django's Signer
  • UUID-based primary keys for enhanced security
  • Rate limiting on public endpoints
  • Environment-based configuration (12-factor app)
  • CORS and CSRF protection
  • Secure password hashing with Django defaults

Quick Start

Prerequisites

  • Python 3.11+
  • PostgreSQL 14+ (or SQLite for development)
  • Redis 6+ (for Celery)
  • Git

Installation

  1. Clone the repository

    git clone https://github.com/BillyMwangiDev/QRify.git
    cd QRify
  2. Create virtual environment

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install dependencies

    pip install -r requirements.txt
  4. Configure environment

    cp .env.example .env
    # Edit .env with your settings
  5. Run migrations

    python manage.py migrate
    python manage.py createsuperuser
  6. Start development server

    python manage.py runserver

Visit http://127.0.0.1:8000 to see the application.


Docker Deployment

Using Docker Compose (Recommended)

# Build and start all services
docker-compose up -d

# Run migrations
docker-compose exec web python manage.py migrate

# Create superuser
docker-compose exec web python manage.py createsuperuser

# View logs
docker-compose logs -f web

Services will be available at:


Project Structure

QRify/
├── apps/                      # Application modules
│   ├── core/                  # User authentication & base models
│   ├── events/                # Event management & ticketing
│   └── tools/                 # QR decoder and utilities
├── templates/                 # Django templates
│   ├── base.html             # Base template with navigation
│   ├── pages/                # Public pages
│   ├── events/               # Event management UI
│   └── registration/         # Auth pages
├── static/                    # Static assets (CSS, JS, images)
├── qrify/                     # Project settings
│   ├── settings.py           # Configuration
│   ├── urls.py               # URL routing
│   └── celery.py             # Async task configuration
├── docker-compose.yml         # Multi-container setup
├── Dockerfile                 # Production image
├── requirements.txt           # Python dependencies
└── manage.py                  # Django CLI

API Documentation

Interactive API documentation is available at:

Key Endpoints

Endpoint Method Description
/api/public/qr/ GET Generate public QR code
/api/v1/events/ GET, POST List and create events
/api/v1/scan/ POST Validate ticket QR code
/tools/decode/ GET, POST Decode QR image to text

Testing

# Run all tests
pytest

# Run with coverage
pytest --cov=apps --cov-report=html

# Run specific app tests
pytest apps/events/tests/

Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Development Guidelines

  • Follow PEP 8 style guide
  • Write tests for new features
  • Update documentation as needed
  • Use meaningful commit messages

License

This project is licensed under the MIT License - see the LICENSE file for details.


Acknowledgments

  • Built with Django
  • QR generation powered by segno
  • UI inspired by modern SaaS platforms
  • Icons from Heroicons

Support


Made with care by the QRify Team

Back to Top

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages