A scalable event ticket booking platform built with modern backend technologies
Contact: [email protected] | LinkedIn
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.
# 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.
├── 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
Show Setup Details
- Python 3.10+
- Docker 20.10+ & Docker Compose 1.29+
- PostgreSQL 14+ (for local setup)
- Git 2.30+
-
Clone the Repository:
git clone https://github.com/degisew/event_ticketing_fastapi.git cd event_ticketing_fastapi
-
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
-
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
-
-
Access Services:
- API: http://localhost:8000
- API Docs: http://localhost:8000/docs
- pgAdmin (if included): http://localhost:8001
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
Tech Stack:
- Backend: FastAPI for RESTful APIs
- Database: PostgreSQL
- DevOps: Docker, Docker-compose
Show Deployment Details
# Run with Docker Compose
docker-compose -f compose.prod.yaml up -d
DATABASE_URL=postgresql://user:pass@host:5432/db
REDIS_URL=redis://host:6379/0
SECRET_KEY=your-secret-key
ALLOWED_HOSTS=your-domain.com
MIT License. See LICENSE.