Skip to content

A comprehensive Django-based ticket booking system for movies, sports events, and transport services with MongoDB integration

Notifications You must be signed in to change notification settings

shuv0gg/Webbased_TIcket_Booking_System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎫 TicketKatun - Ticket Booking System

A comprehensive Django-based ticket booking system for movies, sports events, and transport services with MongoDB integration.

🌟 Features

🎬 Event Management

  • Movie Events: Book movie tickets with seat management
  • Sports Events: Cricket and football match bookings
  • Transport Services: Bus and train ticket reservations
  • Real-time Seat Availability: Live seat tracking
  • Featured Events: Highlighted events on homepage

πŸ‘€ User Management

  • User Registration & Authentication: Secure login/logout
  • User Profiles: Extended profile with contact information
  • Profile Updates: Edit personal information
  • Booking History: View past bookings
  • Wishlist: Save favorite events

πŸ’³ Booking System

  • Multi-Event Support: Book any type of event
  • Seat Selection: Real-time seat availability
  • Booking Management: View, update, and cancel bookings
  • Payment Integration: Secure payment processing
  • Booking Status: Track booking status (booked/cancelled)

πŸ” Search & Discovery

  • Event Search: Search by name, location, or type
  • Event Filtering: Filter by event type (movies, sports, transport)
  • Event Details: Comprehensive event information
  • Responsive Design: Works on all devices

πŸ›‘οΈ Security Features

  • CSRF Protection: Cross-site request forgery protection
  • Authentication: Secure user authentication
  • Authorization: Role-based access control
  • Input Validation: Form validation and sanitization
  • Session Management: Secure session handling

πŸ—οΈ System Architecture

7-Layer Architecture

  1. Client Layer: Web browsers, mobile devices
  2. Presentation Layer: Django templates, Bootstrap CSS, JavaScript
  3. Application Layer: Django views, URL routing, forms
  4. Business Logic Layer: Event management, booking engine, user management
  5. Data Access Layer: Django ORM, MongoDB driver
  6. Data Storage Layer: MongoDB collections, file storage
  7. External Services: Payment gateway, email, SMS services

Database Schema

  • User: Authentication and user data
  • UserProfile: Extended user information
  • MovieEvent: Movie screenings and details
  • SportsEvent: Sports events (cricket, football)
  • Transport: Bus and train services
  • Booking: Ticket reservations
  • Wishlist: Saved events

πŸ› οΈ Technology Stack

Backend

  • Django 2.2: Web framework
  • Python 3.12: Programming language
  • MongoDB: NoSQL database
  • Djongo: MongoDB connector for Django

Frontend

  • HTML5: Markup language
  • CSS3: Styling
  • Bootstrap: Responsive UI framework
  • JavaScript: Client-side functionality
  • AJAX: Asynchronous requests

Database

  • MongoDB: Primary database
  • Collections: Organized data storage
  • File Storage: Images and static assets

πŸ“‹ Prerequisites

  • Python 3.12 or higher
  • MongoDB 4.0 or higher
  • Git

πŸš€ Installation

1. Clone the Repository

git clone https://github.com/yourusername/ticket-booking-system.git
cd ticket-booking-system

2. Create Virtual Environment

python -m venv venv
# On Windows
venv\Scripts\activate
# On macOS/Linux
source venv/bin/activate

3. Install Dependencies

pip install -r requirements.txt

4. Configure MongoDB

  • Install MongoDB on your system
  • Start MongoDB service
  • Create a database for the project

5. Configure Django Settings

  • Copy ticketbooking/settings.py to ticketbooking/local_settings.py
  • Update database settings in local_settings.py
  • Set SECRET_KEY and DEBUG settings

6. Run Migrations

python manage.py makemigrations
python manage.py migrate

7. Create Superuser

python manage.py createsuperuser

8. Populate Sample Data

python manage.py setup_mongodb

9. Run the Development Server

python manage.py runserver

πŸ“ Project Structure

ticket-booking-system/
β”œβ”€β”€ booking/                    # Main Django app
β”‚   β”œβ”€β”€ management/            # Custom management commands
β”‚   β”œβ”€β”€ migrations/            # Database migrations
β”‚   β”œβ”€β”€ static/               # Static files (CSS, JS, images)
β”‚   β”œβ”€β”€ templates/            # HTML templates
β”‚   β”œβ”€β”€ admin.py              # Django admin configuration
β”‚   β”œβ”€β”€ forms.py              # Django forms
β”‚   β”œβ”€β”€ models.py             # Django models
β”‚   β”œβ”€β”€ mongo_models.py       # MongoDB models
β”‚   β”œβ”€β”€ urls.py               # URL routing
β”‚   └── views.py              # View functions
β”œβ”€β”€ ticketbooking/            # Django project settings
β”‚   β”œβ”€β”€ settings.py           # Django settings
β”‚   β”œβ”€β”€ urls.py               # Main URL configuration
β”‚   └── wsgi.py               # WSGI configuration
β”œβ”€β”€ media/                    # User uploaded files
β”œβ”€β”€ staticfiles/              # Collected static files
β”œβ”€β”€ requirements.txt          # Python dependencies
β”œβ”€β”€ README.md                 # Project documentation
β”œβ”€β”€ er_diagram.puml          # Entity Relationship Diagram
β”œβ”€β”€ block_diagram.puml       # System Architecture Diagram
└── manage.py                # Django management script

🎯 Key Features Implementation

Real-time Seat Availability

  • AJAX-based seat updates
  • Real-time seat tracking
  • Automatic seat reservation

Profile Management

  • Extended user profiles
  • Contact information storage
  • Profile update functionality

Booking System

  • Multi-event booking support
  • Seat management
  • Booking status tracking

Wishlist Functionality

  • Save favorite events
  • Wishlist management
  • Quick booking from wishlist

πŸ”§ Configuration

Environment Variables

Create a .env file in the project root:

DEBUG=True
SECRET_KEY=your-secret-key-here
DATABASE_URL=mongodb://localhost:27017/ticketbooking

MongoDB Configuration

Update database settings in ticketbooking/settings.py:

DATABASES = {
    'default': {
        'ENGINE': 'djongo',
        'NAME': 'ticketbooking',
        'HOST': 'localhost',
        'PORT': 27017,
    }
}

πŸ§ͺ Testing

Run Tests

python manage.py test

Run Specific Tests

python manage.py test booking.tests

πŸ“Š Database Management

Create Sample Data

python manage.py setup_mongodb

Clean Duplicate Profiles

python manage.py clean_duplicate_profiles

Debug Profiles

python manage.py debug_profiles

πŸš€ Deployment

Production Settings

  1. Set DEBUG=False in settings
  2. Configure production database
  3. Set up static file serving
  4. Configure HTTPS
  5. Set up environment variables

Heroku Deployment

  1. Create Procfile
  2. Configure runtime.txt
  3. Set up MongoDB Atlas
  4. Deploy to Heroku

πŸ“ˆ Performance Optimization

Database Optimization

  • Index frequently queried fields
  • Use MongoDB aggregation pipelines
  • Implement caching strategies

Frontend Optimization

  • Minify CSS and JavaScript
  • Optimize images
  • Use CDN for static files

πŸ”’ Security Considerations

Authentication

  • Secure password hashing
  • Session management
  • CSRF protection

Data Protection

  • Input validation
  • SQL injection prevention
  • XSS protection

API Security

  • Rate limiting
  • API authentication
  • Request validation

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

πŸ“ License

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

πŸ‘₯ Authors

πŸ™ Acknowledgments

  • Django community for the excellent framework
  • MongoDB team for the database
  • Bootstrap team for the UI framework
  • All contributors and testers

πŸ“ž Support

For support and questions:

πŸ”„ Version History

  • v1.0.0 - Initial release with basic booking functionality
  • v1.1.0 - Added wishlist and profile management
  • v1.2.0 - Real-time seat availability
  • v1.3.0 - Payment integration and security improvements

Made with ❀️ using Django and MongoDB

About

A comprehensive Django-based ticket booking system for movies, sports events, and transport services with MongoDB integration

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages