Skip to content

Saurabh-2607/Happen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Happen

The goal is to develop a platform for college students that allows them to interact with campus events, clubs, and activities. The platform will provide personalized event calendars, a social media space for clubs, ticket management using QR codes, and more.


Frontend by Saurabh Sharma



Backend by Kislay Anand

'Initial commits for backend development was performed in another repository. "https://github.com/KisuZoid/happen_temp"'

πŸ“Œ Overview

A QR Code-based Event Attendance System with JWT authentication, role-based access, and email verification. Users can register, generate QR codes for events, and mark attendance by scanning them.


πŸš€ Features

πŸ” Authentication & Security

βœ” JWT Authentication - Secure login/logout with tokens
βœ” Role-Based Access Control - Admin, Organizer, and User roles
βœ” Password Hashing - Uses bcrypt for encryption
βœ” Email Verification - Users must verify email before login
βœ” Password Reset - Secure OTP-based reset

πŸ“† Event & Ticketing

βœ” Create & Manage Events - Admin & organizers can create, update, and delete events
βœ” QR Code Generation - Unique QR for every user-event pair
βœ” One-Time QR Usage - Prevents multiple scans
βœ” QR Code Validation - Tracks scanned status
βœ” Event Ticketing - Users can generate tickets linked to QR

πŸ“Š Attendance Tracking

βœ” Real-time Attendance Marking - Scan QR for check-in
βœ” Duplicate Prevention - Stops multiple entries
βœ” Attendance Logs - Admins can track who attended
βœ” ObjectId Validation - Prevents invalid data input

πŸ“§ Email Service

βœ” User Registration Confirmation
βœ” Password Reset Emails
βœ” Event Notifications

πŸ“‘ API & Database

βœ” RESTful API - Well-structured and documented
βœ” MongoDB Integration - Scalable database
βœ” Optimized Indexing - For faster query execution
βœ” Error Handling Middleware - Centralized error management


πŸ“‚ Folder Structure

πŸ“¦ backend
 ┣ πŸ“‚ config
 ┃ β”— πŸ“„ db.js                  # Database connection setup
 ┣ πŸ“‚ controllers
 ┃ ┣ πŸ“„ authController.js       # Handles authentication & JWT
 ┃ ┣ πŸ“„ eventController.js      # Event management
 ┃ ┣ πŸ“„ qrController.js         # QR Code generation & validation
 ┃ ┣ πŸ“„ ticketController.js     # Ticket management
 ┃ ┣ πŸ“„ userController.js       # User profile & role management
 ┃ β”— πŸ“„ attendanceController.js # Attendance tracking
 ┣ πŸ“‚ middleware
 ┃ ┣ πŸ“„ authMiddleware.js       # JWT validation & role-based access
 ┃ ┣ πŸ“„ roleMiddleware.js       # Role-based permissions
 ┃ β”— πŸ“„ errorHandler.js         # Centralized error handling
 ┣ πŸ“‚ models
 ┃ ┣ πŸ“„ eventModel.js           # Event schema
 ┃ ┣ πŸ“„ qrModel.js              # QR Code schema
 ┃ ┣ πŸ“„ ticketModel.js          # Ticket schema
 ┃ ┣ πŸ“„ userModel.js            # User schema
 ┃ β”— πŸ“„ attendanceModel.js      # Attendance schema
 ┣ πŸ“‚ routes
 ┃ ┣ πŸ“„ authRoutes.js           # Auth routes
 ┃ ┣ πŸ“„ eventRoutes.js          # Event routes
 ┃ ┣ πŸ“„ qrRoutes.js             # QR & attendance routes
 ┃ ┣ πŸ“„ ticketRoutes.js         # Ticket routes
 ┃ ┣ πŸ“„ userRoutes.js           # User routes
 ┃ β”— πŸ“„ attendanceRoutes.js     # Attendance routes
 ┣ πŸ“‚ utils
 ┃ ┣ πŸ“„ emailService.js         # Email verification & reset
 ┃ ┣ πŸ“„ jwtUtils.js             # JWT token utilities
 ┃ ┣ πŸ“„ hashUtils.js            # Password hashing
 ┃ β”— πŸ“„ qrUtils.js              # QR code generation helpers
 ┣ πŸ“„ .env                      # Environment variables
 ┣ πŸ“„ package.json              # Dependencies & scripts
 ┣ πŸ“„ index.js                  # Main server file
 ┣ πŸ“„ app.js                    # Part of server file
 β”— πŸ“„ README.md                 # Project documentation

πŸ“Œ API Endpoints

πŸ›  Authentication

Method Route Description
POST /api/auth/register Register user
POST /api/auth/login Login user
GET /api/auth/verify/:token Email verification
POST /api/auth/reset-password Request password reset

πŸ“† Events

Method Route Description
POST /api/events/create Create event
GET /api/events/ Get all events

🎫 Tickets

Method Route Description
POST /api/tickets/generate Generate ticket

πŸ“² QR Code & Attendance

Method Route Description
POST /api/qr/generate Generate QR Code
POST /api/qr/scan Scan QR & Mark Attendance

πŸ”₯ Technologies Used

βœ” Node.js & Express.js
βœ” MongoDB with Mongoose ORM
βœ” JWT Authentication
βœ” Bcrypt for Password Hashing
βœ” QR Code Generation (qrcode package)
βœ” Nodemailer for Emails
βœ” Role-Based Access Control (RBAC)
βœ” Multer (for file handling, if needed)


πŸ›‘ Security Measures

πŸ”Ή JWT Authentication - Ensures secure access
πŸ”Ή Password Hashing - Protects stored passwords
πŸ”Ή Role-Based Access Control - Restricts unauthorized access
πŸ”Ή Preventing QR Code Reuse - Stops multiple scans


🀝 Contributing

  1. Fork the repo
  2. Create a new branch (feature-branch)
  3. Commit changes & push
  4. Create a Pull Request

πŸ“œ License

This project is MIT Licensed.


About

The goal is to develop a platform for college students that allows them to interact with campus events, clubs, and activities. The platform will provide personalized event calendars, a social media space for clubs, ticket management using QR codes, and more.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Contributors