Skip to content

ahmed123456787/ticket-event

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽซ Event Ticketing System ๐ŸŽŸ๏ธ

Django DRF GraphQL License

A full-featured event ticketing platform backend built with Django, allowing organizers to create events and visitors to purchase tickets with QR code functionality.

Django Python GraphQL

โœจ Features

๐Ÿ‘ฅ User Management Multi-role system (Admin, Organizer, Visitor)
๐Ÿ—“๏ธ Event Management Create, update, and delete events
๐ŸŽŸ๏ธ Ticket System Purchase, verify, and check-in with QR codes
๐Ÿ“ง Email Notifications Send ticket confirmations with embedded QR codes
๐Ÿ”” Real-time Notifications WebSocket-based event reminders
๐Ÿ“Š Analytics Track event views, purchases, and other interactions
๐Ÿ” GraphQL API Flexible data querying and manipulation
๐ŸŒ REST API Standard RESTful endpoints for events and tickets

๐Ÿ› ๏ธ Tech Stack

๐Ÿงฐ Backend Framework
  • ๐ŸŸข Django 5.2.1
  • ๐Ÿ”ด Django REST Framework 3.16.0
  • ๐ŸŸฃ Graphene (GraphQL) 3.4.3
๐Ÿ” Authentication
  • ๐Ÿ”‘ Django OAuth Toolkit
  • ๐Ÿ”“ djangorestframework-simplejwt
  • ๐Ÿ‘ค Social Authentication
๐Ÿ’พ Database
  • ๐Ÿ—ƒ๏ธ SQLite (development)
  • ๐Ÿ”„ Migrations support for other databases in production
โš™๏ธ Asynchronous Processing
  • ๐Ÿ”„ Celery for background tasks
  • ๐Ÿš€ Redis for message broker
  • ๐Ÿ“ก Django Channels for WebSockets
๐Ÿ“ Media Handling
  • ๐Ÿ–ผ๏ธ Pillow for image processing
  • ๐Ÿ“ฑ QR Code generation
๐Ÿ“ง Email Service
  • ๐Ÿ“จ SendGrid integration
๐Ÿ“š Documentation & Schemas
  • ๐Ÿ“ DRF Spectacular for API documentation

๐Ÿ“‚ Project Structure

event_ticket/backend/
โ”‚
โ”œโ”€โ”€ manage.py                  # Django management script
โ”œโ”€โ”€ requirements.txt           # Project dependencies
โ”œโ”€โ”€ client.html                # WebSocket test client
โ”‚
โ”œโ”€โ”€ ticket_system/             # Main Django project
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ asgi.py                # ASGI config for async support
โ”‚   โ”œโ”€โ”€ celery.py              # Celery configuration
โ”‚   โ”œโ”€โ”€ schedule.py            # Task scheduling
โ”‚   โ”œโ”€โ”€ settings.py            # Project settings
โ”‚   โ”œโ”€โ”€ urls.py                # Main URL routing
โ”‚   โ”œโ”€โ”€ views.py               # Top-level views
โ”‚   โ”œโ”€โ”€ wsgi.py                # WSGI configuration
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ core/                  # Core app with models and base functionality
โ”‚   โ”‚   โ”œโ”€โ”€ models.py          # User, Event, Ticket, Stats models
โ”‚   โ”‚   โ”œโ”€โ”€ serializers.py     # Data serializers
โ”‚   โ”‚   โ”œโ”€โ”€ permissions.py     # Custom permission classes
โ”‚   โ”‚   โ”œโ”€โ”€ admin.py           # Admin interface
โ”‚   โ”‚   โ””โ”€โ”€ manager.py         # Custom user manager
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ events/                # Events app
โ”‚   โ”‚   โ”œโ”€โ”€ views.py           # Event and Ticket ViewSets
โ”‚   โ”‚   โ”œโ”€โ”€ serializers.py     # Event serializers
โ”‚   โ”‚   โ”œโ”€โ”€ urls.py            # Event URL routing
โ”‚   โ”‚   โ”œโ”€โ”€ consumers.py       # WebSocket consumers
โ”‚   โ”‚   โ”œโ”€โ”€ tasks.py           # Celery tasks
โ”‚   โ”‚   โ”œโ”€โ”€ routing.py         # WebSocket URL routing
โ”‚   โ”‚   โ””โ”€โ”€ middleware.py      # WebSocket auth middleware
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ services/              # Services app
โ”‚   โ”‚   โ”œโ”€โ”€ email_service.py   # SendGrid email service
โ”‚   โ”‚   โ”œโ”€โ”€ qr_code.py         # QR code generation
โ”‚   โ”‚   โ”œโ”€โ”€ views.py           # Service views
โ”‚   โ”‚   โ””โ”€โ”€ urls.py            # Service URL routing
โ”‚   โ”‚
โ”‚   โ””โ”€โ”€ graphql/               # GraphQL app
โ”‚       โ”œโ”€โ”€ schema.py          # GraphQL schema
โ”‚       โ”œโ”€โ”€ query.py           # GraphQL queries
โ”‚       โ”œโ”€โ”€ mutation.py        # GraphQL mutations
โ”‚       โ””โ”€โ”€ types.py           # GraphQL types
โ”‚
โ”œโ”€โ”€ media/                     # User-uploaded media
โ”‚   โ””โ”€โ”€ qr_codes/              # Generated ticket QR codes
โ”‚
โ””โ”€โ”€ staticfiles/               # Static files

๐Ÿš€ Setup & Installation

๐Ÿ“‹ Prerequisites

Python Redis RabbitMQ

โš™๏ธ Installation Steps

Step-by-Step Guide
  1. Clone the repository ๐Ÿ“ฅ

    git clone https://github.com/ahmed123456787/ticket-event.git
    cd event_ticket/backend
  2. Create and activate a virtual environment ๐Ÿ”ฎ

    python -m venv venv
    source venv/bin/activate  # On Windows, use `venv\Scripts\activate`
  3. Install dependencies ๐Ÿ“ฆ

    pip install -r requirements.txt
  4. Set up environment variables ๐Ÿ”‘

    Create a .env.dev file in the project root with:

    SENDGRID_API_KEY=your_sendgrid_api_key
    
  5. Run migrations ๐Ÿ”„

    python manage.py migrate
  6. Create a superuser ๐Ÿ‘‘

    python manage.py createsuperuser
  7. Run the development server ๐Ÿš€

    python manage.py runserver

๐Ÿ”ง Additional Services Setup

Start Required Services
  1. Start Redis server ๐Ÿ”ด

    redis-server
  2. Run Celery worker ๐Ÿง 

    celery -A ticket_system worker -l info
  3. Run Celery beat โฐ

    celery -A ticket_system beat -l info

๐Ÿ“– API Documentation

Once the server is running, access the API documentation at:

Swagger UI API Schema

๐Ÿ” Authentication

Available Authentication Methods
  1. JWT Authentication ๐Ÿ”‘

    • Get token: POST /api/token/
    • Refresh token: POST /api/token/refresh/
  2. Session Authentication ๐Ÿ–ฅ๏ธ

    • Login: POST /api/login/
    • Logout: POST /api/logout/
    • Check status: GET /api/auth-status/
  3. OAuth2 Authentication ๐ŸŒ

    • OAuth endpoints: /auth/

๐Ÿ‘ฅ User Roles

Role Description
๐Ÿ‘‘ Admin Complete system access
๐ŸŽญ Organizer Create and manage events, verify tickets
๐Ÿ™‚ Visitor Browse events, purchase and use tickets

๐Ÿ” GraphQL API

GraphQL API is available at:

Public API Private API

๐Ÿ“„ License

MIT License


Built with โค๏ธ by Ahmed

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy