Skip to content

ram-bhagat-thakur/Dynamic-Public-Event-Registration-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

104 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

๐Ÿ… Ranked 3rd in the SECT Internship Program

This project was built entirely solo as part of the SECT internship, where I handled everything from architecture and backend logic to frontend design, deployment, and documentation.
The ranking reflects not just the final product, but the depth of effort, reproducibility, and clarity I brought to the entire development process.
I'm now opening it up for feedback, collaboration, and deeper learningโ€”thanks for being here!

SECT Internship Ranking โ€“ 3rd Place


๐Ÿท๏ธ Project Overview :

A full-stack web application that streamlines public event registration and management.

๐Ÿ” Admin Access (Demo Credentials)

Youโ€™re welcome to explore the admin dashboard using the demo credentials below.
This access is provided for testing, learning, and evaluation purposes.

๐Ÿ›ก๏ธ Please note: This is a demo admin account with limited privileges.
Data may reset periodically, and sensitive actions are restricted to protect the system.


โš™๏ธ Accessibility & Usage Notes

  • ๐ŸŒ“ Dark Mode Recommended: For optimal visual experience, please switch your system theme to dark mode or light mode based on your preference before using the application.

  • ๐Ÿ•ธ๏ธ Content Loading Delay: If data does not appear immediately, it may be due to slow internet or delayed content loading. Please wait a moment or refresh the page.

  • ๐Ÿ” Admin Token Expiry: If you're an admin and remain logged in without logging out, your authentication token may expire after 1 hour. In such cases, some dashboard content may not load properly. To resolve this:

    • Logout once
    • Then login again with your credentials

This will restore full access to the admin dashboard.


๐ŸŽŸ๏ธ For Users

  • Browse upcoming events
  • Register with a dynamic form
  • Receive email confirmations

๐Ÿ›ก๏ธ For Admins

  • Secure login and role-based access
  • Create, edit, and delete events
  • View and export registrants
  • Manage feedback and contact submissions

This platform brings together a seamless experience for both attendees and organizers โ€” all in one dynamic, responsive system.


๐Ÿš€ Getting Started

To set up the project locally, follow the steps in the Installation & Setup section.
Make sure to review the Prerequisites and configure your .env files properly.


๐Ÿค Contributing

We welcome contributions of all kinds โ€” from bug fixes and accessibility improvements to new features and documentation polish.
๐Ÿ“˜ Please read our CONTRIBUTING.md for guidelines on how to get started.


๐Ÿ—‚๏ธ Project Roadmap

Explore our Open Source Open Source Roadmap to see what's planned, in progress, and done.
๐Ÿ’ก Contributions welcome โ€” feel free to pick a task or suggest your own!


โœจ Features

This system delivers a complete event registration workflow for both users and admins, with dynamic UI interactions, robust access control, and a responsive design.

๐Ÿ‘ค User Features

  • ๐Ÿ” Browse Events
    View all upcoming public events with details like date, location, and description.

  • ๐Ÿ“„ Event Details Page
    See full information about each event, including organizer info, schedule, and registration deadline.

  • ๐Ÿ“ Register for Events
    Fill out a dynamic form to book a spot. Confirmation is sent via email.

  • ๐ŸŽ‰ Confetti Animation on Success
    Delightful visual feedback after successful registration.


๐Ÿ” Admin Features

  • ๐Ÿ”‘ Secure Admin Login
    Requires valid user ID and password. Only registered admins can access the dashboard.

  • ๐Ÿง‘โ€๐Ÿ’ผ Admin Management
    Existing admins can add new admins. No public access to admin creation.

  • ๐Ÿ“… Create / Edit / Delete Events
    Full CRUD functionality for managing event listings.

  • ๐Ÿ“‹ View Registrants
    See who registered for each event. Export lists to CSV.

  • ๐Ÿ“ค Export Registrant Data
    One-click export of attendee lists for offline use or reporting.

  • ๐Ÿ’ฌ Manage Feedback & Reviews
    View user-submitted feedback. Verify and post selected reviews to the homepage.

  • ๐Ÿ“จ View Messages
    Access contact form submissions and user inquiries.

  • ๐Ÿงน Delete Feedback / Messages
    Clean up outdated or irrelevant entries.


๐ŸŽฏ System Features

  • ๐Ÿšซ Protected Routes
    Admin routes are guarded via ProtectedRoute and JWT-based authentication.

  • ๐ŸŒ Responsive Design
    Fully responsive UI built with Tailwind CSS and Framer Motion.

  • ๐Ÿ“ฆ Reusable Axios Instance
    Centralized API logic with environment-based config (VITE_API_BASE_URL).

  • ๐Ÿงช Robust Testing
    Backend and frontend tested with Vitest, Supertest, and Testing Library.

  • ๐Ÿ“ Modular Folder Structure
    Clean separation of concerns for scalability and maintainability.


๐Ÿ› ๏ธ Technologies Used

This project leverages a modern full-stack architecture with robust tooling for development, testing, and deployment.


๐Ÿ–ฅ๏ธ Frontend (Vite + React)

  • Frameworks & Styling:
    Vite, React, Tailwind CSS, Framer Motion

  • Routing & State Management:
    React Router (BrowserRouter, Routes, useNavigate, useLocation, useParams),
    React Hooks (useState, useEffect)

  • UI & Feedback:
    react-icons/fi, react-toastify, react-hot-toast, react-confetti, Confetti, Toaster, ToastContainer

  • Utilities:
    axios, axiosInstance, exportToCSV, date-fns, differenceInDays, format, react-use

  • Testing:
    vitest, @testing-library/react, jest-dom, MemoryRouter, vi.mock, fireEvent, waitFor, screen, within


โš™๏ธ Backend (Express + MongoDB)

  • Frameworks & Database:
    Express.js, MongoDB, Mongoose

  • Authentication & Middleware:
    JWT, custom middleware (authMiddleware, uploadMiddleware)

  • Email Service:
    Nodemailer or similar (via sendConfirmationEmail.js)

  • Testing:
    Vitest, Supertest, custom test environment setup

  • Image Management:
    Integrated via cloudinary package for seamless image uploads, optimization, and deletion.

  • Environment Variables (.env):

    CLOUDINARY_CLOUD_NAME=your-cloud-name
    CLOUDINARY_API_KEY=your-api-key
    CLOUDINARY_API_SECRET=your-api-secret

๐Ÿš€ Deployment

  • Hosting Platforms:
    GitHub + Render + cloudinary

  • Environment Configuration:
    .env and .env.example files for managing secrets and environment-specific settings


๐Ÿ”— Live Demo

https://dynamic-public-event-registration-system.onrender.com/


๐Ÿ–ผ๏ธ Screenshots of the Project

Admin Dashbord

Home Page Header

Home Event Preview

Events List

Contact Us

Contact Message List

Registrant List

Registrant List by Particular Event

Feedback Control

Feedback on Home After Veryfied By Admin

What This Platform Does

Footer

Why choose this

Hoe to Book Event

Share Your Experience

Admin Register

Admin Login

Create New Event

Email Conformatioon Formate


โš™๏ธ Prerequisites

Before running the project locally, ensure the following tools and services are installed and configured:


๐Ÿ–ฅ๏ธ System Requirements

  • Node.js: v18+ recommended
  • npm: Comes bundled with Node.js
  • MongoDB:
    • Local instance for development
    • MongoDB Atlas for production or remote testing

๐ŸŒ Global Tools

  • nodemon: For hot-reloading during backend development
    npm install -g nodemon

๐ŸŒ Environment Configuration

Set up your environment variables for both backend and frontend by copying .env.example to .env and filling in your credentials.


๐Ÿ› ๏ธ Backend .env

# MongoDB connection string (replace <username> and <password>)
MONGO_URI=mongodb+srv://<username>:<password>@cluster.mongodb.net/event-db

# JWT secret key for admin authentication
JWT_SECRET=your_jwt_secret_key

# Email credentials for sending confirmation emails
EMAIL_USER=your_email@example.com
EMAIL_PASS=your_email_app_password

๐Ÿ–ฅ๏ธ Frontend .env

# Base URL for API requests (used by axiosInstance.js)
VITE_API_BASE_URL=http://localhost:5000

๐ŸŒ„ Image Uploads with Cloudinary Integration

This App supports robust, production-grade image handling via Cloudinary, enabling persistent storage, secure delivery, and seamless deletion for uploaded images.


โš™๏ธ How It's Implemented

  • Cloudinary Setup:
    A Cloudinary account was created and credentials added to .env:
    CLOUDINARY_CLOUD_NAME=your-cloud-name
    CLOUDINARY_API_KEY=your-api-key
    CLOUDINARY_API_SECRET=your-api-secret

๐ŸŒฉ๏ธ Middleware Configuration

The backend includes a cloudinary.js config file and a Multer + Cloudinary middleware for handling image uploads.


๐Ÿ“ฆ Dependencies Used

import { v2 as cloudinary } from 'cloudinary';
import { CloudinaryStorage } from 'multer-storage-cloudinary';
import multer from 'multer';

cloudinary.config({
  cloud_name: process.env.CLOUDINARY_CLOUD_NAME,
  api_key: process.env.CLOUDINARY_API_KEY,
  api_secret: process.env.CLOUDINARY_API_SECRET,
});

const storage = new CloudinaryStorage({
  cloudinary,
  params: {
    folder: '', //set automatically uploads in this repo
    allowed_formats: ['jpg', 'jpeg', 'png'],
  },
});

export const upload = multer({ storage });

๐Ÿ”— Route Integration: Image Upload with Cloudinary

During event creation, image files are uploaded via Multer and stored as secure Cloudinary URLs.


๐Ÿ“ค Upload Route Setup

router.post('/create', upload.single('image'), async (req, res) => {
  const imageUrl = req.file.path;
  // Save imageUrl to MongoDB along with other event data
});

๐Ÿ—‘๏ธ Secure Deletion: Cloudinary Image Removal

When an event is deleted, its associated image is removed from Cloudinary using the stored public_id.


๐Ÿ”ง Cloudinary Deletion Method

// Handle banner removal
    if (req.body.removeBanner === 'true' && event.bannerPath) {
      const imagePath = path.join(__dirname, '..', 'uploads', event.bannerPath);
      fs.unlink(imagePath, (err) => {
        if (err) console.warn('Failed to delete banner:', err.message);
      });
      updatedData.bannerPath = '';
    }

๐Ÿ›ก๏ธ Benefits of Using Cloudinary for Image Management


๐Ÿ“ˆ Advantages

  • ๐Ÿ—‚๏ธ Persistent Image Hosting
    Hosted images remain accessible long-term via secure URLs
    with built-in CDN caching for global performance.

  • โœจ Automatic Optimization
    Cloudinary resizes and formats images automatically
    based on device, viewport, and delivery context.

  • ๐Ÿงน Secure Image Deletion
    Removal is handled via cloudinary.uploader.destroy(publicId)
    for precise and authenticated cleanup.

  • ๐Ÿ“ฆ Simplified Deployment
    No need for manual uploads folder โ€”
    images are stored externally and accessed via Cloudinary URLs.


๐Ÿ’ก Tip

Tip

Make sure to validate image inputs on both the frontend and backend:

  • ๐Ÿ” Check file type (e.g., JPG, PNG)
  • ๐Ÿ“ Enforce file size limits
  • ๐Ÿšซ Handle upload errors gracefully

๐Ÿš€ Installation & Setup

Follow these steps to run the project locally:

1๏ธโƒฃ Clone the Repository

git clone https://github.com/ram-bhagat-thakur/Dynamic-Public-Event-Registration-System.git
cd event-registration-system

2๏ธโƒฃ Backend Setup

cd server
npm install

๐Ÿ”ง Environment Variables

Create a .env file in the server/ directory based on .env.example. Include:

PORT=5000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
EMAIL_USER=your_email@example.com
EMAIL_PASS=your_email_password

๐Ÿš€ Run the Backend

npm run dev

The backend will start at: http://localhost:5000


3๏ธโƒฃ Frontend Setup

cd client
npm install

๐Ÿ”ง Environment Variables

Create a .env file in the client/ directory:

VITE_API_BASE_URL=http://localhost:5000

๐Ÿš€ Run the Frontend

npm run dev

The frontend will start at: http://localhost:5173 (or as shown in your terminal)


๐Ÿ” Admin Access

Admins have elevated privileges and can:

  • ๐Ÿ“… Create, edit, and delete events
  • ๐Ÿ“‹ View registrants and export lists (CSV)
  • ๐Ÿ’ฌ Manage feedback and reviews
  • โœ… Verify feedback for homepage display
  • ๐Ÿ“จ View messages and contact submissions
  • ๐Ÿง‘โ€๐Ÿ’ผ Add other admins (only existing admins can do this)

โš ๏ธ Admins cannot be created via public registration.
Only a registered admin can promote another user to admin status.


๐Ÿงญ Admin Login

To log in as an admin, you must:

  • โœ… Be registered as a user
  • โœ… Have been granted admin privileges by an existing admin
  • ๐Ÿ” Provide your User ID and Password on the admin login screen

๐Ÿงช Optional: Seed Admin (for Development)

To bootstrap the system with an initial admin, manually insert a user with role: "admin" into your MongoDB database.

๐Ÿ“ฆ Example Document (MongoDB shell or Compass):

{
  "name": "Super Admin",
  "email": "admin@example.com",
  "password": "hashed_password",
  "role": "admin"
}

โš ๏ธ Make sure the password is hashed using bcrypt before inserting.


๐Ÿ‘ฅ User Access

Regular users can:

  • ๐Ÿ” View all public events
  • ๐Ÿ“„ See event details
  • ๐Ÿ“ Register for events

๐Ÿšซ Users cannot access admin routes or dashboards.


๐Ÿ“ Folder Structure The project is organized into two main directories inside sect-project:

  • client/ for the frontend
  • server/ for the backend

๐Ÿ–ฅ๏ธ client/ โ€” Frontend (Vite + React)

client/
โ”œโ”€โ”€ public/
โ”‚   โ”œโ”€โ”€ images/              # Logos and static images
โ”‚   โ”œโ”€โ”€ videos/              # Background video for homepage header
โ”‚   โ””โ”€โ”€ _redirects           # SPA routing support (e.g., Netlify)
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/          # Reusable UI components
โ”‚   โ”œโ”€โ”€ pages/               # Route-based views (Home, Events, Admin, etc.)
โ”‚   โ”œโ”€โ”€ services/            # API service logic
โ”‚   โ”œโ”€โ”€ styles/              # Global CSS
โ”‚   โ”œโ”€โ”€ utils/               # Shared utilities (e.g., axiosInstance)
โ”‚   โ”œโ”€โ”€ __test__/            # Frontend test suites
โ”‚   โ””โ”€โ”€ setupTests.js        # Vitest + Testing Library setup
โ”œโ”€โ”€ .env
โ”œโ”€โ”€ index.html
โ”œโ”€โ”€ vite.config.js
โ”œโ”€โ”€ tailwind.config.js
โ””โ”€โ”€ package.json

โš™๏ธ server/ โ€” Backend (Express + MongoDB)

server/
โ”œโ”€โ”€ controller/              # Route handlers (auth, events, feedback, etc.)
โ”œโ”€โ”€ middleware/              # Custom middleware (auth, upload)
โ”œโ”€โ”€ models/                  # Mongoose schemas
โ”œโ”€โ”€ routes/                  # Express route definitions
โ”œโ”€โ”€ upload/                  # Uploaded event banner images
โ”œโ”€โ”€ utils/                   # Helper functions (e.g., sendConfirmationEmail)
โ”œโ”€โ”€ __tests__/               # Backend test suites
โ”‚   โ””โ”€โ”€ setupTestEnv.js      # In-memory MongoDB setup
โ”œโ”€โ”€ .env
โ”œโ”€โ”€ .env.example
โ”œโ”€โ”€ index.js                 # Main server entry
โ”œโ”€โ”€ app.js                   # Test entry point
โ””โ”€โ”€ package.json

๐Ÿ“ Full Folder Structure

sect-project/
โ”œโ”€โ”€ client/                  # Frontend (React + Vite)
โ”‚   โ”œโ”€โ”€ node_modules/
โ”‚   โ”œโ”€โ”€ public/              # Static assets
โ”‚   โ”‚   โ”œโ”€โ”€ images/          # Logos and icons
โ”‚   โ”‚   โ”œโ”€โ”€ videos/          # Background video for homepage
โ”‚   โ”‚   โ””โ”€โ”€ _redirects       # SPA routing support (e.g. Render)
โ”‚   โ”œโ”€โ”€ src/                 # Application source code
โ”‚   โ”‚   โ”œโ”€โ”€ components/      # Reusable UI components
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Card.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Footer.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Navbar.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ProtectedRoute.jsx
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ScrollToTop.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ pages/           # Route-based pages
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ AdminDashboard.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ AddEvent.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ AdminLogin.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ AdminRegister.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ AllRegistrant.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Contact.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ EditEvent.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ EventDetails.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ EventRegistrants.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Events.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Home.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ MessageList.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ RegisterEvent.jsx
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ Welcome.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ services/        # API service modules
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ authService.js
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ contactService.js
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ csvService.js
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ eventService.js
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ registrationService.js
โ”‚   โ”‚   โ”œโ”€โ”€ styles/          # Global styles
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ index.css
โ”‚   โ”‚   โ”œโ”€โ”€ utils/           # Utility functions
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ axiosInstance.js
โ”‚   โ”‚   โ”œโ”€โ”€ __test__/        # Frontend test suites
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ pages/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ services/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ utils/
โ”‚   โ”‚   โ”œโ”€โ”€ App.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ main.jsx
โ”‚   โ”‚   โ””โ”€โ”€ setupTests.js    # Vitest setup
โ”‚   โ”œโ”€โ”€ .env                 # Frontend environment variables
โ”‚   โ”œโ”€โ”€ .gitignore
โ”‚   โ”œโ”€โ”€ eslint.config.js
โ”‚   โ”œโ”€โ”€ index.html
โ”‚   โ”œโ”€โ”€ package.json
โ”‚   โ”œโ”€โ”€ package-lock.json
โ”‚   โ”œโ”€โ”€ tailwind.config.js
โ”‚   โ””โ”€โ”€ vite.config.js
โ”‚
โ”œโ”€โ”€ server/                  # Backend (Express + MongoDB)
โ”‚   โ”œโ”€โ”€ controller/          # Route controllers
โ”‚   โ”‚   โ”œโ”€โ”€ authController.js
โ”‚   โ”‚   โ”œโ”€โ”€ feedbackController.js
โ”‚   โ”‚   โ”œโ”€โ”€ contactController.js
โ”‚   โ”‚   โ”œโ”€โ”€ eventController.js
โ”‚   โ”‚   โ””โ”€โ”€ registrationController.js
โ”‚   โ”œโ”€โ”€ middleware/          # Custom middleware
โ”‚   โ”‚   โ”œโ”€โ”€ authMiddleware.js
โ”‚   โ”‚   โ””โ”€โ”€ uploadMiddleware.js
โ”‚   โ”œโ”€โ”€ models/              # Mongoose schemas
โ”‚   โ”‚   โ”œโ”€โ”€ Feedback.js
โ”‚   โ”‚   โ”œโ”€โ”€ Admin.js
โ”‚   โ”‚   โ”œโ”€โ”€ Contact.js
โ”‚   โ”‚   โ”œโ”€โ”€ Event.js
โ”‚   โ”‚   โ””โ”€โ”€ Registration.js
โ”‚   โ”œโ”€โ”€ routes/              # Express route definitions
โ”‚   โ”‚   โ”œโ”€โ”€ feedbackRoutes.js
โ”‚   โ”‚   โ”œโ”€โ”€ admin.js
โ”‚   โ”‚   โ”œโ”€โ”€ contact.js
โ”‚   โ”‚   โ”œโ”€โ”€ event.js
โ”‚   โ”‚   โ”œโ”€โ”€ register.js
โ”‚   โ”‚   โ””โ”€โ”€ registration.js
โ”‚   โ”œโ”€โ”€ upload/              # Uploaded event banners
โ”‚   โ”œโ”€โ”€ utils/               # Utility functions
โ”‚   โ”‚   โ””โ”€โ”€ sendConfirmationEmail.js
โ”‚   โ”œโ”€โ”€ __tests__/           # Backend test suites
โ”‚   โ”‚   โ”œโ”€โ”€ routes/
โ”‚   โ”‚   โ””โ”€โ”€ setupTestEnv.js
โ”‚   โ”œโ”€โ”€ .env
โ”‚   โ”œโ”€โ”€ .env.example
โ”‚   โ”œโ”€โ”€ .gitignore
โ”‚   โ”œโ”€โ”€ app.js               # Test entry point
โ”‚   โ”œโ”€โ”€ index.js             # Main server entry point
โ”‚   โ”œโ”€โ”€ package.json
โ”‚   โ”œโ”€โ”€ package-lock.json
โ”‚   โ””โ”€โ”€ vitest.config.js

