Skip to content

Meet141106/E-Ticket_Generator_System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎫 E-Ticket Generator System

A modern, full-stack MERN application for event ticket generation and management with QR code support, admin dashboard, and beautiful animated UI.

Tech Stack License

✨ Features

User Features

  • βœ… Event Registration - Simple form-based registration for events
  • βœ… Instant Ticket Generation - Automatic ticket ID and QR code generation
  • βœ… Downloadable Tickets - Download tickets as high-quality PDF with QR code
  • βœ… Dual Verification - Verify tickets by manual entry or QR code scanning
  • βœ… QR Code Scanner - Camera-based QR code scanning for instant verification
  • βœ… Fully Responsive - Perfect on mobile, tablet, and desktop
  • βœ… Network Access - Works on local network and via port forwarding

Admin Features

  • βœ… Secure Authentication - JWT-based admin login
  • βœ… Dashboard Analytics - Visual statistics with interactive charts
  • βœ… User Management - View and search all registered users
  • βœ… Event Management - Add and manage events dynamically
  • βœ… Dual Ticket Verification - Manual entry or QR code scanning
  • βœ… Camera Scanner - Built-in QR code scanner for quick verification
  • βœ… Search & Filter - Real-time search through registrations
  • βœ… Mobile-Friendly Dashboard - Full admin functionality on mobile devices

Technical Features

  • βœ… Modern UI - Glassmorphism and neon gradient design
  • βœ… Smooth Animations - Framer Motion animations throughout
  • βœ… QR Code Generation - Unique QR codes for each ticket
  • βœ… PDF Export - Download tickets as PDF using html2canvas & jsPDF
  • βœ… Toast Notifications - Real-time feedback with react-hot-toast
  • βœ… Confetti Effects - Celebration animations on success
  • βœ… RESTful API - Clean, well-structured backend

πŸ› οΈ Tech Stack

Frontend

  • React 18 - UI library
  • Vite - Build tool with network access
  • Tailwind CSS - Utility-first styling
  • Framer Motion - Smooth animations
  • React Router - Client-side routing
  • Axios - HTTP client
  • Recharts - Data visualization
  • html2canvas & jsPDF - High-quality PDF generation
  • jsQR - QR code scanning
  • Lucide React - Beautiful icons
  • React Hot Toast - Toast notifications
  • Canvas Confetti - Celebration effects

Backend

  • Node.js - Runtime
  • Express - Web framework
  • MongoDB - Database
  • Mongoose - ODM
  • JWT - Authentication
  • bcryptjs - Password hashing
  • QRCode - QR code generation
  • CORS - Cross-origin support

πŸ“¦ Installation

Prerequisites

  • Node.js (v16 or higher)
  • MongoDB (local or Atlas)
  • npm or yarn

Backend Setup

  1. Navigate to backend directory:
cd backend
  1. Install dependencies:
npm install
  1. Create .env file:
cp .env.example .env
  1. Update .env with your configuration:
PORT=5000
MONGODB_URI=mongodb://localhost:27017/eticket-system
JWT_SECRET=your_super_secret_jwt_key_here
NODE_ENV=development
  1. Create admin account:
node scripts/createAdmin.js
  1. Seed sample events (optional):
node scripts/seedEvents.js
  1. Start the server:
npm run dev

Backend will run on http://localhost:5000

Frontend Setup

  1. Navigate to frontend directory:
cd frontend
  1. Install dependencies:
npm install
  1. Start the development server:
npm run dev

Frontend will run on http://localhost:3000

πŸš€ Usage

User Flow

  1. Visit the homepage
  2. Click "Register Now"
  3. Fill in registration details and select an event
  4. Receive instant ticket with QR code
  5. Download ticket as PDF

Admin Flow

  1. Navigate to /admin/login
  2. Login with credentials:
    • Email: admin@eticket.com
    • Password: admin123
  3. Access dashboard with:
    • User statistics
    • Event management
    • Ticket verification
    • Analytics charts

πŸ“ Project Structure

E-Ticket_Generator_System/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ config/
β”‚   β”‚   └── db.js
β”‚   β”œβ”€β”€ controllers/
β”‚   β”‚   β”œβ”€β”€ adminController.js
β”‚   β”‚   β”œβ”€β”€ eventController.js
β”‚   β”‚   └── userController.js
β”‚   β”œβ”€β”€ middleware/
β”‚   β”‚   └── auth.js
β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”œβ”€β”€ Admin.js
β”‚   β”‚   β”œβ”€β”€ Event.js
β”‚   β”‚   └── User.js
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ adminRoutes.js
β”‚   β”‚   β”œβ”€β”€ eventRoutes.js
β”‚   β”‚   └── userRoutes.js
β”‚   β”œβ”€β”€ scripts/
β”‚   β”‚   β”œβ”€β”€ createAdmin.js
β”‚   β”‚   └── seedEvents.js
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”œβ”€β”€ generateTicketID.js
β”‚   β”‚   └── generateToken.js
β”‚   β”œβ”€β”€ .env.example
β”‚   β”œβ”€β”€ package.json
β”‚   └── server.js
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ Button.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Card.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Footer.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ InputField.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Loader.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Navbar.jsx
β”‚   β”‚   β”‚   └── QRScanner.jsx
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”‚   β”œβ”€β”€ AdminDashboard.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ AdminLogin.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Home.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ NotFound.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Register.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Ticket.jsx
β”‚   β”‚   β”‚   └── Verify.jsx
β”‚   β”‚   β”œβ”€β”€ App.jsx
β”‚   β”‚   β”œβ”€β”€ index.css
β”‚   β”‚   └── main.jsx
β”‚   β”œβ”€β”€ index.html
β”‚   β”œβ”€β”€ package.json
β”‚   β”œβ”€β”€ tailwind.config.js
β”‚   └── vite.config.js
└── README.md

πŸ”Œ API Endpoints

Public Routes

  • POST /api/register - Register for an event
  • GET /api/ticket/:ticketID - Get ticket details
  • GET /api/events - Get all active events
  • GET /api/events/:id - Get single event

Admin Routes (Protected)

  • POST /api/admin/login - Admin login
  • GET /api/admin/users - Get all users
  • GET /api/admin/events - Get all events
  • GET /api/admin/stats - Get dashboard statistics
  • GET /api/admin/verify/:ticketID - Verify ticket
  • POST /api/admin/add-event - Add new event

🎨 UI Features

  • Glassmorphism Effects - Modern frosted glass design
  • Neon Gradients - Vibrant color schemes
  • Smooth Animations - Page transitions and hover effects
  • Responsive Layout - Mobile-first design
  • Dark Theme - Eye-friendly dark mode
  • Interactive Elements - Animated buttons and cards

πŸ“Έ QR Code Scanner

The application includes a built-in QR code scanner for instant ticket verification:

Features

  • Camera Access - Uses device camera (front/back)
  • Real-time Scanning - Detects QR codes automatically
  • Dual Modes - Manual entry or camera scanning
  • Mobile Optimized - Works perfectly on smartphones
  • Animated UI - Beautiful scanning interface with corner markers
  • Auto-Verification - Instantly verifies after scanning

Usage

  1. Navigate to Verify page or Admin Dashboard
  2. Select "Scan QR Code" mode
  3. Click "Open Camera Scanner"
  4. Allow camera permissions
  5. Point camera at ticket QR code
  6. Automatic verification!

πŸ“± Mobile & Network Access

Local Network Access

Access from any device on the same WiFi:

http://YOUR_IP_ADDRESS:3000

The app automatically detects your network and adjusts API URLs accordingly.

Port Forwarding

For remote access, see PORT_FORWARDING_GUIDE.md for detailed instructions on:

  • VS Code port forwarding
  • ngrok setup
  • HTTPS configuration
  • Mobile testing

πŸ“Έ Screenshots

Add screenshots here after deployment

🚒 Deployment

Backend (Render/Railway)

  1. Create new web service
  2. Connect GitHub repository
  3. Set environment variables
  4. Deploy

Frontend (Vercel/Netlify)

  1. Connect GitHub repository
  2. Set build command: npm run build
  3. Set output directory: dist
  4. Deploy

πŸ”’ Security Features

  • JWT-based authentication
  • Password hashing with bcrypt
  • Protected admin routes
  • Input validation
  • CORS configuration
  • Environment variables for sensitive data

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

πŸ“„ License

This project is licensed under the MIT License.

πŸ‘¨β€πŸ’» Author

Created with ❀️ by [Your Name]

πŸ™ Acknowledgments


Note: This is a demonstration project. For production use, implement additional security measures and error handling.

About

Full-stack MERN application for event ticket generation and management with QR code verification, admin dashboard, and real-time analytics.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors