Code Monkey home page Code Monkey logo

event-ticket-generator's Introduction

Event Ticketing System

This repository contains a complete solution for an event ticketing system. The system allows the generation, storage, and validation of tickets for an event, ensuring that each ticket is unique and can only be used once.

Features

  • Ticket Generation: Generate unique tickets with QR codes.
  • Ticket Storage: Store ticket information including buyer's name, email, and usage status.
  • Ticket Validation: Validate tickets at the event entrance using a web application accessible from an Android phone.

Technologies Used

  • Backend: FastAPI, Uvicorn
  • Frontend: HTML, JavaScript
  • QR Code Generation: qrcode (Python library)
  • QR Code Scanning: html5-qrcode (JavaScript library)

Getting Started

Prerequisites

  • Python 3.7+
  • Node.js (for serving the frontend, optional)

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/event-ticketing-system.git
    cd event-ticketing-system
  2. Set up the backend:

    • Install the required Python packages:
      pip install fastapi uvicorn qrcode[pil]
    • Run the FastAPI server:
      uvicorn main:app --reload
  3. Set up the frontend:

    • Open the index.html file in a web browser. Alternatively, you can serve it using a simple HTTP server:
      npx http-server .

Usage

  1. Generate a Ticket:

    • Send a POST request to /generate_ticket/ with the buyer's name and email:
      curl -X POST `https://HOST:8000/generate_ticket/`
    • The response will include the ticket ID and a base64-encoded QR code image.
  2. Validate a Ticket:

    • Open the index.html file in a web browser on an Android phone.
    • Click the "Scan QR Code" button to start scanning.
    • Point the camera at the QR code to validate the ticket.
    • The web application will communicate with the FastAPI backend to check if the ticket is valid and not used.

File Structure

event-ticketing-system/ │ ├── main.py # FastAPI application ├── index.html # Frontend web application ├── README.md # Project documentation └── requirements.txt # Python dependencies

API Endpoints

  • Generate Ticket:

    • URL: /generate_ticket/
    • Method: POST
    • Parameters: name, email
    • Response: ticket_id, qr_code
  • Validate Ticket:

    • URL: /validate_ticket/{ticket_id}
    • Method: GET
    • Response: message

Contributing

Contributions are welcome! Please fork the repository and create a pull request with your changes.

License

This project is licensed under the MIT License.

Acknowledgements


Feel free to customize this README.md file according to your specific requirements.

event-ticket-generator's People

Contributors

tatotux avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.