Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Annual Tech Fest — Seat Booking & Registration System

A full-stack event registration system built for a college tech fest. Attendees browse open sub-events, see live seat availability, and register with real-time capacity checks — no overbooking, no duplicate USN entries.

Live demo: https://seat-booking-cbjp.onrender.com


Features

  • Browse all sub-events under a fest with venue, capacity, and live registration counts
  • Visual capacity bar per sub-event (fills up as seats are taken, locks when full)
  • One-form registration flow: name + USN → participant creation → seat registration
  • Duplicate-registration protection (a USN can't register twice for the same event)
  • Full-capacity handling with clear rejection messaging instead of silent failure
  • Connection status indicator and lightweight event log for debugging/demo purposes
  • Zero build step on the frontend — plain HTML/CSS/JS, deployable anywhere static files are served

Tech Stack

Backend

  • Python 3 + FastAPI
  • PostgreSQL (via psycopg2 — raw SQL, no ORM)
  • Deployed on Render

Frontend

  • Vanilla HTML/CSS/JavaScript (no framework, no build tooling)
  • fetch for all API calls, rendered client-side

API Endpoints

Method Endpoint Description
GET /events/{event_id}/sub_events List sub-events for an event, with live registration counts
POST /participants Create a participant (name + USN)
POST /sub_events/{sub_event_id}/register Register a participant into a sub-event (enforces capacity)

Project Structure

seat-booking/
├── main.py              # FastAPI app — routes, DB queries
├── static/
│   └── index.html       # Frontend — registration UI
├── requirements.txt
└── README.md

Running Locally

# 1. Clone the repo
git clone https://github.com/<your-username>/seat-booking.git
cd seat-booking

# 2. Install dependencies
pip install -r requirements.txt

# 3. Set your database connection (adjust to your setup)
export DATABASE_URL=postgresql://user:password@localhost:5432/seatbooking

# 4. Run the server
uvicorn main:app --reload

# 5. Open the app
# http://127.0.0.1:8000

Deployment

Deployed on Render (web service, auto-deploys from the main branch). Environment variables (DB connection string, etc.) are configured in the Render dashboard rather than committed to the repo.

Possible Next Steps

  • Add admin view for creating/editing sub-events without touching the DB directly
  • Email confirmation on successful registration
  • Rate limiting / basic bot protection on the registration endpoint
  • Move frontend to a small framework if the UI grows past a single page

Built solo as a registration system for a college tech fest, handling live seat availability and concurrent registrations.

About

Seat/event registration API (FastAPI + PostgreSQL) with a deliberately triggered and fixed race condition. Includes a concurrency test proving overbooking under load and its fix using row-level locking (SELECT FOR UPDATE).

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages