Skip to content

Latest commit

Β 

History

History
299 lines (230 loc) Β· 9.31 KB

File metadata and controls

299 lines (230 loc) Β· 9.31 KB

🎟️ Eventify

Event Booking System

A full-stack event booking platform built as a SESD college project.
Demonstrates OOP principles, design patterns, and clean software architecture through a real, working application.

Node.js TypeScript React PostgreSQL TailwindCSS


πŸ“– What is Eventify?

Eventify is a mini event ticketing system β€” think BookMyShow, but built from scratch for a Software Engineering course.

A user lands on the app, browses upcoming events, selects seats from an interactive seat map, picks a ticket type (VIP / General / Early Bird), chooses a payment method, and gets their booking confirmed β€” all in two clean pages.

The real purpose: showcase that every layer of the system is engineered properly β€” backend patterns, OOP models, database design, and a professional frontend that makes it all visible.


✨ Features

Feature Details
πŸ” Auth JWT-based login with role-based access
πŸŽͺ Events Browse, create, publish, and cancel events
πŸ’Ί Seat Map Interactive grid β€” Available (green), Locked (yellow), Booked (red)
🎫 Tickets Multi-tier pricing β€” VIP, General, Early Bird
πŸ’³ Payments Strategy Pattern β€” Credit Card, PayPal, Bank Transfer
πŸ”” Notifications Observer Pattern β€” Email, SMS, Push
πŸ“‹ My Bookings View complete booking history with live statuses

πŸŽ“ Note on UI Scope: The backend and database are fully architected and secured for all three roles (Attendee, Organizer, Admin). However, the frontend demo strictly focuses on the Attendee flow. This was a deliberate choice to visually demonstrate the most complex transaction pipelines (seat state management, factory pattern tickets, and strategy pattern payments) for presentation purposes.


πŸ› οΈ Tech Stack

Backend β€” Node.js + Express

Technology Role
Node.js + Express REST API server
TypeScript Type-safe code
PostgreSQL Relational database (18 tables)
JWT + bcrypt Authentication & password hashing
Jest Unit testing

Frontend β€” React + Tailwind

Technology Role
React 19 + Vite Fast, modern UI
Tailwind CSS Dark-themed styling
Axios API client with JWT interceptors
React Router Two-page routing
Lucide React Clean iconography

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚            Frontend (React)             β”‚
β”‚  EventExplorer  β†’  BookingDashboard     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                 β”‚ HTTP (Axios)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚           Backend (Express)             β”‚
β”‚  Routes β†’ Middleware β†’ Controllers      β”‚
β”‚              ↓                          β”‚
β”‚           Services                      β”‚
β”‚              ↓                          β”‚
β”‚      Models + Design Patterns           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                 β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚          PostgreSQL Database            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🧩 Design Patterns

1. Strategy Pattern β€” Payments

Swap payment methods without changing business logic.

interface PaymentStrategy {
  pay(amount: number, info: PaymentInfo): Promise<PaymentResult>;
}

class CreditCardStrategy implements PaymentStrategy { ... }
class PayPalStrategy       implements PaymentStrategy { ... }
class BankTransferStrategy implements PaymentStrategy { ... }

2. State Pattern β€” Seat Management

Seats transition through defined states.

interface SeatState {
  lock(seat: Seat): boolean;
  book(seat: Seat): boolean;
}

class AvailableState implements SeatState { ... }  // 🟒 Green
class LockedState    implements SeatState { ... }  // 🟑 Yellow
class BookedState    implements SeatState { ... }  // πŸ”΄ Red

3. Observer Pattern β€” Notifications

Notify multiple channels on booking events.

class NotificationService {
  notify(event: NotificationEvent): void {
    this.observers.forEach(obs => obs.update(event));
  }
}
// Observers: EmailNotification, SMSNotification, PushNotification

4. Factory Pattern β€” Ticket Creation

class TicketFactory {
  static createTicket(type: TicketCategory): Ticket {
    if (type === 'VIP')        return new VIPTicket();
    if (type === 'EARLY_BIRD') return new EarlyBirdTicket();
    return new GeneralTicket();
  }
}

5. Singleton Pattern β€” Logger

class Logger {
  private static instance: Logger;
  static getInstance(): Logger {
    if (!Logger.instance) Logger.instance = new Logger();
    return Logger.instance;
  }
}

πŸ”· OOP Principles

Inheritance β€” User Hierarchy

abstract class User {
  protected id: string;
  protected email: string;
  abstract getRole(): string;
}

class Attendee  extends User { getRole() { return 'attendee'; } }
class Organizer extends User { getRole() { return 'organizer'; } }
class Admin     extends User { getRole() { return 'admin'; } }

Encapsulation β€” Seat Model

class Seat {
  private status: SeatStatus;
  private state: SeatState;

  public lock(userId: string): boolean {
    return this.state.lock(this, userId); // Controlled access
  }
}

Abstraction & Polymorphism β€” Notification Channels

interface NotificationObserver {
  update(event: NotificationEvent): void;
}

class EmailNotification implements NotificationObserver { ... }
class SMSNotification   implements NotificationObserver { ... }

🌍 Deployment

The application is fully configured for production deployment using modern cloud platforms:

  • Frontend: Vercel (React + Vite)
  • Backend: Render (Node.js + Express)
  • Database: Supabase (PostgreSQL)

πŸš€ Getting Started

Prerequisites

  • Node.js 18+
  • PostgreSQL 15+
  • npm

Setup

# 1. Clone the repo
git clone https://github.com/YashSharma64/SESD-Eventify.git
cd SESD-Eventify

# 2. Setup Backend
cd backend
npm install
cp .env.example .env       # Fill in your DB credentials
npm run db:init             # Initialize database tables
npm run dev                 # Starts on http://localhost:3000

# 3. Setup Frontend (new terminal)
cd ../frontend
npm install
npm run dev                 # Starts on http://localhost:5173

The frontend auto-authenticates using a test user on first load β€” no manual login needed for demo purposes.


πŸ“‘ API Endpoints

Auth

Method Endpoint Access
POST /api/auth/register Public
POST /api/auth/login Public
GET /api/auth/me Authenticated

Events

Method Endpoint Access
GET /api/events Public
GET /api/events/:id Public
POST /api/events Organizer / Admin
PATCH /api/events/:id/publish Organizer / Admin
GET /api/events/venues/:venueId/seats Public

Bookings

Method Endpoint Access
POST /api/bookings Attendee
GET /api/bookings/my-bookings Authenticated
GET /api/bookings/:id Authenticated
PATCH /api/bookings/:id/cancel Authenticated
POST /api/bookings/:bookingId/payment Authenticated

πŸ—ƒοΈ Database Design

PostgreSQL schema with 18 tables including proper normalization, foreign keys, indexes, and constraints.

See β†’ ErDiagram.md


πŸ§ͺ Testing

# Run backend unit tests
cd backend && npm test

πŸ“ Project Documents

Document Description
idea.md Project concept and scope
classDiagram.md Full class diagram
sequenceDiagram.md Booking flow sequence
useCaseDiagram.md Use cases by role
ErDiagram.md Database ER diagram

πŸ‘€ Author

Yash Sharma β€” @YashSharma64


SESD Project β€” Software Engineering & System Design