Skip to content

An advanced Online Event Ticketing System that enables users to seamlessly browse, book, and manage event tickets. Designed for organizers to create and manage events, and for attendees to easily purchase tickets and track their bookings.

License

Notifications You must be signed in to change notification settings

degisew/event_ticketing_fastapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Event Ticket Reservation

A scalable event ticket booking platform built with modern backend technologies

License Python FastAPI Docker

Contact: [email protected] | LinkedIn

Overview

An advanced Online Event Ticketing System that enables users to seamlessly browse, book, and manage event tickets. Designed for organizers to create and manage events, and for attendees to easily purchase tickets and track their bookings.

Key Features:

  • Secure JWT authentication and role-based access control.
  • Containerized deployment with Docker.
  • Background task processing with FastAPI BackgroundTask.
  • QR code ticket generation and sending them through email.
  • Ticket booking before payment with expiration time.

Table of Contents

Quick Start

# Clone the repo
git clone https://github.com/degisew/event_ticketing_fastapi.git
cd event_ticketing_fastapi

# Run with Docker
docker-compose up --build

# OR run locally
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate
pip install -r requirements/dev.txt
fastapi dev main.py

Access: http://localhost:8000 for API, http://localhost:8000/docs for API docs.

Project Structure

├── alembic/               # Alembic migrations Configurations
├── docker
│     └── dev/          
│          └── Dockerfile # FastAPI API Dockerfile for development environment
├── src/                  # Custom Apps collection
├── docs/                 # Documentation files
├── scripts/              # Custom scripts
├── .env                  # Environment variables (you will create this)
├── compose.yaml          # Docker Compose configuration file
└── README.md             # This README file

Setup

Show Setup Details

Prerequisites

  • Python 3.10+
  • Docker 20.10+ & Docker Compose 1.29+
  • PostgreSQL 14+ (for local setup)
  • Git 2.30+

Instructions

  1. Clone the Repository:

    git clone https://github.com/degisew/event_ticketing_fastapi.git
    cd event_ticketing_fastapi
  2. Configure Environment:

    Create a .env file with-in your root project directory and store secure values.

    Example .env:

    # Database
    POSTGRES_USER=your_db_user
    POSTGRES_PASSWORD=your_db_password
    POSTGRES_DB=your_db_name
    
    # FastAPI
    SECRET_KEY=your_secret_key
    ALGORITHM=HS256
    
    # Optional: pgAdmin
    [email protected]
    PGADMIN_DEFAULT_PASSWORD=your_pgadmin_password
  3. Run the Application:

    • Docker (Recommended):

      docker-compose up --build
    • Local Development:

      python -m venv venv
      source venv/bin/activate
      pip install -r requirements/dev.txt
      fastapi dev main.py
  4. Access Services:

API Reference

Show API Reference
Endpoint Method Description
/api/v1/account/users POST Register a new user
/api/v1/account/users/profile/edit PATCH Update current user profile
/api/v1/events GET List all events
/api/v1/events POST Create a new event
/api/v1/events/{id}/reservations POST Reserve a ticket for a specific event
/api/v1/reservations/{id}/payments POST Create Payment for a current user reservations
/api/v1/reservations/me GET Get all reservations for a current user
/api/v1/event/{id}/ticket_types GET List all available ticket types for a specific event

Full Docs: http://localhost:8000/docs

Architecture

Tech Stack:

  • Backend: FastAPI for RESTful APIs
  • Database: PostgreSQL
  • DevOps: Docker, Docker-compose

Deployment

Show Deployment Details

Production

# Run with Docker Compose
docker-compose -f compose.prod.yaml up -d

Environment Variables

DATABASE_URL=postgresql://user:pass@host:5432/db
REDIS_URL=redis://host:6379/0
SECRET_KEY=your-secret-key
ALLOWED_HOSTS=your-domain.com

License

MIT License. See LICENSE.

⭐ Star this repo if you found it useful!

Built by Degisew Mengist

⬆ Back to Top

About

An advanced Online Event Ticketing System that enables users to seamlessly browse, book, and manage event tickets. Designed for organizers to create and manage events, and for attendees to easily purchase tickets and track their bookings.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages