Skip to content

sourobrata/events_manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ticket Booking System

A Django REST Framework-based ticket booking system for events.

Features

  • Event management (create, update, list, delete events)
  • Ticket booking system
  • User authentication
  • Role-based access control (admin and customer)
  • Filtering and searching events
  • Swagger documentation

Getting Started

Prerequisites

  • Docker
  • Docker Compose

Installation

  1. Clone the repository

  2. Run the application:

    docker-compose up --build
  3. Generate sample data:

    docker-compose exec web python manage.py generate_sample_data

The application will be available at http://localhost:53801

Default Users

  • Admin user:

    • Username: admin
    • Password: admin123
  • Sample users:

    • Username: user0, user1, user2, user3, user4
    • Password: user123

API Documentation

API documentation is available at:

API Endpoints

Events

  1. List Events
curl -X GET http://localhost:53801/api/events/
  1. Create Event (Admin only)
curl -X POST http://localhost:53801/api/events/ \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <token>" \
  -d '{
    "title": "Summer Concert",
    "description": "Annual summer concert",
    "date": "2025-06-15T18:00:00Z",
    "location": "Central Park",
    "total_tickets": 100,
    "price": "50.00"
  }'
  1. Update Event (Admin only)
curl -X PUT http://localhost:53801/api/events/1/ \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <token>" \
  -d '{
    "title": "Updated Summer Concert",
    "description": "Updated description",
    "date": "2025-06-15T18:00:00Z",
    "location": "Central Park",
    "total_tickets": 100,
    "price": "50.00"
  }'

Bookings

  1. List My Bookings
curl -X GET http://localhost:53801/api/bookings/ \
  -H "Authorization: Bearer <token>"
  1. Create Booking
curl -X POST http://localhost:53801/api/bookings/ \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <token>" \
  -d '{
    "event": 1,
    "number_of_tickets": 2
  }'
  1. Update Booking
curl -X PUT http://localhost:53801/api/bookings/1/ \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <token>" \
  -d '{
    "number_of_tickets": 3
  }'
  1. Cancel Booking
curl -X DELETE http://localhost:53801/api/bookings/1/ \
  -H "Authorization: Bearer <token>"

Features

Event Management

  • Create, read, update, and delete events
  • Filter events by date and location
  • Search events by title and description
  • Sort events by date and price

Booking Management

  • Create, read, update, and cancel bookings
  • Automatic price calculation
  • Ticket availability tracking
  • Booking status management (Pending, Confirmed, Cancelled)

User Management

  • Two user roles: Admin and Customer
  • Admins can manage events
  • Customers can book tickets
  • Users can view their booking history

Security Features

  • Role-based access control
  • Token-based authentication
  • Transaction management for booking operations
  • Input validation and sanitization

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published