Event Dashboard using MERN Stack
Last Updated :
23 Jul, 2025
In this article, we’ll walk through the step-by-step process of creating an Event Management System using the MERN (MongoDB, ExpressJS, React, NodeJS) stack. This project will showcase how to set up a full-stack web application where users can manage events by posting details about the event and deleting it when it has been completed.
Preview of final output: Let us have a look at how the final application will look like:
New EventPrerequisites:
Approach to create an Event Dashboard:
- The component displays a event with Titile , Location , Date for each event.
- Dashboard display list of event and allows admin to add new event and update existing event by clicking on corresponding buttons.
- Call Api using axios via useEffect.
- Uses useEffect to handle fetch events and attempts to re-fetch in case of errors.
- In server/server.js file, initialize the server and connect to MongoDB.
- Defines an initial configuration with express.json() and cors.
- server/models/eventSchema.js is the schema for the event model. It contains the title, description, date, and location of the event.
Steps to Create the Backend Server:
Step 1: Create a directory for project
mkdir server
cd server
Step 2: Initialized the Express app and installing the required packages
npm init -y
npm i express mongoose cors nodemon
Project Structure(Backend):
Server Project StructureThe updated dependencies in package.json file of backend will look like:
"dependencies": {
"cors": "^2.8.5",
"express": "^4.18.3",
"mongoose": "^8.2.1"
}
Example: Write the following code to create backend
JavaScript
// In server/server.js, initialize the server and connect to MongoDB.
import express, { json } from 'express';
import cors from 'cors';
import { connect } from 'mongoose';
import eventRoute from './routes/eventRoute.js';
const app = express();
const port = 4000;
app.use(cors());
app.use(json());
// Connect to MongoDB
connect('mongodb://localhost/mydatabase', {
useNewUrlParser: true,
useUnifiedTopology: true,
})
.then(() => console.log('Connected to MongoDB'))
.catch((error) =>
console.error('Failed to connect to MongoDB', error));
// Define your routes here
app.use('/events', eventRoute);
app.listen(port, () => {
console.log(`Server is running on port ${port}`);
});
JavaScript
// server/routes/eventRoute.js
import { Router } from 'express';
import eventCon from '../controllers/eventCon.js';
const router = Router();
// Define your routes here
router.get('/', eventCon.getAllEvents);
router.get('/:id', eventCon.getEventById);
router.post('/', eventCon.createEvent);
router.put('/:id', eventCon.updateEvent);
router.delete('/:id', eventCon.deleteEvent);
export default router;
JavaScript
// server/models/eventSchema.js is the schema for the event model. It contains the title, description, date, and location of the event.
import { Schema, model } from 'mongoose';
const eventSchema = new Schema({
title: {
type: String,
required: true
},
description: {
type: String,
required: true
},
date: {
type: Date,
required: true
},
location: {
type: String,
required: true
},
});
const Event = model('Event', eventSchema);
export default Event;
JavaScript
// server/controllers/eventCon.js
import Event from '../models/eventSchema.js';
const eventController = {
// Create a new event
createEvent: async (req, res) => {
try {
const { title, description, date, location } = req.body;
const event = new Event({
title,
description,
date,
location
});
await event.save();
res.status(201).json(event);
} catch (error) {
res.status(500).json({
error: error.message
});
}
},
// Get all events
getAllEvents: async (req, res) => {
try {
const events = await Event.find();
res.json(events);
} catch (error) {
res.status(500).json({
error: error.message
});
}
},
// Get a single event by ID
getEventById: async (req, res) => {
try {
const { id } = req.params;
const event = await Event.findById(id);
if (!event) {
return res.status(404).json({
message: 'Event not found'
});
}
res.json(event);
} catch (error) {
res.status(500).json({
error: error.message
});
}
},
// Update an event by ID
updateEvent: async (req, res) => {
try {
const { id } = req.params;
const { title, description, date, location } = req.body;
const event = await Event.findByIdAndUpdate(id,
{
title,
description,
date,
location
},
{ new: true });
if (!event) {
return res.status(404).json({
message: 'Event not found'
});
}
res.json(event);
} catch (error) {
res.status(500).json({
error: error.message
});
}
},
// Delete an event by ID
deleteEvent: async (req, res) => {
try {
const { id } = req.params;
const event = await Event.findByIdAndDelete(id);
if (!event) {
return res.status(404).json({
message: 'Event not found'
});
}
res.json({
message: 'Event deleted successfully'
});
} catch (error) {
res.status(500).json({
error: error.message
});
}
},
};
export default eventController;
Start your application using the following command.
npm run dev
Steps to Create the Frontend Application:
Step 1: Initialize the React App with Vite and installing the required packages.
npm create vite@latest -y
Step 2: Navigate to the root of the project using the following command.
cd client
Step 3: Install the necessary package in your project using the following command.
npm install axios
Step 4: Install the node_modules using the following command.
npm install
Project Structure(Frontend):
Client Project StructureThe updated dependencies in package.json file of frontend will look like:
{
"dependencies": {
"axios": "^1.6.7",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.22.2"
},
"devDependencies": {
"@types/react": "^18.2.56",
"@types/react-dom": "^18.2.19",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.56.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"vite": "^5.1.4"
}
}
Example: Write the following code in frontend files of the project
CSS
/* client/src/index.css */
/**
*
* This file is the CSS stylesheet for the index page of the Event website.
* It contains styles and layout rules specific to the index page.
*/
body{
background: #F4F7FD;
margin-top:20px;
}
.card-margin {
margin-bottom: 1.875rem;
}
.card {
border: 0;
box-shadow: 0px 0px 10px 0px rgba(82, 63, 105, 0.1);
-webkit-box-shadow: 0px 0px 10px 0px rgba(82, 63, 105, 0.1);
-moz-box-shadow: 0px 0px 10px 0px rgba(82, 63, 105, 0.1);
-ms-box-shadow: 0px 0px 10px 0px rgba(82, 63, 105, 0.1);
}
.card {
position: relative;
display: flex;
flex-direction: column;
min-width: 0;
word-wrap: break-word;
background-color: #ffffff;
background-clip: border-box;
border: 1px solid #e6e4e9;
border-radius: 8px;
}
.card .card-header.no-border {
border: 0;
}
.card .card-header {
background: none;
padding: 0 0.9375rem;
font-weight: 500;
display: flex;
align-items: center;
min-height: 50px;
}
.card-header:first-child {
border-radius: calc(8px - 1px) calc(8px - 1px) 0 0;
}
.widget-49 .widget-49-title-wrapper {
display: flex;
align-items: center;
}
.widget-49 .widget-49-title-wrapper .widget-49-date-primary {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
background-color: #edf1fc;
width: 4rem;
height: 4rem;
border-radius: 50%;
}
.widget-49 .widget-49-title-wrapper .widget-49-date-primary .widget-49-date-day {
color: #4e73e5;
font-weight: 500;
font-size: 1.5rem;
line-height: 1;
}
.widget-49 .widget-49-title-wrapper .widget-49-date-primary .widget-49-date-month {
color: #4e73e5;
line-height: 1;
font-size: 1rem;
text-transform: uppercase;
}
.widget-49 .widget-49-title-wrapper .widget-49-date-secondary {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
background-color: #fcfcfd;
width: 4rem;
height: 4rem;
border-radius: 50%;
}
.widget-49 .widget-49-title-wrapper .widget-49-date-secondary .widget-49-date-day {
color: #dde1e9;
font-weight: 500;
font-size: 1.5rem;
line-height: 1;
}
.widget-49 .widget-49-title-wrapper .widget-49-date-secondary .widget-49-date-month {
color: #dde1e9;
line-height: 1;
font-size: 1rem;
text-transform: uppercase;
}
.widget-49 .widget-49-title-wrapper .widget-49-date-success {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
background-color: #e8faf8;
width: 4rem;
height: 4rem;
border-radius: 50%;
}
.widget-49 .widget-49-title-wrapper .widget-49-date-success .widget-49-date-day {
color: #17d1bd;
font-weight: 500;
font-size: 1.5rem;
line-height: 1;
}
.widget-49 .widget-49-title-wrapper .widget-49-date-success .widget-49-date-month {
color: #17d1bd;
line-height: 1;
font-size: 1rem;
text-transform: uppercase;
}
.widget-49 .widget-49-title-wrapper .widget-49-date-info {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
background-color: #ebf7ff;
width: 4rem;
height: 4rem;
border-radius: 50%;
}
.widget-49 .widget-49-title-wrapper .widget-49-date-info .widget-49-date-day {
color: #36afff;
font-weight: 500;
font-size: 1.5rem;
line-height: 1;
}
.widget-49 .widget-49-title-wrapper .widget-49-date-info .widget-49-date-month {
color: #36afff;
line-height: 1;
font-size: 1rem;
text-transform: uppercase;
}
.widget-49 .widget-49-title-wrapper .widget-49-date-warning {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
background-color: floralwhite;
width: 4rem;
height: 4rem;
border-radius: 50%;
}
.widget-49 .widget-49-title-wrapper .widget-49-date-warning .widget-49-date-day {
color: #FFC868;
font-weight: 500;
font-size: 1.5rem;
line-height: 1;
}
.widget-49 .widget-49-title-wrapper .widget-49-date-warning .widget-49-date-month {
color: #FFC868;
line-height: 1;
font-size: 1rem;
text-transform: uppercase;
}
.widget-49 .widget-49-title-wrapper .widget-49-date-danger {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
background-color: #feeeef;
width: 4rem;
height: 4rem;
border-radius: 50%;
}
.widget-49 .widget-49-title-wrapper .widget-49-date-danger .widget-49-date-day {
color: #F95062;
font-weight: 500;
font-size: 1.5rem;
line-height: 1;
}
.widget-49 .widget-49-title-wrapper .widget-49-date-danger .widget-49-date-month {
color: #F95062;
line-height: 1;
font-size: 1rem;
text-transform: uppercase;
}
.widget-49 .widget-49-title-wrapper .widget-49-date-light {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
background-color: #fefeff;
width: 4rem;
height: 4rem;
border-radius: 50%;
}
.widget-49 .widget-49-title-wrapper .widget-49-date-light .widget-49-date-day {
color: #f7f9fa;
font-weight: 500;
font-size: 1.5rem;
line-height: 1;
}
.widget-49 .widget-49-title-wrapper .widget-49-date-light .widget-49-date-month {
color: #f7f9fa;
line-height: 1;
font-size: 1rem;
text-transform: uppercase;
}
.widget-49 .widget-49-title-wrapper .widget-49-date-dark {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
background-color: #ebedee;
width: 4rem;
height: 4rem;
border-radius: 50%;
}
.widget-49 .widget-49-title-wrapper .widget-49-date-dark .widget-49-date-day {
color: #394856;
font-weight: 500;
font-size: 1.5rem;
line-height: 1;
}
.widget-49 .widget-49-title-wrapper .widget-49-date-dark .widget-49-date-month {
color: #394856;
line-height: 1;
font-size: 1rem;
text-transform: uppercase;
}
.widget-49 .widget-49-title-wrapper .widget-49-date-base {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
background-color: #f0fafb;
width: 4rem;
height: 4rem;
border-radius: 50%;
}
.widget-49 .widget-49-title-wrapper .widget-49-date-base .widget-49-date-day {
color: #68CBD7;
font-weight: 500;
font-size: 1.5rem;
line-height: 1;
}
.widget-49 .widget-49-title-wrapper .widget-49-date-base .widget-49-date-month {
color: #68CBD7;
line-height: 1;
font-size: 1rem;
text-transform: uppercase;
}
.widget-49 .widget-49-title-wrapper .widget-49-meeting-info {
display: flex;
flex-direction: column;
margin-left: 1rem;
}
.widget-49 .widget-49-title-wrapper .widget-49-meeting-info .widget-49-pro-title {
color: #3c4142;
font-size: 14px;
}
.widget-49 .widget-49-title-wrapper .widget-49-meeting-info .widget-49-meeting-time {
color: #B1BAC5;
font-size: 13px;
}
.widget-49 .widget-49-meeting-points {
font-weight: 400;
font-size: 13px;
margin-top: .5rem;
}
.widget-49 .widget-49-meeting-points .widget-49-meeting-item {
display: list-item;
color: #727686;
}
.widget-49 .widget-49-meeting-points .widget-49-meeting-item span {
margin-left: .5rem;
}
.widget-49 .widget-49-meeting-action {
text-align: right;
}
.widget-49 .widget-49-meeting-action a {
text-transform: uppercase;
}
JavaScript
// client/src/main.jsx
import React from 'react'
import ReactDOM from 'react-dom/client'
import { BrowserRouter, Route, Routes } from 'react-router-dom'
import App from './App.jsx'
import Home from './Home.jsx'
import Update from './Update.jsx'
import "./App.css"
ReactDOM.createRoot(document.getElementById('root')).render(
<BrowserRouter>
<React.StrictMode>
<Routes>
<Route path="/" element={<Home />} />
<Route path="/dashboard" element={<App />} />
<Route path="/update/:id" element={<Update />} />
</Routes>
</React.StrictMode>
</BrowserRouter>
)
JavaScript
// client/src/Home.jsx
import React, {
useEffect,
useState
} from 'react';
import { Link } from 'react-router-dom';
import axios from 'axios';
const Home = () => {
const [events, setEvents] = useState([]);
useEffect(() => {
axios.get('http://localhost:4000/events')
.then(response => {
setEvents(response.data);
console.log(response.data);
})
.catch(error => {
console.error('Error fetching events:',
error);
});
}, []);
return (
<div>
<div className="container">
<nav className="navbar navbar-expand-lg
navbar-light bg-light">
<div className="container my-2">
<h4>GFG Event</h4>
<Link className="btn btn-primary ml-auto"
to="/dashboard">
Dashboard
</Link>
</div>
</nav>
<div className="row my-3">
{events.map(event => {
const date = new Date(event.date);
const day = date.getDate();
const month = date.toLocaleString('default',
{ month: 'short' });
const year = date.getFullYear();
return (
<div className="col-lg-4" key={event.id}>
<div className="card card-margin">
<div className="card-body pt-2">
<div className="widget-49">
<div className="widget-49-title-wrapper">
<div className="widget-49-date-primary">
<span className="widget-49-date-day">
{day}
</span>
<span className="widget-49-date-month">
{month}
</span>
</div>
<div className="widget-49-meeting-info">
<span className="widget-49-pro-title">
<b>{event.title}</b>
</span>
<span className="widget-49-pro-title">
<b>{event.location}</b>
</span>
</div>
</div>
<div className="widget-49-meeting-points">
<span>{event.description}</span>
</div>
<div className="widget-49-meeting-action">
<a href="#"
className="btn btn-sm btn-flash-border-primary">
{`${day}-${month}-${year}`}
</a>
</div>
</div>
</div>
</div>
</div>
)
})}
</div>
</div>
</div>
);
};
export default Home;
JavaScript
// client/src/App.jsx
import React, { useEffect, useState } from 'react';
import axios from 'axios';
import './App.css'
import { Link } from 'react-router-dom';
function App() {
const [events, setEvents] = useState([]);
const [isSuccess, setIsSuccess] = useState(false);
useEffect(() => {
axios.get('http://localhost:4000/events')
.then(response => {
setEvents(response.data);
})
.catch(error => {
console.error('Error fetching events:', error);
});
}, [isSuccess]);
const [formData, setFormData] = useState({
title: '',
description: '',
location: '',
date: ''
});
const handleInputChange = (e) => {
setFormData({
...formData,
[e.target.name]: e.target.value
});
};
const handleSubmit = (e) => {
e.preventDefault();
axios.post('http://localhost:4000/events',
formData)
.then(response => {
// handle success
console.log('Event added successfully:', response.data);
// Reset the form
setFormData({
title: '',
description: '',
location: '',
date: ''
});
setIsSuccess(true);
})
.catch(error => {
// handle error
setIsSuccess(false);
console.error('Error adding event:', error);
});
};
const handleDelete = (id) => {
axios.delete(`http://localhost:4000/events/${id}`)
.then(response => {
// handle success
console.log('Event deleted successfully:', response.data);
setIsSuccess(true);
})
.catch(error => {
// handle error
setIsSuccess(false);
console.error('Error deleting event:', error);
});
};
return (
<div>
<div class="">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container my-2">
<h4>GFG Event Dashboard</h4>
<div>
<button type="button"
class="btn btn-success mx-3" data-toggle="modal"
data-target="#exampleModal">
Add Event
</button>
<Link class="btn btn-primary ml-auto" to="/">
Home
</Link>
</div>
</div>
</nav>
<div class="container">
<h5 class="text-center my-2">List of Events</h5>
<table class="table table-striped border">
<thead>
<tr>
<th scope="col">Id</th>
<th scope="col">Title</th>
<th scope="col">Date</th>
<th scope="col">Update</th>
<th scope="col">Delete</th>
</tr>
</thead>
<tbody>
{events?.map(event => (
<tr key={event._id}>
<th>{event._id}</th>
<th>{event.title}</th>
<td>{event.date}</td>
<td><Link class="btn btn-primary ml-auto"
to={`/update/${event._id}`}>
Update
</Link></td>
<td><button onClick={() => handleDelete(event._id)}
className="btn btn-danger">Delete</button></td>
</tr>
))}
</tbody>
</table>
</div>
</div>
<div class="modal fade" id="exampleModal"
tabindex="-1" role="dialog"
aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">
Add New Event
</h5>
<button type="button" class="close"
data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form onSubmit={handleSubmit}>
<div class="form-group">
<label for="inputAddress">Title</label>
<input onChange={handleInputChange}
value={formData.title} type="text"
class="form-control" name="title"
id="inputAddress" placeholder="Event Title" />
</div>
<div class="form-group mt-2">
<label for="inputAddress2">Description</label>
<input onChange={handleInputChange}
value={formData.description} type="text"
class="form-control" name="description"
id="inputAddress2" placeholder="Enter Description" />
</div>
<div class="form-group mt-2">
<label for="inputAddress2">Location</label>
<input onChange={handleInputChange}
value={formData.location} type="text"
class="form-control" name="location"
id="inputAddress2" placeholder="Enter Location" />
</div>
<div class="form-group mt-2">
<label for="inputAddress2">Date</label>
<input onChange={handleInputChange}
value={formData.date} type="date"
class="form-control" name="date"
id="inputAddress2" placeholder="Enter Date" />
</div>
<button type="submit"
class="btn btn-primary mt-3">
Add Event
</button>
</form>
</div>
</div>
</div>
</div>
</div>
);
}
export default App;
JavaScript
// client/src/Update.jsx
import axios from 'axios';
import React, { useState, useEffect } from 'react';
import { Link, useParams } from 'react-router-dom';
function Update() {
const { id } = useParams();
const [event, setEvent] = useState([]);
const [isLoading, setIsLoading] = useState(true);
useEffect(() => {
axios
.get(`http://localhost:4000/events/${id}`)
.then(response => {
setEvent(response.data);
setIsLoading(false);
console.log(response.data);
})
.catch(error => {
// Handle error
alert('Error fetching event:', error);
});
}, [id]);
const [updatedTitle, setUpdatedTitle] = useState(event ? event.title : '');
const [updatedDescription, setUpdatedDescription] = useState(event ? event.description : '');
const [updatedLocation, setUpdatedLocation] = useState(event ? event.location : '');
const [updatedDate, setUpdatedDate] = useState(event ? event.dat : '');
const handleUpdate = e => {
e.preventDefault();
const updatedEvent = {
title: updatedTitle,
description: updatedDescription,
location: updatedLocation,
date: updatedDate
};
axios
.put(`http://localhost:4000/events/${id}`, updatedEvent)
.then(() => {
// Handle successful update
alert('Event updated successfully!');
})
.catch(error => {
// Handle error
alert('Error updating event:', error);
});
};
return (
<div className="container">
<nav className="navbar navbar-expand-lg navbar-light bg-light">
<div className="container my-2">
<h4>GFG Event</h4>
<Link className="btn btn-primary ml-auto" to="/dashboard">
Dashboard
</Link>
</div>
</nav>
<div className="row my-3">
<div className="col-lg-4">
{isLoading ? (
<h3>Loading...</h3>
) : (
<form onSubmit={handleUpdate}>
<div className="form-group">
<label htmlFor="inputAddress">Title</label>
<input
type="text"
className="form-control"
name="title"
id="inputAddress"
placeholder="Event Title"
defaultValue={event.title}
onChange={e => setUpdatedTitle(e.target.value)}
/>
</div>
<div className="form-group mt-2">
<label htmlFor="inputAddress2">Description</label>
<input
type="text"
className="form-control"
name="description"
id="inputAddress2"
placeholder="Enter Description"
defaultValue={event.description}
onChange={e => setUpdatedDescription(e.target.value)}
/>
</div>
<div className="form-group mt-2">
<label htmlFor="inputAddress2">Location</label>
<input
type="text"
className="form-control"
name="location"
id="inputAddress2"
placeholder="Enter Location"
defaultValue={event.location}
onChange={e => setUpdatedLocation(e.target.value)}
/>
</div>
<div className="form-group mt-2">
<label htmlFor="inputAddress2">Date</label>
<input
type="date"
className="form-control"
name="date"
id="inputAddress2"
placeholder="Enter Date"
defaultValue={event.date}
onChange={e => setUpdatedDate(e.target.value)}
/>
</div>
<button type="submit" className="btn btn-primary mt-3">
Update
</button>
</form>
)}
</div>
</div>
</div>
);
}
export default Update;
To start client server:
npm run dev
Output:
Event Management System with MERN Stack
Event Management System With MERN
Similar Reads
MERN Stack The MERN stack is a widely adopted full-stack development framework that simplifies the creation of modern web applications. Using JavaScript for both the frontend and backend enables developers to efficiently build robust, scalable, and dynamic applications.What is MERN Stack?MERN Stack is a JavaSc
9 min read
MERN Full Form MERN Stack is a JavaScript Stack that is used for easier and faster deployment of full-stack web applications. The full form of MERN includes four powerful technologies:MongoDBExpress.jsReact.jsNode.jsThese technologies together provide a full-stack JavaScript framework for developing modern, dynami
2 min read
How to Become a MERN Stack Developer? Do you also get amazed at those beautiful websites that appear in front of you? Those are designed by none other than Full-Stack Developers Or MERN stack developers. They are software developers who specialize in building web applications using the MERN stack, which is a popular set of technologies
6 min read
Difference between MEAN Stack and MERN Stack Web development is a procedure or process for developing a website. A website basically contains three ends: the client side, the server side, and the database. These three are different sides of an application that combine together to deliver an application; all ends are implemented separately with
3 min read
Best Hosting Platforms for MERN Projects Hosting your website grants you the thrilling opportunity to showcase it to the world. Whether you choose free or paid hosting, the process of deploying your website fills you with a mix of excitement, pride, and nervousness. You eagerly await user feedback, enthusiastically embracing the chance to
5 min read
Getting Started with React & Frontend
React IntroductionReactJS is a component-based JavaScript library used to build dynamic and interactive user interfaces. It simplifies the creation of single-page applications (SPAs) with a focus on performance and maintainability. Why Use React?Before React, web development faced issues like slow DOM updates and mes
7 min read
React Environment SetupTo run any React application, we need to first setup a ReactJS Development Environment. In this article, we will show you a step-by-step guide to installing and configuring a working React development environment.Pre-requisite:We must have Nodejs installed on our PC. So, the very first step will be
3 min read
React ComponentsIn React, React components are independent, reusable building blocks in a React application that define what gets displayed on the UI. They accept inputs called props and return React elements describing the UI.In this article, we will explore the basics of React components, props, state, and render
4 min read
ReactJS Props - Set 1The react props refer to properties in react that are passed down from parent component to child to render the dynamic content.Till now we have worked with components using static data only. In this article, we will learn about react props and how we can pass information to a Component.What are Prop
5 min read
ReactJS StateIn React, the state refers to an object that holds information about a component's current situation. This information can change over time, typically as a result of user actions or data fetching, and when state changes, React re-renders the component to reflect the updated UI. Whenever state change
4 min read
React FormsForms are an essential part of any application used for collecting user data, processing payments, or handling authentication. React Forms are the components used to collect and manage the user inputs. These components include the input elements like text field, check box, date input, dropdowns etc.
5 min read
React ListsReact Lists are used to display a collection of similar data items like an array of objects and menu items. It allows us to dynamically render the array elements and display repetitive data.Rendering List in ReactTo render a list in React, we will use the JavaScript array map() function. We will ite
5 min read
Create ToDo App using ReactJSIn this article, we will create a to-do app to understand the basics of ReactJS. We will be working with class based components in this application and use the React-Bootstrap module to style the components. This to-do list allows users to add new tasks and delete them by clicking the corresponding
3 min read
Redux Setup and basics
Introduction to Redux (Action, Reducers and Store)Redux is a state managing library used in JavaScript apps. It simply manages the state of your application or in other words, it is used to manage the data of the application. It is used with a library like React.Uses: It makes easier to manage state and data. As the complexity of our application in
4 min read
Redux and The Flux ArchitectureFlux Architecture: Flux is AN architecture that Facebook uses internally when operating with React. It is not a framework or a library. It is merely a replacement quite an architecture that enhances React and also the idea of unidirectional data flow. Redux is a predictable state container for JavaS
5 min read
React Redux Hooks: useSelector and useDispatch.State management is a major aspect of building React applications, allowing users to maintain and update application state predictably. With the introduction of React Hooks, managing state has become even more streamlined and efficient. Among the most commonly used hooks for state management in Reac
4 min read
What are Action's creators in React Redux?In React Redux, action creators are functions that create and return action objects. An action object is a plain JavaScript object that describes a change that should be made to the application's state. Action creators help organize and centralize the logic for creating these action objects.Action C
4 min read
What is Redux Thunk?Redux Thunk is like a co-worker for Redux, giving it the power to handle asynchronous actions. It's that extra tool that allows your Redux store to deal with things like fetching data from a server or performing tasks that take some time. With Redux Thunk, your app can smoothly manage both synchrono
3 min read
Creating custom middlewares in React ReduxIn React-Redux applications, managing the flow of data is crucial for building efficient and scalable apps. Redux provides a powerful state management solution, and custom middleware adds an extra layer of flexibility to handle complex scenarios effectively. Let's understand custom middleware in sim
5 min read
Common middleware libraries used in ReduxMiddleware libraries play a crucial role in Redux applications, enabling users to extend and enhance Redux's capabilities. The middleware libraries offer a wide range of capabilities and cater to different use cases and preferences. users can choose the middleware that best fits their requirements a
5 min read
Express and Mongo Setup
Mongo with Express TutorialMongoDB and ExpressJS are a powerful pair for web development. MongoDB provides flexible data storage, while ExpressJS simplifies server-side logic. Together, they make it easy to create modern web applications efficiently. MongoDB's document-based approach and ExpressJS's streamlined backend develo
5 min read
How to Install MongoDB on Windows?Looking to install MongoDB on your Windows machine? This detailed guide will help you install MongoDB on Windows (Windows Server 2022, 2019, and Windows 11) quickly and efficiently. Whether you are a developer or a beginner, follow this guide for seamless MongoDB installation, including setting up e
6 min read
How to Install Express in a Node Project?ExpressJS is a popular, lightweight web framework for NodeJS that simplifies the process of building web applications and APIs. It provides a robust set of features for creating server-side applications, including routing, middleware support, and easy integration with databases and other services.Be
2 min read
Mongoose Module IntroductionMongoose is a popular Object Data Modeling (ODM) library for MongoDB and Node.js. It provides a straightforward and structured way to interact with MongoDB, allowing you to define schemas for your collections, apply constraints, and validate data before storing it in the database. In this guide, we'
5 min read
Mongoose ConnectionsA Mongoose connection is a Node.js module that establishes and manages connections between a Node.js application and a MongoDB database. It optimizes resource utilization, handles connection pooling, and manages errors, facilitating efficient data operations.What is Mongoose Connection?A Mongoose co
6 min read
How to Connect MongoDB with a Node.js Application using MongooseJSMongoose is a powerful MongoDB object modeling library for Node.js enabling you to easily interact between your Node.js app and MongoDB. In this article we are going to explore how you can connect your Node.js app to MongoDB using MongooseJS. You will learn how to create a connection, specify schema
4 min read
Node.js CRUD Operations Using Mongoose and MongoDB AtlasCRUD (Create, Read, Update, Delete) operations are fundamental in web applications for managing data. Mongoose simplifies interaction with MongoDB, offering a schema-based approach to model data efficiently. MongoDB Atlas is a fully managed cloud database that simplifies the process of setting up, m
8 min read
Signup Form Using Node.js and MongoDBInstallations First, we need to include a few packages for our Nodejs application. npm install express --save Express allows us to set up middlewares to respond to HTTP Requests. npm install body-parser --save If you want to read HTTP POST data , you have to use the "body-parser" node module. npm in
3 min read
API Routing and Authentication
Postman- Backend Testing
Introduction to Postman for API DevelopmentPostman: Postman is an API(application programming interface) development tool that helps to build, test and modify APIs. Almost any functionality that could be needed by any developer is encapsulated in this tool. It is used by over 5 million developers every month to make their API development eas
7 min read
Basics of API Testing Using PostmanAPIs(Application Programming Interfaces) are very commonly used in development. Postman is a tool that can be used for API Testing. In this article, we will learn how to do simple API Testing using Postman. Go to your workspace in Postman.Click on the + symbol to open a new tab.Enter the API Endpoin
2 min read
How to use postman for testing express applicationTesting an Express app is very important to ensure its capability and reliability in different use cases. There are many options available like Thunder client, PAW, etc but we will use Postman here for the testing of the Express application. It provides a great user interface and numerous tools whic
3 min read
How to send different types of requests (GET, POST, PUT, DELETE) in Postman.In this article, we are going to learn how can we send different types of requests like GET, POST, PUT, and DELETE in the Postman. Postman is a popular API testing tool that is used to simplify the process of developing and testing APIs (Application Programming Interface). API acts as a bridge betwe
5 min read
How to test GET Method of express with Postman ?The GET method is mainly used on the client side to send a request to a specified server to get certain data or resources. By using this GET method we can only access data but can't change it, we are not allowed to edit or completely change the data. It is widely one of the most used methods. In thi
2 min read
How to test POST Method of Express with Postman?The POST method is a crucial aspect of web development, allowing clients to send data to the server for processing. In the context of Express, a popular web framework for Node, using the POST method involves setting up routes to handle incoming data. In this article, we'll explore how to test the PO
2 min read
How to test DELETE Method of Express with Postman ?The DELETE method is an essential part of RESTful web services used to remove specific resources from a server. Whether you are building a simple API or a complex web application, knowing how to use this method effectively is key. Here, we will explore how to Implement the DELETE method in Express.j
3 min read
How to create and write tests for API requests in Postman?Postman is an API(utility programming interface) development device that enables to construct, take a look at and alter APIs. It could make numerous varieties of HTTP requests(GET, POST, PUT, PATCH), store environments for later use, and convert the API to code for various languages(like JavaScript,
3 min read