๐Ÿงช tests/ โ€” Full-Stack Testing Overview

  • Backend

    • Tools: Vitest, Supertest, mongodb-memory-server
    • Coverage: Route logic, middleware, edge cases
  • Frontend

    • Tools: @testing-library/react, Vitest, jest-dom
    • Coverage: Component rendering, user interactions, route protection

๐Ÿงช Testing Instructions

This project includes comprehensive testing for both frontend and backend using Vitest, Testing Library, and Supertest.


๐Ÿ–ฅ๏ธ Frontend Testing

โœ… Tools Used

  • vitest
  • @testing-library/react
  • jest-dom

๐Ÿ“ฆ Test Files Location

client/src/__test__/
โ”œโ”€โ”€ components/       # Unit tests for reusable components
โ”œโ”€โ”€ pages/            # Integration tests for route-based pages
โ”œโ”€โ”€ services/         # API service mocks and tests
โ”œโ”€โ”€ utils/            # Utility function tests

๐Ÿš€ Run Frontend Tests

cd client
npm run test

๐Ÿงช Coverage (Optional)

To generate coverage reports:

vitest --coverage

โš™๏ธ Backend Testing

โœ… Tools Used

  • vitest
  • supertest
  • mongodb-memory-server

๐Ÿ“ฆ Test Files Location

server/__tests__/
โ”œโ”€โ”€ routes/           # Route-level integration tests
โ””โ”€โ”€ setupTestEnv.js   # In-memory MongoDB and test environment setup

๐Ÿš€ Run Backend Tests

cd server
npm run test

๐Ÿงช Tests run against an in-memory MongoDB instance for isolation and speed.


๐Ÿง  Whatโ€™s Covered

  • โœ… Protected route access
  • โœ… Form validation and submission
  • โœ… API service logic
  • โœ… Event creation, editing, deletion
  • โœ… Registration flow and confirmation
  • โœ… Feedback and message handling
  • โœ… Role-based access control

๐Ÿ“Š Sample Test Output & Coverage

โœ… Frontend Test Output

โœ… Test Coverage & Performance

This project includes comprehensive unit and integration tests for pages, components, services, and utilities.

File Tests Passed Duration
RegisterEvent.test.jsx 4 741ms
AdminDashboard.test.jsx 5 1147ms
AddEvent.test.jsx 4 1023ms
Welcome.test.jsx 5 627ms
Navbar.test.jsx 4 769ms
EventRegistration.test.jsx 8 606ms
AdminLogin.test.jsx 3 649ms
AllRegistrants.test.jsx 6 464ms
EventDetails.test.jsx 5 543ms
ProtectedRoute.test.jsx 2 134ms
Card.test.jsx 3 474ms
eventService.test.js 7 36ms
registrationService.test.js 5 23ms
authService.test.js 1 14ms
utils.test.js 1 9ms

Total Files Tested: 17
Total Tests Passed: 78
Execution Time: ~46.15 seconds
Start Time: 21:40:53


โš™๏ธ Test Results & Insights

This section reflects backend reliability and realistic payloads logged during automated testing. All tests passed successfully with relevant input data.


โš ๏ธ Known Warnings

These issues do not break the test flow but should be resolved for production-grade stability.

  • ๐ŸŸก AdminDashboard.test.jsx: React state updates not wrapped in act(...)
  • ๐ŸŸก Welcome.test.jsx: jsdom navigation not implemented
  • ๐Ÿ”ด EventDetails.test.jsx: Simulated fetch failure

๐Ÿ“ธ Screenshots

Client Folder Test


๐Ÿงช Backend Test Output (__tests__/routes)

๐Ÿงพ Test File โœ… Tests Passed โฑ๏ธ Duration
feedback.test.js 5 7183ms
admin.test.js 5 8752ms
event.test.js 6 5590ms
contact.test.js 5 4940ms

Total Files Tested: 4
Total Tests Passed: 21
Execution Time: ~25.81 seconds
Start Time: 21:43:52


๐Ÿ—‚ Sample Payloads (Logged During Tests)

{
  "name": "Ram Bhagat",
  "username": "ramdev",
  "email": "ram@example.com",
  "password": "securepass123"
}

๐Ÿ“ธ Screenshots

Server Folder Test


๐Ÿ“ฆ Deployment Instructions (To Deploy Frontend and Backend with different different url)

This project is deployed using Render, which supports both static frontend hosting and backend services with environment variables.


๐Ÿš€ Backend Deployment (Express + MongoDB)

โœ… Steps:

  • Go to Render Dashboard
  • Click โ€œNew Web Serviceโ€
  • Connect your GitHub repo and select the server/ folder
  • Set the following build and start commands:
Build Command: npm install
Start Command: npm run start
  • Add the required environment variables:

    • MONGO_URI
    • JWT_SECRET
    • EMAIL_USER
    • EMAIL_PASS
  • Choose a free or paid plan and deploy

๐Ÿ” Render will auto-redeploy on every push to the selected branch.


๐ŸŒ Frontend Deployment (Vite + React)

โœ… Steps:

  • Go to Render Dashboard
  • Click โ€œNew Static Siteโ€
  • Connect your GitHub repo and select the client/ folder
  • Set the following build and publish settings:
Build Command: npm run build
Publish Directory: dist
  • Add the required environment variable:
VITE_API_BASE_URL=https://your-backend.onrender.com

๐Ÿ“ฆ Deployment Instructions (Unified Frontend & Backend on a Single URL)

This approach merges your React (Vite) frontend with your Express + MongoDB backend, hosted together under one Render service.
Ideal for seamless SPA routing, simplified API access, and persistent cloud image storage.


๐Ÿ”ง Pre-Deployment Setup

Before deploying to Render, build your frontend locally and prepare it for server-side serving:

1. Build the frontend

cd client
npm run build
  • After successful build, move the dist folder to the backend directory:
mv dist ../server/
  • Confirm that your Express server is configured to serve static assets:
// server/index.js
import path from 'path';
import express from 'express';

const app = express();

app.use(express.static(path.resolve(__dirname, 'dist')));

app.get('*', (req, res) => {
  res.sendFile(path.resolve(__dirname, 'dist', 'index.html'));
});

๐Ÿš€ Deployment on Render

  • Go to the Render Dashboard

  • Click โ€œNew Web Serviceโ€

  • Select the server/ directory as your root deploy folder

  • Configure deployment settings:

    Build Command: npm install
    Start Command: npm run dev
  • Add the following environment variables:

MONGO_URI=your-mongodb-uri
JWT_SECRET=your-jwt-secret
EMAIL_USER=your-email-username
EMAIL_PASS=your-email-password
PORT=10000
  • Choose a plan (free or paid) and deploy!
    โœ… Render will automatically redeploy your service on each push to the connected branch.

๐Ÿง  Notes

  • No need for VITE_API_BASE_URL in this setup, as your frontend and backend share the same domain. But adding this will be easy.
  • Ensure your server uses fallback routing to support SPA navigation via direct links.
  • You can customize the deployment port with the PORT environment variable, commonly set to 10000 or Renderโ€™s default.

  • Deploy and test

๐Ÿงช Post-Deploy Checklist

  • โœ… Test all routes and endpoints
  • โœ… Verify email confirmation works
  • โœ… Check admin login and dashboard access
  • โœ… Confirm public event registration flow
  • โœ… Validate CORS and API connectivity between frontend and backend

๐Ÿ›  Deployment Status

๐Ÿ“Š Render Dashboard Preview

Render Dashboard Screenshot


๐Ÿ“„ Deployment Log (Unified Frontend & Backend on a Single URL)

2025-07-30T21:30:45.693019843Z ==> Cloning from https://github.com/ram-bhagat-thakur/Dynamic-Public-Event-Registration-System
2025-07-30T21:30:46.613369586Z ==> Checking out commit ee4dd315c6fb7676a3f0448a9206f2d7b9820133 in branch Development
2025-07-30T21:30:47.876313543Z ==> Downloading cache...
2025-07-30T21:31:04.357607419Z ==> Transferred 133MB in 8s. Extraction took 7s.
2025-07-30T21:31:34.466416214Z ==> Using Node.js version 22.16.0 (default)
2025-07-30T21:31:34.492802003Z ==> Docs on specifying a Node.js version: https://render.com/docs/node-version
2025-07-30T21:31:34.671541503Z ==> Using Bun version 1.1.0 (default)
2025-07-30T21:31:34.671556713Z ==> Docs on specifying a Bun version: https://render.com/docs/bun-version
2025-07-30T21:31:34.737867294Z ==> Running build command 'npm install'...
2025-07-30T21:31:35.803232053Z 
2025-07-30T21:31:35.803261854Z up to date, audited 323 packages in 986ms
2025-07-30T21:31:35.803286125Z 
2025-07-30T21:31:35.803324366Z 62 packages are looking for funding
2025-07-30T21:31:35.803331186Z   run `npm fund` for details
2025-07-30T21:31:35.804914006Z 
2025-07-30T21:31:35.804926876Z found 0 vulnerabilities
2025-07-30T21:31:38.899508371Z ==> Uploading build...
2025-07-30T21:31:48.363960553Z ==> Uploaded in 6.8s. Compression took 2.6s
2025-07-30T21:31:48.413233561Z ==> Build successful ๐ŸŽ‰
2025-07-30T21:32:30.63052316Z ==> Deploying...
2025-07-30T21:32:52.310988356Z ==> Running 'npm run dev'
2025-07-30T21:32:53.516317683Z 
2025-07-30T21:32:53.519888384Z > server@1.0.0 dev
2025-07-30T21:32:53.519896094Z > nodemon index.js
2025-07-30T21:32:53.519898514Z 
2025-07-30T21:32:54.417392739Z [nodemon] 3.1.10
2025-07-30T21:32:54.419341954Z [nodemon] to restart at any time, enter `rs`
2025-07-30T21:32:54.41957021Z [nodemon] watching path(s): *.*
2025-07-30T21:32:54.419656803Z [nodemon] watching extensions: js,mjs,cjs,json
2025-07-30T21:32:54.420163497Z [nodemon] starting `node index.js`
2025-07-30T21:32:58.407244336Z [dotenv@17.2.0] injecting env (0) from .env (tip: โš™๏ธ  enable debug logging with { debug: true })
2025-07-30T21:32:59.606346258Z [dotenv@17.2.0] injecting env (0) from .env (tip: ๐Ÿ” prevent committing .env to code: https://dotenvx.com/precommit)
2025-07-30T21:33:00.009066516Z (node:142) [MONGODB DRIVER] Warning: useNewUrlParser is a deprecated option: useNewUrlParser has no effect since Node.js Driver version 4.0.0 and will be removed in the next major version
2025-07-30T21:33:00.009088697Z (Use `node --trace-warnings ...` to show where the warning was created)
2025-07-30T21:33:00.009091837Z (node:142) [MONGODB DRIVER] Warning: useUnifiedTopology is a deprecated option: useUnifiedTopology has no effect since Node.js Driver version 4.0.0 and will be removed in the next major version
2025-07-30T21:33:03.032692459Z MongoDB connected
2025-07-30T21:33:03.034392447Z Server running on 5000
2025-07-30T21:33:11.442445034Z ==> Your service is live ๐ŸŽ‰
2025-07-30T21:33:11.471477492Z ==> 
2025-07-30T21:33:11.498418859Z ==> ///////////////////////////////////////////////////////////
2025-07-30T21:33:11.524453637Z ==> 
2025-07-30T21:33:11.551231144Z ==> Available at your primary URL https://dynamic-public-event-registration-system.onrender.com
2025-07-30T21:33:11.577871992Z ==> 
2025-07-30T21:33:11.60408074Z ==> ///////////////////////////////////////////////////////////

๐Ÿ”— Live Demo

https://dynamic-public-event-registration-system.onrender.com/


๐Ÿ”ฎ Future Improvements

A prioritized list of enhancements that will elevate testing, user experience, architecture, and community engagement.


๐Ÿงช Testing & QA

  • โœ… Full E2E Coverage
    Integrate Playwright or Cypress for end-to-end testing of user flows โ€” including form validation, email confirmation, and admin dashboard interactions.

  • ๐Ÿงฑ Reusable Test Utilities
    Centralize shared mocks, setup functions, and scaffolds under test-utils/ for scalable coverage and improved maintainability.

  • ๐Ÿงผ CI Integration
    Implement GitHub Actions to run backend and frontend test suites automatically on every push and pull request for faster feedback loops.


๐ŸŽจ UI/UX Enhancements

  • โ™ฟ Accessibility Audits
    Run automated Lighthouse and axe-core scans to catch contrast issues, missing ARIA labels, and keyboard trap problems.

  • ๐Ÿงญ User Delight Features
    Add subtle animations, contextual tooltips, and micro-interactions to elevate onboarding and enhance engagement.

  • ๐ŸŒ™ Dark Mode Toggle
    Create a theme switcher that respects system preferences and persists across sessions for user personalization.


๐Ÿ— Architecture & DevOps

  • ๐Ÿงฉ Role-Based Access Control
    Refactor backend authorization to support granular permissions for admins, organizers, and attendees.

  • ๐Ÿงต Monorepo Migration
    Move to a unified monorepo structure with shared linting, config files, and test tooling across frontend and backend folders.

  • ๐Ÿš€ Staging Environment
    Deploy a staging instance via Render with test credentials and dummy data to validate features before production.


๐Ÿ“ข Community & Documentation

  • ๐Ÿ“š Interactive Docs
    Add Swagger or Redoc for live API testing and documentation, making it easier for developers to understand and interact with endpoints.

  • ๐Ÿง‘โ€๐Ÿซ Tutorial Series
    Publish a blog or video walkthrough to showcase project setup, test strategies, architectural decisions, and deployment workflow.

  • ๐Ÿช„ AI-Powered Onboarding
    Embed Copilot-style smart guidance in both the README and app dashboard to help new contributors onboard quickly and intuitively.


๐Ÿง‘โ€๐Ÿ’ป Developer Notes & Acknowledgements


๐Ÿง  Design & Architecture Notes

  • ๐Ÿงฉ Modular Backend:
    Express routes are structured for testability and separation of concerns. Middleware, controllers, and services are decoupled for clarity and scalability.

  • ๐Ÿงช Test Coverage:
    Backend routes are covered with Vitest and Supertest, including mocking of axiosInstance and middleware logic.

  • ๐ŸŒ Environment-Agnostic Frontend:
    All API calls use a centralized axiosInstance with VITE_API_BASE_URL, making the app portable across dev, staging, and production.

  • โ™ฟ Accessibility First:
    UI components follow WCAG guidelines, with keyboard navigation, ARIA roles, and semantic HTML baked in.

  • ๐Ÿ›  Zero-to-Hero Setup:
    The README is designed to onboard any developer โ€” no assumptions, no missing steps.


๐Ÿ™Œ Acknowledgements

  • ๐Ÿ’ก SECT Internship Program & Civora Nexus:
    For the opportunity to build, learn, and share in a professional environment.

  • ๐Ÿงช Testing Community:
    Inspired by open-source contributors pushing the boundaries of automated testing and mocking in Node.js.

  • ๐Ÿค Mentors & Reviewers:
    Thanks to Sarthak Dighe sir and Subham Dighe sir for being my mentor and review code, architecture decisions, debugged test runners, and encouraged accessibility best practices.

  • ๐Ÿค– AI Collaboration:
    For this project i have taken help from AI. So this project was co-created with AI assistance for design iteration, code scaffolding, and documentation polish.


๐Ÿ“ฌ Feedback & Contributions

Feel free to open issues, suggest improvements, or fork the repo.
Every accessibility fix, test enhancement, or UX polish is welcome!


๐Ÿงพ Final Summary

This project represents a scalable, full-stack solution tailored for dynamic event registration workflows. From robust backend architecture and real-time email confirmations to engaging UI enhancements and thoughtful accessibility audits, every feature has been designed with both functionality and user delight in mind.

๐ŸŽฏ Whether you're an admin managing events, a contributor exploring the codebase, or a developer eager to expand it further โ€” this repository provides the blueprint for a modern, inclusive, and high-performing event system.

๐Ÿ’ก With continuous improvements in testing, documentation, and community support, the project is well-positioned to evolve and thrive. Your feedback and contributions are the key to shaping its next chapter โ€” thank you for being a part of it!


๐Ÿ’ฌ Join the Conversation

Weโ€™ve opened GitHub Discussions to connect with contributors, mentors, and curious developers.

Feel free to:

  • Ask questions about the codebase
  • Share feedback or ideas
  • Collaborate on improvements

๐Ÿ‘‰ Introduce yourself and join the thread