EventHub — Full-Stack Event Management Platform
A production-grade event management platform
Layer
Technology
Backend
FastAPI (Python 3.12)
Database
PostgreSQL 16 + SQLAlchemy ORM
Auth
JWT (python-jose + passlib/bcrypt)
Real-time
WebSockets (FastAPI native)
Frontend
React 18 + Vite
Styling
Tailwind CSS
State
Zustand
HTTP Client
Axios
event-platform/
├── backend/
│ ├── main.py # FastAPI app entry point
│ ├── config.py # Pydantic settings (.env)
│ ├── database.py # SQLAlchemy engine + session
│ ├── models.py # ORM models (all tables)
│ ├── schemas.py # Pydantic request/response schemas
│ ├── auth.py # JWT utils + dependency injectors
│ ├── seed.py # Dev data seeder
│ ├── routers/
│ │ ├── auth.py # POST /register, /login, /me
│ │ ├── events.py # CRUD + seat map generation
│ │ ├── bookings.py # Solo ticket booking
│ └── services/
│ ├── seat_clustering.py # Algorithmic consecutive-seat finder
│ └── websocket_manager.py # Per-room WS broadcast manager
└── frontend/
└── src/
├── pages/
│ ├── Home.jsx # Event discovery + search
│ ├── EventDetail.jsx # Event info + booking CTAs
│ ├── BookTicket.jsx # Solo booking / group room creation
│ ├── MyBookings.jsx # User's ticket history
│ ├── CreateEvent.jsx # Organizer event form
│ └── OrganizerDashboard.jsx # Stats + event management
├── components/
│ ├── Navbar.jsx
│ ├── EventCard.jsx
│ ├── SeatMap.jsx # Interactive seat grid
│ └── Toast.jsx
├── api/client.js # Axios instance + all API calls
└── store/useStore.js # Zustand: auth + UI state
User ──< Event (organizer creates many events)
Event ──< Seat (auto-generated on event creation)
User ──< Booking ──< BookingSeat >── Seat
Option A: Docker Compose (recommended)
# Start everything (PostgreSQL + backend + frontend)
docker-compose up --build
# In a new terminal, seed sample data
docker exec eventhub_backend python seed.py
Prerequisites: Python 3.12+, Node 20+, PostgreSQL running locally.
createdb eventdb
# or: psql -U postgres -c "CREATE DATABASE eventdb;"
cd backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
# Copy and edit env
cp .env.example .env # adjust DATABASE_URL if needed
# Start API server
uvicorn main:app --reload # http://localhost:8000
# Seed sample data (optional, separate terminal)
python seed.py
cd frontend
npm install
npm run dev # http://localhost:5173
Method
Path
Description
POST
/api/auth/register
Register (participant or organizer)
POST
/api/auth/login
Login → JWT token
GET
/api/auth/me
Current user
Method
Path
Description
GET
/api/events
List events (search, category filter)
POST
/api/events
Create event + auto-generate seats (organizer)
GET
/api/events/{id}
Event detail
GET
/api/events/{id}/seats
Full seat map grouped by row
Method
Path
Description
POST
/api/bookings
Book selected seats
GET
/api/bookings
My bookings
DELETE
/api/bookings/{id}
Cancel booking
Test Accounts (after seeding)
FastAPI auto-generates docs at: