Report
Report
Year/Sem/Section III / V / B
Reg No 611222104068
Signature
TABLE OF CONTENTS
2 Introduction 2
System Analysis
3 3.1 Hardware Requirements 3
3.2 Software Requirements
Modules
4 4.1 Title of the modules 4
4.2 Description of modules
System Design
5 7
5.1 System Architecture
6 System Implementation 9
7 Screen Shots 21
8 Conclusion 24
9 References 25
1. ABSTRACT
At the core of the application lies a robust backend powered by Node.js and
Express.js, which efficiently handles HTTP requests and serves dynamic content to
users. A Mysql database is utilized to store essential event details, including names and
scheduled dates, ensuring data is organized and easily accessible. The application
retrieves this information through SQL queries, allowing JavaScript to dynamically
update the countdown displays in real-time, counting down in days, hours, minutes,
and seconds. This countdown timer is a practical tool for businesses and event
organizers, providing a visual representation of time remaining until significant events,
thus creating anticipation among users.
Future enhancements could include features such as user notifications for event
reminders, an administrative panel for streamlined event management, and
customizable themes for a personalized user experience. Overall, this project
exemplifies the effective integration of modern web technologies, offering a user-
friendly platform that contributes to a richer online experience. By facilitating the
management and presentation of multiple event countdowns, this application serves as
a valuable resource in various sectors, including e-commerce, entertainment, and
cultural celebrations.
1
2. INTRODUCTION
In today’s fast-paced world, keeping track of upcoming events is crucial for both
individuals and businesses. Whether it’s a cultural festival, a sales promotion, or a
product launch, the ability to visually represent time remaining until these events can
enhance engagement and anticipation. This project focuses on developing a multi-event
countdown timer application that effectively addresses this need by providing real-
time countdowns for various significant occasions.
2
3. SYSTEM ANALYSIS
For successfully run the multi-event countdown timer application, the following
hardware requirements should be met:
Storage: At least 500 MB of free disk space is necessary for installing the required
software, including the web server, database server, and application files.
The following software components are essential for developing and running the
countdown timer application:
Web Server: Node.js (latest stable version) to run the application server and
manage client requests.
Web Browsers: Chrome, Firefox, or any modern web browser for testing the
application.
3
4. MODULES
The Upcoming Event Countdown Timer has several modules ,each of them handle
separate functionalities to deliver the application user friendly to users.
The User Interface (UI) Module is the face of the application, designed to provide
users with an intuitive and visually appealing way to interact with the countdown
timers. Utilizing HTML, CSS, and Bootstrap, this module focuses on responsive design,
ensuring compatibility across various devices. It organizes events into distinct sections,
each featuring an event image, a title, and the countdown timer.
Event Sections: Each event has its dedicated section, making it easy for users to
differentiate between them.
Responsive Layout: Bootstrap classes are utilized for a responsive grid system
that adapts to different screen sizes.
Visual Elements: Attractive images and vibrant backgrounds enhance user
engagement.
4
Real-Time Updates: Utilizes `setInterval` to update the countdown every
second, ensuring that users always see the most current time left for each event.
Dynamic Time Calculation: Converts event dates retrieved from the database
into countdowns expressed in days, hours, minutes, and seconds.
Event Handling: Supports multiple events by generating unique IDs for each
countdown, facilitating separate updates for each timer.
API Call: Makes a GET request to the `/events` endpoint, fetching the event data
in JSON format.
Error Handling: Includes basic error handling to log any issues encountered
while fetching data, improving debugging capabilities.
Event Iteration: Iterates over the received events to initiate countdowns for each
event dynamically.
The Backend Server Module serves as the application's server-side logic, built
with Node.js and Express.js. It facilitates communication between the frontend and the
MySQL database, handling requests to fetch event data.
The Database Management Module handles the interaction with the MySQL
database, managing the storage and retrieval of event information. This module is
critical for maintaining the integrity and accessibility of event data.
5
Event Storage: Allows for the addition, modification, and removal of event
entries in the `events` table.
Data Querying: Executes SQL queries to fetch event details when requested by
the frontend.
6. Styling Module
The Styling Module defines the visual presentation of the application. Using CSS,
this module establishes styles for various elements, enhancing the user experience
through aesthetic design choices.
6
5. SYSTEM DESIGN
1. Client (Frontend): User interface developed using HTML, CSS, and JavaScript.
2. Server (Backend): Handles business logic and API requests using Node.js and
Express.js.
3. Database: MySQL is utilized to store event data, allowing efficient data retrieval
and management.
7
Frontend Layer
1.User Interface
2. CountDown
Timer UI
3.Events Display
Fetches Data
from Backend
API
/events endpoint
/events
Queries Mysql 2. Database
database for
event data
Connector(Mysql)
Database Layer
Mysql Database
Stores Data
INT primary
id key
name
VARCHAR
date DATETIME
8
6. SYSTEM IMPLEMENTATION
The implementation phase involves coding the various components of the multi-
event countdown timer application based on the system architecture designed earlier.
This includes frontend development, backend API creation, database setup, and
integration of the components.
1. Technologies Used
Database: MySQL
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Multi-Event Countdown Timer</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]
alpha3/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="style.css">
</head>
<body>
9
<div class="container py-5">
<h1 class="text-center mb-5">Upcoming Events Countdown</h1>
<!-- Onam Countdown -->
<div class="row mb-5 event-section">
<div class="col-md-6">
<h2 class="text-center">Onam Celebration</h2>
<a href="https://entekeralam.com.au/onam-2024/"><img src="img1.jpg"
alt="Onam Celebration" class="img-fluid rounded mx-auto d-block event-image mb-
4"></a>
</div>
<div class="col-md-6">
<div id="onamcelebration-countdown" class="countdown d-flex justify-
content-around">
<div class="time-box"><span id="onamcelebration-days" class="display-
5"></span><p>Days</p></div>
<div class="time-box"><span id="onamcelebration-hours" class="display-
5"></span><p>Hours</p></div>
<div class="time-box"><span id="onamcelebration-minutes"
class="display-5"></span><p>Minutes</p></div>
<div class="time-box"><span id="onamcelebration-seconds"
class="display-5"></span><p>Seconds</p></div>
</div>
<div class="para"><p id="onamcelebration-message" class="text-center mt-
3"></p></div>
</div>
</div>
<!-- Myntra Sale Countdown -->
<div class="row mb-5 event-section">
<div class="col-md-6">
<h2 class="text-center">Myntra Sales Offer</h2>
<a href="https://www.myntra.com/onam"><img src="img2.jpg"
alt="Myntra Sale" class="img-fluid rounded mx-auto d-block event-image mb-
4"></a>
</div>
<div class="col-md-6">
10
<div id="myntrasale-countdown" class="countdown d-flex justify-content-
around">
<div class="time-box"><span id="myntrasale-days" class="display-
5"></span><p>Days</p></div>
<div class="time-box"><span id="myntrasale-hours" class="display-
5"></span><p>Hours</p></div>
<div class="time-box"><span id="myntrasale-minutes" class="display-
5"></span><p>Minutes</p></div>
<div class="time-box"><span id="myntrasale-seconds" class="display-
5"></span><p>Seconds</p></div>
</div>
<div class="para"><p id="myntrasale-message" class="text-center mt-
3"></p></div>
</div>
</div>
<!-- Concert Launch Countdown -->
<div class="row mb-5 event-section">
<div class="col-md-6">
<h2 class="text-center">Concert Launch</h2>
<a href="https://www.youtube.com/watch?v=XfYWFAoSmoE"><img
src="img3.jpg" alt="Concert Launch" class="img-fluid rounded mx-auto d-block
event-image mb-4"></a>
</div>
<div class="col-md-6">
<div id="concertlaunch-countdown" class="countdown d-flex justify-
content-around">
<div class="time-box"><span id="concertlaunch-days" class="display-
5"></span><p>Days</p></div>
<div class="time-box"><span id="concertlaunch-hours" class="display-
5"></span><p>Hours</p></div>
<div class="time-box"><span id="concertlaunch-minutes" class="display-
5"></span><p>Minutes</p></div>
<div class="time-box"><span id="concertlaunch-seconds" class="display-
5"></span><p>Seconds</p></div>
</div>
11
<div class="para"><p id="concertlaunch-message" class="text-center mt-
3"></p></div>
</div>
</div>
<!-- Website Launch Countdown -->
<div class="row mb-5 event-section">
<div class="col-md-6">
<h2 class="text-center">Website Launch</h2>
<a href="https://karthikaak.neocities.org/event/event"><img
src="img4.avif" alt="Website Launch" class="img-fluid rounded mx-auto d-block
event-image mb-4"></a>
</div>
<div class="col-md-6">
<div id="websitelaunch-countdown" class="countdown d-flex justify-
content-around">
<div class="time-box"><span id="websitelaunch-days" class="display-
5"></span><p>Days</p></div>
<div class="time-box"><span id="websitelaunch-hours" class="display-
5"></span><p>Hours</p></div>
<div class="time-box"><span id="websitelaunch-minutes" class="display-
5"></span><p>Minutes</p></div>
<div class="time-box"><span id="websitelaunch-seconds" class="display-
5"></span><p>Seconds</p></div>
</div>
<div class="para"><p id="websitelaunch-message" class="text-center mt-
3"></p></div>
</div>
</div>
<!-- Black Friday Countdown -->
<div class="row mb-5 event-section">
<div class="col-md-6">
<h2 class="text-center">Black Friday Sale</h2>
<a href="https://www.amazon.com/shop/blackfridayf22"><img
src="img5.jpg" alt="Black Friday Sale" class="img-fluid rounded mx-auto d-block
event-image mb-4"></a>
</div>
12
<div class="col-md-6">
<div id="blackfriday-countdown" class="countdown d-flex justify-content-
around">
<div class="time-box"><span id="blackfriday-days" class="display-
5"></span><p>Days</p></div>
<div class="time-box"><span id="blackfriday-hours" class="display-
5"></span><p>Hours</p></div>
<div class="time-box"><span id="blackfriday-minutes" class="display-
5"></span><p>Minutes</p></div>
<div class="time-box"><span id="blackfriday-seconds" class="display-
5"></span><p>Seconds</p></div>
</div>
<div class="para"><p id="blackfriday-message" class="text-center mt-
3"></p></div>
</div>
</div>
</div>
<!-- Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]
alpha3/dist/js/bootstrap.bundle.min.js"></script>
<script src="script.js"></script>
</body>
</html>
STYLE.CSS:
body {
font-family:'Kalam', cursive;
background-color: lightpink;
}
/* Heading Style */
h1 {
font-size: 3.5rem;
color: #d9534f;
font-weight: bold;
margin-bottom: 50px;}
13
/* Event Section Styling */
.event-section {
background: linear-gradient(125deg, #d9534f, #ffedd5);
border-radius: 15px;
padding: 30px;
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
transition: transform 0.3s ease-in-out;
}
.event-section:hover {
transform: scale(1.05);
}
/* Different Color Themes for Each Event */
.event-section:nth-child(1) {
background-color: #ffeeba;
}
.event-section:nth-child(2) {
background-color: #d4edda;
}
.event-section:nth-child(3) {
background-color: #cce5ff;
}
.event-section:nth-child(4) {
background-color: #f5c6cb;
}
.event-section:nth-child(5) {
background-color: #cce5ff;
}
/* Event Heading Styles */
.event-section h2 {
color: crimson;
font-weight: bold;
font-size: 50px;
margin-bottom: 20px;}
14
/* Image Styling */
.event-image {
height: 400px;
width: 400px;
border-radius: 10px;
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
transition: transform 0.3s ease;
}
.event-image:hover {
transform: scale(1.05);
}
/* Countdown Styling */
.countdown {
background-color: #ffffff;
border-radius: 15px;
padding: 30px;
width: 500px;
margin:10px;
position: relative;
right:10px;
top: 100px;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}
.time-box {
background-color: bisque;
border-radius: 10px;
padding: 15px;
width: 100px;
height: 100px;
text-align: center;
margin: 0 10px;
transition: background-color 0.3s;
}
.time-box:hover {
15
background-color: #d1ecf1;
}
.time-box span {
display: block;
font-size: 2.5rem;
color: #0a0808;
font-weight: bold;
position: center;
}
.time-box p {
color: #777;
font-size: 1rem;
font-weight: 600;
}
/* Responsive Styling */
@media (max-width: 768px) {
.event-section {
padding: 20px;
}
.time-box {
width: 60px;
padding: 15px;
}
.time-box span {
font-size: 2.0rem;
}
}
.para p{
position: relative;
right: 10%;
top: 80px;
font-weight: bold;
font-size: 50px;
}
16
SCRIPT.JS:
document.addEventListener('DOMContentLoaded', () => {
// Fetch event data from the backend
fetch('http://localhost:3000/events')
.then(response => response.json())
.then(events => {
events.forEach(event => {
// Convert event date from the database
const eventDate = new Date(event.event_date).getTime();
if (timeLeft > 0) {
const days = Math.floor(timeLeft / (1000 * 60 * 60 * 24));
const hours = Math.floor((timeLeft % (1000 * 60 * 60 * 24)) / (1000 * 60 *
60));
const minutes = Math.floor((timeLeft % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((timeLeft % (1000 * 60)) / 1000);
17
const daysToGoMessage = days > 0 ? `${days} days to go!` : `Less
than a day left!`;
document.getElementById(`${eventId}-message`).innerText =
daysToGoMessage;
} else {
// Event has started
document.getElementById(`${eventId}-countdown`).innerHTML =
`<h3>${event.name} Event Started!</h3>`;
document.getElementById(`${eventId}-message`).innerHTML = '';
}
}, 1000);
});
})
.catch(error => console.error('Error fetching event data:', error));
});
SERVER.JS:
const express = require('express');
const mysql = require('mysql2');
const cors = require('cors');
18
});
19
6.3 Database Implementation
6.4 Testing
20
7. SCREENSHOTS
21
22
23
8. CONCLUSION
24
9. REFERNCES
25