# 🚀 Supernova 2.0 — Official National Technical Fest Platform

[![PHP Version](https://img.shields.io/badge/PHP-8.x-777BB4?style=for-the-badge&logo=php&logoColor=white)](https://www.php.net/)
[![Database](https://img.shields.io/badge/Database-MySQL-4479A1?style=for-the-badge&logo=mysql&logoColor=white)](https://www.mysql.com/)
[![Payment](https://img.shields.io/badge/Payment-Razorpay-02042B?style=for-the-badge&logo=razorpay&logoColor=blue)](https://razorpay.com/)
[![License](https://img.shields.io/badge/MGM%20University-SOET-00529B?style=for-the-badge)](https://mgmu.ac.in/)

**Supernova 2.0** is the official full-stack event management, registration, and attendance ecosystem for **MGM University's School of Engineering & Technology (SOET)** National Technical Festival, held on **21–22 August 2026**.

The platform powers the entire event lifecycle: from public event discovery and online registration with instant Razorpay payments, to live QR-based attendance tracking, automated certificate issuance, organizer analytics, and admin governance.

---

## 🌟 Key Features & Functional Portals

### 🏠 Public Platform & Event Discovery (`public_html/index.php`, `public_html/events/`)
- **Interactive Landing Page**: Hero section, animated countdown timer to festival dates, featured events, schedule timeline, and FAQ.
- **Dynamic Events Catalog**: Real-time filtering by categories (Robotics, Coding, E-Sports, Project Exhibition, Pitching).
- **Detailed Event Pages**: Comprehensive rules, track dimensions, eligibility criteria, prize pools, registration fees, and coordinator contacts.

### 📝 Seamless Registration & Payment Gateway (`public_html/register.php`, `create_order.php`, `verify_payment.php`)
- **Razorpay Integration**: Instant payment link generation, modal checkout, and cryptographic signature verification.
- **Custom Dynamic Fields**: Event-specific registration fields (e.g. team member names, project titles).
- **Duplicate Prevention**: Automated checks against email/event registration collision.
- **Unique Ticket Generation**: Auto-generated registration IDs for every participant.

### 🧑‍💼 Organizer Dashboard (`public_html/organizer/dashboard.php`)
- **Participant Management**: Live attendee list with search and filter capabilities.
- **Data Export**: One-click participant data exports in Excel (`.xlsx`) format powered by `PhpSpreadsheet`.
- **Bulk Attendance Import**: Upload Excel files to mark offline attendance (`import_attendance.php`).

### 🔐 Admin Dashboard (`public_html/admin/dashboard.php`)
- **Event Lifecycle Governance**: Create, edit, publish, draft, or cancel festival events.
- **User & Role Management**: Multi-tier access control for `ADMIN`, `ORGANIZER`, and `FINANCE` staff roles.
- **Sponsor & Committee Management**: Dynamic management of event sponsors (Gold, Silver, Platinum) and committee leads.

### 💰 Finance Dashboard (`public_html/finance/dashboard.php`)
- **Revenue Analytics**: Real-time aggregate revenue metrics, payment logs, transaction status breakdowns (SUCCESSFUL, PENDING, FAILED).
- **Audit Logs**: Full transparency on Razorpay Payment IDs and order reconciliations.

### 📊 Live QR Attendance & Scanning (`public_html/attendance/`)
- **Camera-Based QR Scanner**: Mobile-ready HTML5 camera scanner (`scan.php`, `venue-scan.php`) for venue entry points.
- **Instant Ticket Validation**: Immediate check-in verification with duplicate entry warning alerts.

### 🏅 Certificate Verification Portal (`public_html/certificates/`)
- **Verification Engine**: Public search and verification of issued participation and merit certificates using unique Certificate Numbers.

---

## 🛠️ Tech Stack

| Layer | Technology |
|---|---|
| **Language & Backend** | PHP 8.x (Vanilla PHP Architecture) |
| **Web Server** | Apache (XAMPP / WAMP / Linux Web Server) |
| **Database** | MySQL / MariaDB (InnoDB, UTF8mb4, Foreign Key Integrity) |
| **Frontend UI** | HTML5, CSS3, JavaScript (ES6+), FontAwesome |
| **Payment Gateway** | Razorpay Checkout SDK & REST API |
| **Dependencies** | Composer (`phpoffice/phpspreadsheet` v2.0+) |
| **Email Service** | PHPMailer + HTML Email Templates |
| **Automation** | PowerShell File Watcher & Auto-Git Sync (`git_auto_push.ps1`) |

---

## 📂 Project Structure

```
Supernova-2.0/
├── composer.json               # PHP Composer dependencies
├── composer.lock               # Locked dependency versions
├── git_auto_push.ps1           # Real-time local file change auto-commit & push script
├── schema.sql                  # MySQL Database DDL Schema (Tables, Relational Constraints)
├── seed_events.sql             # SQL Seed script for default festival events & coordinators
└── public_html/                # Web Root Directory
    ├── index.php               # Homepage & Landing UI
    ├── register.php            # Registration Page & Checkout Trigger
    ├── create_order.php        # Razorpay Order Creation API Endpoint
    ├── verify_payment.php      # Razorpay Payment Signature Verification API
    ├── test-mail.php           # SMTP/Email Verification Script
    ├── admin/                  # Admin Management Portal
    │   ├── login.php           # Admin Authentication
    │   └── dashboard.php       # Admin Master Management Control Panel
    ├── organizer/              # Event Organizer Portal
    │   ├── dashboard.php       # Organizer Dashboard & Export Tools
    │   └── import_attendance.php # Excel Attendance Batch Importer
    ├── finance/                # Finance Portal
    │   └── dashboard.php       # Revenue & Payment Audit Dashboard
    ├── attendance/             # QR Entrance & Verification Suite
    │   ├── dashboard.php       # Attendance Analytics
    │   ├── scan.php            # QR Camera Scanner Endpoint
    │   └── venue-scan.php      # Live Entrance Verification
    ├── certificates/           # Certificate Portal
    │   └── index.php           # Public Certificate Verification Page
    ├── events/                 # Public Events Directory
    │   ├── index.php           # Events Listing Page
    │   └── details.php         # Event Specifications & Rules Page
    ├── includes/               # Shared Utilities & System Modules
    │   ├── config.php          # Database & Razorpay Credentials Configuration
    │   ├── database.php        # MySQL PDO / mysqli Connection Handler
    │   ├── auth.php            # Session & Role Verification Helpers
    │   ├── header.php          # Common HTML Header & Styles
    │   ├── footer.php          # Common HTML Footer
    │   ├── navbar.php          # Main Navigation Bar
    │   ├── mail/               # Email Templates & Sending Engine
    │   └── PHPMailer/          # PHPMailer Library Assets
    ├── assets/                 # Static Images, CSS, JS Scripts
    └── vendor/                 # Composer Third-Party Vendor Packages (PhpSpreadsheet)
```

---

## 🗄️ Database Architecture

The project relies on a relational MySQL database (`supernova_db`) with UUID primary keys and cascading foreign keys:

- **`users`**: Administrative staff accounts with roles (`ADMIN`, `ORGANIZER`, `FINANCE`).
- **`events`**: Technical & non-technical events metadata, registration fees, prize pools, JSON rules, and status (`DRAFT`, `PUBLISHED`, `COMPLETED`, `CANCELLED`).
- **`coordinators`**: Student coordinators attached to events.
- **`registrations`**: Participant registrations linked to events, unique per `(email, eventId)`.
- **`payments`**: Transaction records linked to registrations storing Razorpay Order ID, Payment ID, Signature, and status (`PENDING`, `SUCCESSFUL`, `FAILED`).
- **`attendance`**: Entry scans with timestamp tracking for event check-in validation.
- **`certificates`**: Certificate issuance records mapped to registrations.
- **`sponsors` & `committee_members`**: Event partners and organizing body rosters.

---

## 🚀 Getting Started (Local Setup)

### Prerequisites
- **XAMPP / WAMP / MAMP** (PHP 8.0+ & MySQL/MariaDB)
- **Composer** (PHP Package Manager)
- **Git**

### Installation Steps

1. **Clone the Repository**
   ```bash
   git clone https://github.com/Sushantwankhade1011/Supernova-2.0.git
   cd Supernova-2.0
   ```

2. **Database Setup**
   - Start Apache and MySQL services in XAMPP Control Panel.
   - Open [phpMyAdmin](http://localhost/phpmyadmin) (or your preferred MySQL GUI).
   - Create a database named `supernova_db`.
   - Import `schema.sql` into `supernova_db`.
   - *(Optional)* Import `seed_events.sql` to populate sample festival events and coordinators.

3. **Install Dependencies**
   Run composer from the repository root:
   ```bash
   composer install
   ```

4. **Configure Environment Parameters**
   Open `public_html/includes/config.php` and set your database connection details and Razorpay API keys:
   ```php
   // Database Configuration
   define('DB_HOST', 'localhost');
   define('DB_USER', 'root');
   define('DB_PASS', '');
   define('DB_NAME', 'supernova_db');

   // Razorpay Credentials
   define('RAZORPAY_KEY_ID', 'your_razorpay_key_id');
   define('RAZORPAY_KEY_SECRET', 'your_razorpay_key_secret');
   ```

5. **Run the Application**
   - Place the project directory inside your web root (e.g. `C:\xampp\htdocs\Supernova-2.0-main`).
   - Access the site in your web browser:
     ```
     http://localhost/Supernova-2.0-main/public_html/
     ```

---

## 🔄 Automated Deployment Sync (`git_auto_push.ps1`)

The repository includes a custom PowerShell script that continuously watches the workspace directory for file modifications and automatically stages, commits, and pushes updates to GitHub in real-time.

To launch the watcher:
```powershell
.\git_auto_push.ps1
```

---

## 🏫 Credits & Governance

Organized by **MGM University — School of Engineering & Technology (SOET)**  
📍 *Chhatrapati Sambhajinagar (Aurangabad), Maharashtra, India*  
📅 **Event Dates**: 21st – 22nd August 2026

