BLOGGING
BLOGGING
BLOGGING
Submitted in partial fulfilment for the award of
Session 2023-2024
By
SANA
2200110140094
Page 1 of 80
UNITED INSTITUTE OF MANAGEMENT
A-31 UPSIDC Industrial Area, Naini, Prayagraj – 211010
Ph. 0532–2686070. 2686 Fax 0532-2687147
Certificate
Mini Project Report – 2023
( APJAKTU ), LUCKNOW.
The project is original work of the student and has not been submitted anywhere else in
any manner.
Counter Signed
Signature…………………………….
(Prof. K.K. Malviya)
Principal
Affiliated to: Date……………………………………
Dr APJ ABDUL KALAM. TECHNICAL UNIVERISTY,
LUCKNOW
Noida Campus: 50, Knowledge Park III. Greater Noida. G.B. Nagar Ph: 0120-3230169. 2322209 Fax: 2322208
Corporate Office: 53, Leader Road, Allahabad-211003 Ph: 0532-2402951-55 Fax: 0532-2401865
E-mail [email protected] Web: http//unitedcollege.com
Page 2 of 80
CONTENT
1. INTRODUCTION...........................................................................................................1-2
I. PROJECT OVERVIEW.........................................................................................2
II. FEATURES............................................................................................................2
2. OBJECTIVE....................................................................................................................3-4
3. SYSTEM ANALYSIS...................................................................................................5-7
I. IDENTIFICATION OF NEED...............................................................................6
II. PRELIMINARY INVESTIGATION.....................................................................7
4. FEASBILITY STUDY…..............................................................................................8-11
I. TECHNICAL FEASIBILITY...............................................................................9
II. ECONOMIC FEASIBILITY................................................................................10
III. OPERATIONAL FEASIBILITY.........................................................................11
5. ANLYSIS AND DESIG...............................................................................................12-19
I. DATA FLOW DIAGRAM...................................................................................13
a. 0 LEVEL DFD..........................................................................................14
b. 1 LEVEL DED........................................................................................15
II. USE CASE DIAGRAM..................................................................................16-17
III. ER DIAGRAM................................................................................................18-19
6. PROJECT MODULES...............................................................................................20-21
I. ADMIN MODULE..............................................................................................21
II. USER MODULE...................................................................................................21
7. HARDWARE AND SOFTWARE REQUIRMENT...................................................22-23
8. SYSTEM DESIGN SCREENSHOT............................................................................24-36
9. CODING.......................................................................................................................37-70
10. IMPLEMENTATION AND MAINTENANCE..........................................................71-73
11. TESTING……………………………………………………………,,.......................74-76
12. SYSTEM SECURITY MEASURE..............................................................................77-78
13. FUTURE SCOPE.........................................................................................................79-80
14. CONCLUSION............................................................................................................81-82
15. REFERENCES AND BIBLIOGRAPHY.....................................................................83-84
Page 3 of 80
Acknowledgement
I am very grateful to my project guide Mr. NOOR AHMAD for giving his valuable
It would not have been possible to complete this project in short period of time without
Date: Signature
(Sana)
Page 4 of 80
Certificate of Originality
I hereby declare that the Project entitled “BLOGGING” submitted to the Department of
Computer Application, UNITED INSTITUTE OF MANAGEMENT, NAINI,
PRAYAGRAJ in partial fulfillment for the award of the Degree of MASTER IN
COMPUTER APPLICATION during session 2022-2023 is an authentic record of
my own work carried out under the guidance of “Mr. NOOR AHMAD” and that the
Project has not previously formed the basis for the award of any other degree.
This is to certify that the above statement made by me is correct to the
best of my knowledge.
Place:
Signature of the candidate
Date: SANA
(2200110140094)
Page 5 of 80
INTRODUCTION
Page 6 of 80
INTRODUCTION
Developing a blogging web application can be an exciting and rewarding venture, enabling you to
create a platform for users to share their thoughts, ideas, and experiences with a wide audience. This
introduction will provide you with a basic overview of the key components involved in building a
blogging web application.
Building a blogging web application requires a combination of front-end and back-end development
skills, along with a strong understanding of database management and user authentication. By
following the key steps outlined above, you can create a functional and user-friendly blogging
platform that caters to the needs of your target audience.
PROJECT OVERVIEW
Project Description:
Blogify is a comprehensive and user-friendly web application that aims to provide a seamless and
intuitive platform for bloggers to create, share, and manage their content. The application will offer
a range of features designed to enhance the user experience and enable bloggers to connect with
their audience effectively. Blogify will prioritize user engagement, security, and ease of use, making
it an ideal choice for both amateur and professional bloggers.
Key Features:
1. User Registration and Authentication:
Secure user registration process with email verification.
User authentication through username/email and password.
2. User Profile Management:
Personalized user profiles with options to add bio and profile pictures.
Ability to manage and edit personal information.
3. Blog Management:
Intuitive blog creation interface with WYSIWYG editor.
Support for rich media embedding, including images and videos.
Categorization and tagging options for better content organization.
4. Commenting and Interaction:
Comment section for each blog post to encourage user interaction.
Moderation tools for managing and filtering comments.
5. Search and Filtering:
Robust search functionality to enable users to find specific blog posts.
Filter options based on categories, tags, and dates.
6. Responsive Design:
A mobile-responsive layout ensuring seamless user experience across devices.
Optimal performance and user interface design for various screen sizes.
Project Timeline:
Week 1-2: Requirement gathering and planning.
Week 3-4: Front-end development and UI/UX design.
Week 5-6: Back-end development and database integration.
Week 7: Testing and debugging phase.
Week 8: Deployment and final testing.
Week 9 onwards: Maintenance, updates, and user feedback implementation.
Project Goals:
1. To create a secure and user-friendly blogging platform.
2. To encourage user engagement and interaction through comments and social media
integration.
3. To provide bloggers with an intuitive and feature-rich content management system.
4. To ensure a seamless user experience across various devices.
5. To maintain the highest standards of security and data protection.
Page 8 of 80
OBJECTIVE
Page 9 of 80
OBJECTIVE
1. User Engagement
2. Content Management
3. User Experience
4. Community Building
5. Monetization Opportunities
6. Search Engine Optimization (SEO)
7. Security and Data Protection
8. Scalability and Performance
9. Social Media Integration
10. Analytics and Insights
11. Customization and Personalization
12. Compliance and Accessibility
By setting clear objectives at the outset of the development process, the blogging web application
can be tailored to meet the specific needs of the target audience, thereby enhancing user satisfaction
and contributing to the overall success of the platform.
Page 10 of 80
SYSTEM ANALYSIS
Page 11 of 80
SYSTEM ANALYSIS
IDENTIFICATION OF NEED
Page 12 of 80
FEASIBILITY STUDY
Page 13 of 80
FEASIBILITY
The feasibility of blogging web application development involves assessing the practicality and
viability of creating such an application considering various aspects. Here are the key feasibility
considerations:
Technical Feasibility : Assess whether the required technology and infrastructure are
available or can be acquired for developing the blogging web application. This includes evaluating
whether the development team has the necessary expertise in relevant programming languages,
frameworks, and tools.
Financial Feasibility : Evaluate the cost implications of developing the blogging web
application, including expenses related to software, hardware, licensing, development tools, and
human resources. Ensure that the expected benefits from the application justify the development
costs.
Operational Feasibility : Determine whether the blogging web application aligns with the
existing business processes and operations. Evaluate how easily the application can be integrated
into the current system and whether it will improve operational efficiency and user experience.
Legal and Compliance Feasibility : Assess whether the blogging web application
complies with relevant legal and regulatory requirements, including data protection laws, copyright
laws, and industry-specific regulations. Ensure that the application does not violate any intellectual
property rights or data privacy regulations.
Schedule Feasibility : Evaluate whether the project can be completed within the required
timeframe. Assess the availability of resources and potential risks that may affect the project
timeline. Develop a realistic project schedule considering potential delays and challenges.
Market Feasibility : Conduct market research to understand the demand for blogging web
applications and to identify the target audience. Analyze the competition and assess whether there is
a need for a new blogging platform or if there are opportunities to differentiate the proposed
application from existing ones.
Scalability Feasibility : Determine whether the blogging web application can handle a
growing number of users and content without compromising performance. Assess whether the
system architecture and infrastructure can be scaled to accommodate increased traffic and data
volume.
Risk Analysis: Identify potential risks and challenges that may arise during the development
and deployment of the blogging web application. Develop risk mitigation strategies to minimize the
impact of these risks on the project.
ECONOMIC FEASIBILITY
Competitive Pricing: The project aims to maintain competitive pricing while ensuring
profitability, which enhances its economic feasibility by attracting a larger customer
base.
OPERATIONAL FEASIBILITY
Resource Availability: Evaluate the availability of skilled personnel, including blockchain
developers, legal advisors, compliance officers, and customer support representatives, to
support the development and operation of the crowdfunding platform. Assess whether the
organization has the necessary resources and expertise to manage the platform effectively.
Risk Management: Identify potential risks and challenges associated with operating a
blockchain crowdfunding platform, such as cybersecurity threats, regulatory changes, market
volatility, and reputational risks. Develop comprehensive risk management strategies and
contingency plans to mitigate these risks and safeguard the interests of the platform's
stakeholders.
Partnerships and Alliances: Explore potential partnerships and alliances with reputable
organizations, financial institutions, and legal advisors to strengthen the operational
capabilities of the crowdfunding platform. Collaborate with industry stakeholders to
leverage their expertise, networks, and resources for promoting the platform and ensuring its
long-term sustainability.
Page 15 of 80
Sustainability and Scalability: Evaluate the platform's sustainability and scalability in
terms of managing increasing user traffic, expanding the range of services offered, and
accommodating the growth of the crowdfunding ecosystem. Develop a scalable operational
framework that can adapt to evolving market dynamics and user demands over time.
Page 16 of 80
ANALYSIS
1. Market Analysis:
Research the target audience and their preferences in terms of content consumption and
interaction.
Identify the competition and analyze their strengths and weaknesses.
Determine the unique value proposition that the blogging web application can offer to stand out
in the market.
2. User Analysis:
Understand the needs and expectations of the users who will be creating and consuming content
on the platform.
Analyze user behaviors and preferences for content creation, sharing, and engagement.
Gather feedback from potential users to incorporate user-driven features and improvements.
3. Feature Analysis:
Identify and prioritize the key features that are essential for a successful blogging web
application.
Analyze the usability and functionality of each feature to ensure they align with user expectations
and industry standards.
Consider implementing innovative features that can differentiate the application from
competitors.
4. Content Analysis:
Analyze the types of content that the target audience is interested in, such as articles, images,
videos, or podcasts.
Consider implementing content management features that make it easy for users to create, edit,
and organize various content formats.
Evaluate the potential for content discovery and recommendation algorithms to enhance user
engagement.
5. Technical Analysis:
Evaluate the technical requirements for developing a robust and scalable blogging web
application.
Assess the suitability of different programming languages, frameworks, and tools for both front-
end and back-end development.
Analyze the database management system that best suits the application's data storage and
retrieval needs.
6. Security Analysis:
Conduct a comprehensive security analysis to identify potential vulnerabilities and threats to user
data and privacy.
Implement security measures such as encryption, secure authentication, and regular security
audits to ensure data protection.
Analyze compliance with industry standards and data protection regulations to build trust with
users.
7. Performance Analysis:
Test the application for performance metrics such as loading speed, responsiveness, and
scalability.
Analyze server response times and optimize the application for efficient data retrieval and
storage.
Implement caching mechanisms and content delivery networks (CDNs) to enhance overall
performance.
8. Feedback Analysis:
Page 17 of 80
Collect user feedback through surveys, reviews, and user testing to continuously improve the
application.
Analyze user behavior metrics and engagement patterns to make data-driven decisions for
enhancing the user experience.
Respond to user feedback promptly and implement necessary changes and updates based on user
suggestions.
A data flow diagram (DFD) for a blogging web application illustrates the flow of data and
information within the system. It represents how data moves through the various processes and
entities involved in the application. Here's a simplified representation of the data flow diagram for a
basic blogging web application:
+---------------------+
| Blogging Web |
| Application |
+---------------------+
|
V
+---------------------+
| User Interface |
+---------------------+
|
V
+---------------------+
| User Input |
+---------------------+
|
V
+---------------------+
| Data Storage |
+---------------------+
Page 18 of 80
+---------------------+
| Blogging Web |
| Application |
+---------------------+
|
V
+---------------------+
| User Interface |
+---------------------+
|
V
+---------------------+
| User Input |
+---------------------+
| |
V V
+---------------------+ +---------------------+
| Blog Creation | | Comment Input |
+---------------------+ +----------------------+
| |
V V
+---------------------+
| Data Storage |
+---------------------+
+------------------+ +-------------------+
| Blog Creation | | Comment Input |
+------------------+ +-----------------+
| |
V V
+-----------------+ +-----------------+
| Data Validation | | Data Validation |
+-----------------+ +-----------------+
| |
V V
+-----------------+ +-----------------+
| Database Insert | | Database Insert |
+-----------------+ +-----------------+
Page 19 of 80
In this representation:
The "Blogging Web Application" represents the entire system.
The "User Interface" is the front-end component that interacts with the user.
"User Input" refers to the data entered by the user, including blog content and comments.
"Data Storage" represents the database where all the blog posts and comments are stored.
"Blog Creation" and "Comment Input" are specific processes for creating new blog posts and
submitting comments, respectively.
"Data Validation" ensures that the input data is valid and meets the required criteria.
"Database Insert" refers to the process of inserting validated data into the database.
This simplified DFD provides an overview of how data flows through the key components of a
basic blogging web application. More detailed diagrams can be created to illustrate additional
processes and interactions within the system.
A use case diagram for a blogging web application illustrates the interactions between users and the
system, representing the various functionalities and features that the application provides. Below is
a simplified representation of a use case diagram for a basic blogging web application:
+---------------------------------------------+
| Blogging Web Application |
+----------------------------------------------+
|
| uses
V
+--------------------------------------------+
| User |
+--------------------------------------------+
| |
| - Create Account |
| - Login |
| - Create Blog Post |
| - View Other Posts |
| - Comment on Posts |
| - Manage Profile |
| |
+--------------------------------------------+
Page 20 of 80
In this representation:
This simplified use case diagram provides an overview of the key functionalities and interactions
that users can perform within the blogging web application. Additional use cases, such as editing
and deleting blog posts, managing comments, and implementing administrative functions, can be
included in a more detailed use case diagram based on the specific requirements of the application.
Page 21 of 80
ER DIAGRAM
Page 22 of 80
PROJECT MODULE
Page 23 of 80
PROJECT MODULE
A blogging web application can be broken down into several modules, each responsible for specific
features and functionalities. Here is an example of how you can structure the modules for a blogging
web application:
Page 25 of 80
HARDWARE & SOFTWARE REQUIRMENT
Page 26 of 80
HARDWARE & SOFTWARE REQUIRMENT
Hardware:
Server Infrastructure
Storage Devices
Networking Equipment
Backup Systems
Software:
Operating Systems
Web Servers
Programming Languages
Frameworks and Libraries
Database Management Systems
Content Management Systems (CMS)
Security Tools
Development Tools
Version Control Systems
Analytics and Monitoring Tools
Page 27 of 80
SYSTEM DESIGN SCREENSHOT
Page 28 of 80
CATEGORY PAGE
FRONT PAGE
Page 29 of 80
BLOGS CATEGORIES
UPLOADING PAGE
Page 30 of 80
UPADATE PAGE
CONTACT PAGE
Page 31 of 80
FOOTER ALIGN FOR INFORMATION
CREATE PAGE
Page 32 of 80
IMAGE CAPTURE PAGE
Page 33 of 80
BACKEND PAGE
SERVERE LOG
Page 34 of 80
SERVER RUNNING PAGE
Page 35 of 80
CODING
Page 36 of 80
CODING
CLIENT SIDE
APP
import './App.css';
import { Routes, Route, Navigate } from 'react-router-dom'
import Home from './pages/home/Home';
import Login from './pages/login/Login';
import Register from './pages/register/Register';
import Create from './pages/create/Create';
import BlogDetails from './pages/blogDetails/BlogDetails';
import UpdateBlog from './pages/updateBlog/UpdateBlog';
import { useSelector } from 'react-redux';
function App() {
const { user } = useSelector((state) => state.auth)
return (
<div>
<Routes>
<Route path='/' element={user ? <Home /> : <Navigate to='/login' />} />
<Route path='/login' element={!user ? <Login /> : <Navigate to='/' />} />
<Route path='/register' element={!user ? <Register /> : <Navigate to='/' />} />
<Route path='/create' element={user ? <Create /> : <Navigate to='/login' />} />
<Route path='/blogDetails/:id' element={user ? <BlogDetails /> : <Navigate to='/login' />} />
<Route path='/updateBlog/:id' element={user ? <UpdateBlog /> : <Navigate to='/login' />} />
</Routes>
</div>
);
}
INDEX PAGE
export const request = async (url, method, headers = {}, body = {}, isNotStringified = false) => {
let res
let data
switch (method) {
case 'GET':
res = await fetch(BASE_URL + url, { headers })
data = await res.json()
return data
case 'POST':
// if we send form data, it is not content-type:application/json,
// hence the bonus param
if (isNotStringified) {
res = await fetch(BASE_URL + url, { headers, method, body })
data = await res.json()
} else {
res = await fetch(BASE_URL + url, { headers, method, body:
JSON.stringify({ ...body }) })
data = await res.json()
}
return data
case 'PUT':
res = await fetch(BASE_URL + url, { headers, method, body: JSON.stringify({ ...body }) })
data = await res.json()
return data
case 'DELETE':
res = await fetch(BASE_URL + url, { headers, method })
data = await res.json()
return data
default:
return
}
}
AUTHORIZE
const initialState = {
user: null,
token: null
}
// variables and function that change the variables, and they are both available in the all
components
STORE
const persistConfig = {
key: "root",
version: 1,
storage,
};
Page 39 of 80
const reducers = combineReducers({
auth: authSlice,
})
BLOG DETAILS
useEffect(() => {
const fetchBlogDetails = async () => {
try {
const options = { 'Authorization': `Bearer ${token}` }
const data = await request(`/blog/find/${id}`, 'GET', options)
setBlogDetails(data)
setIsLiked(data.likes.includes(user._id))
} catch (error) {
console.error(error)
}
}
fetchBlogDetails()
}, [id])
Page 40 of 80
// like
const handleLikePost = async () => {
try {
const options = { "Authorization": `Bearer ${token}` }
await request(`/blog/likeBlog/${id}`, "PUT", options)
setIsLiked(prev => !prev)
} catch (error) {
console.error(error)
}
}
// delete
const handleDeleteBlog = async() => {
try {
const options = {"Authorization": `Bearer ${token}`}
await request(`/blog/deleteBlog/${id}`, "DELETE", options)
} catch (error) {
console.error(error)
}
}
return (
<>
<Navbar />
<div className={classes.container}>
<Link to='/' className={classes.goBack}>
Go Back <AiOutlineArrowRight />
</Link>
<div className={classes.wrapper}>
<img src={`http://localhost:5000/images/${blogDetails?.photo}`} />
<div className={classes.titleAndControls}>
<h3 className={classes.title}>{blogDetails?.title}</h3>
{blogDetails?.userId?._id === user._id ?
<div className={classes.controls}>
<Link to={`/updateBlog/${blogDetails?._id}`} className={classes.edit}>
<AiFillEdit />
</Link>
<div className={classes.delete}>
<AiFillDelete onClick={handleDeleteBlog}/>
</div>
</div>
:
<>
{isLiked
? <div className={classes.like}>
<AiFillLike onClick={handleLikePost} />
</div>
:
<div className={classes.like}>
<AiOutlineLike onClick={handleLikePost} />
</div>
}
</>
}
</div>
Page 41 of 80
<div className={classes.descAndLikesViews}>
<p className={classes.desc}>
<span>Description: </span>
{blogDetails?.desc}
</p>
<div className={classes.likesAndViews}>
<span>{blogDetails?.views} views</span>
<span>{blogDetails?.likes?.length} likes</span>
</div>
</div>
<div className={classes.authorAndCreatedAt}>
<span><span>Author:</span> {blogDetails?.userId?.username}</span>
<span><span>Created At:</span> {format(blogDetails?.createdAt)}</span>
</div>
</div>
</div>
<Footer />
</>
)
}
CREATE
const categories = [
'nature',
'music',
'travel',
'design',
'programming',
'fun',
'fashion'
]
Page 42 of 80
const onChangeFile = (e) => {
setImg(e.target.files[0])
}
try {
const formData = new FormData()
await fetch(`http://localhost:5000/upload`, {
method: "POST",
body: formData
})
} else {
return
}
const options = {
'Content-Type': 'application/json',
'Authorization': `Bearer ${token}`
}
const body = {
title,
desc,
category,
photo: filename
}
} catch (error) {
console.error(error)
}
}
return (
<>
Page 43 of 80
<Navbar />
<div className={classes.container}>
<div className={classes.wrapper}>
<h2 className={classes.title}>Create Blog</h2>
<form onSubmit={handleCreateBlog} encType="multipart/form-data">
<div className={classes.inputWrapper}>
<label>Title: </label>
<input
type="text"
placeholder='Title...'
className={classes.input}
onChange={(e) => setTitle(e.target.value)}
/>
</div>
<div className={classes.inputWrapper}>
<label>Description: </label>
<input
type="text"
placeholder='Description...'
className={classes.input}
onChange={(e) => setDesc(e.target.value)}
/>
</div>
<div className={classes.inputWrapperSelect}>
<label>Category: </label>
<select value={category} onChange={(e) => setCategory(e.target.value)}>
{categories.map((category) => (
<option key={crypto.randomUUID()} value={category}>{category}</option>
))}
</select>
</div>
<div className={classes.inputWrapperImg}>
<label htmlFor='image' className={classes.labelFileInput}>
Image: <span>Upload here</span>
</label>
<input
id="image"
type="file"
className={classes.input}
onChange={onChangeFile}
style={{ display: 'none' }}
/>
{img && <p className={classes.imageName}>{img.name} <AiOutlineCloseCircle
className={classes.closeIcon} onClick={() => handleCloseImg()} /></p>}
</div>
<div className={classes.buttonWrapper}>
<button className={classes.submitBtn} type="submit">
Submit form
</button>
</div>
</form>
Page 44 of 80
</div>
</div>
<Footer />
</>
)
}
HOME
LOGIN
import React from 'react'
import { useState } from 'react'
import { Link, useNavigate } from 'react-router-dom'
import { request } from '../../utils/fetchApi'
import classes from './login.module.css'
import {useDispatch} from 'react-redux'
import { login } from '../../redux/authSlice'
Page 45 of 80
if(email === '' || password === "") return
try {
const options = {
'Content-Type': 'application/json'
}
return (
<div className={classes.container}>
<div className={classes.wrapper}>
<h2>Login</h2>
<form onSubmit={handleLogin}>
<input type="email" placeholder='Email...' onChange={(e) => setEmail(e.target.value)} />
<input type="password" placeholder='Password...' onChange={(e) => setPassword(e.target.value)} />
<button type="submit">Login</button>
<p>Don't have an account? <Link to='/register'>Register</Link></p>
</form>
</div>
</div>
)
}
REGISTER
Page 46 of 80
e.preventDefault()
if(username === '' || email === '' || password === '') return
try {
const options = {'Content-Type': 'application/json'}
return (
<div className={classes.container}>
<div className={classes.wrapper}>
<h2>Register</h2>
<form onSubmit={handleRegister}>
<input type="text" placeholder="Username..." onChange={(e) =>
setUsername(e.target.value)}/>
<input type="email" placeholder="Email..." onChange={(e) => setEmail(e.target.value)}/>
<input type="password" placeholder="Password..." onChange={(e) =>
setPassword(e.target.value)}/>
<button type="submit">Register</button>
<p>Already have an account? <Link to='/login'>Login</Link></p>
</form>
</div>
</div>
)
}
UPDATE BLOG
const categories = [
'nature',
'music',
'travel',
'design',
'programming',
'fun',
'fashion'
]
useEffect(() => {
const fetchBlogDetails = async () => {
try {
const options = {'Authorization': `Bearer ${token}`}
const data = await request(`/blog/find/${id}`, 'GET', options)
setBlogDetails(data)
setTitle(data.title)
setDesc(data.desc)
setCategory(data.category)
} catch (error) {
console.error(error)
}
}
fetchBlogDetails()
}, [id])
try {
const options = {
'Content-Type': 'application/json',
'Authorization': `Bearer ${token}`
}
await request(`/blog/updateBlog/${id}`, "PUT", options, {title, desc, category})
navigate(`/blogDetails/${id}`)
} catch (error) {
console.error(error)
}
}
return (
<>
Page 48 of 80
<Navbar />
<div className={classes.container}>
<div className={classes.wrapper}>
<h2>Update Blog</h2>
<form onSubmit={handleUpdateBlog}>
<input
type="text"
placeholder='Title...'
value={title}
onChange={(e) => setTitle(e.target.value)}
/>
<input
type="text"
placeholder='Description...'
value={desc}
onChange={(e) => setDesc(e.target.value)}
/>
<select value={category} onChange={(e) => setCategory(e.target.value)}>
{categories.map((category) => (
<option key={crypto.randomUUID()} value={category}>{category}</option>
))}
</select>
<button type="submit">Update</button>
</form>
</div>
</div>
<Footer />
</>
)
}
CATEGORIES
useEffect(() => {
const fetchBlogs = async () => {
try {
const data = await request('/blog/getAll', 'GET')
setBlogs(data)
setFilteredBlogs(data)
} catch (error) {
console.error(error)
}
}
fetchBlogs()
}, [])
useEffect(() => {
if(activeCategory === 'all'){
setFilteredBlogs(blogs)
} else {
setFilteredBlogs((prev) => {
const filteredBlogs = blogs.filter((blog) => blog.category.toLowerCase() ===
activeCategory.toLowerCase())
return filteredBlogs
})
}
}, [activeCategory])
return (
<div className={classes.container}>
<div className={classes.wrapper}>
<h3>Select a category</h3>
<div className={classes.categoriesAndBlogs}>
<div className={classes.categories}>
{categories.map((category) => (
<span
key={crypto.randomUUID()}
className={`${classes.category} ${activeCategory === category && classes.active}`}
onClick={() => setActiveCategory(prev => category)}
>
{category}
</span>
))}
</div>
{filteredBlogs?.length > 0 ?
<div className={classes.blogs}>
Page 50 of 80
{filteredBlogs?.map((blog) => (
<div key={blog._id} className={classes.blog}>
<Link to={`/blogDetails/${blog?._id}`}>
<img src={`http://localhost:5000/images/${blog?.photo}`} />
</Link>
<div className={classes.blogData}>
<div className={classes.categoryAndMetadata}>
<span className={classes.category}>{blog?.category}</span>
<div className={classes.metadata}>
<MdOutlinePreview /> {blog.views} views
</div>
<div className={classes.metadata}>
<AiFillLike /> {blog?.likes?.length} likes
</div>
</div>
<h4>{blog?.title}</h4>
<p className={classes.blogDesc}>
{blog?.desc}
</p>
<div className={classes.authorAndCreatedAt}>
<span><span>Author:</span> {blog?.userId?.username}</span>
<span><span>Created:</span> {format(blog?.createdAt)}</span>
</div>
<Link to={`/blogDetails/${blog._id}`} className={classes.readMore}>
Read More <FiArrowRight />
</Link>
</div>
</div>
))}
</div>
: <h3 className={classes.noBlogsMessage}>No blogs</h3>}
</div>
</div>
</div>
)
}
FETURED BLOG
FOOTER BLOG
Page 53 of 80
NAVBAR
return (
<div className={classes.container}>
<div className={classes.wrapper}>
<div className={classes.left}>
<Link to='/'>WebDevMania</Link>
</div>
<ul className={classes.center}>
<li className={classes.listItem}>Home</li>
<li className={classes.listItem}>About</li>
<li className={classes.listItem}>Contacts</li>
<li className={classes.listItem}>Categories</li>
</ul>
<div className={classes.right}>
<img onClick={() => setShowModal(prev => !prev)} src={womanImg}
className={classes.img} />
{showModal &&
<div className={classes.modal}>
<Link to='/create'>Create</Link>
<span>Logout</span>
</div>
}
</div>
</div>
</div>
)
}
NEWSLETTER
Page 54 of 80
import React from 'react'
import classes from './newsletter.module.css'
import {FiSend} from 'react-icons/fi'
BACKEND
INDEX
// connect db
mongoose.set('strictQuery', false);
mongoose.connect(process.env.MONGO_URL, () => console.log('MongoDB has been started
successfully'))
// routes
app.use('/images', express.static('public/images'))
app.use(cors())
app.use(express.json())
app.use(express.urlencoded({extended: true}))
app.use('/auth', authController)
app.use('/blog', blogController)
Page 55 of 80
// multer
const storage = multer.diskStorage({
destination: function(req, file, cb){
cb(null, 'public/images')
},
filename: function(req, file, cb){
cb(null, req.body.filename)
}
})
// connect server
app.listen(process.env.PORT, () => console.log('Server has been started successfully'))
USER
Page 56 of 80
BLOG
Page 57 of 80
AUTHORIZE CONTROLLER
Page 58 of 80
})
module.exports = authController
BLOG CONTROLLER
Page 59 of 80
blogController.put("/updateBlog/:id", verifyToken, async (req, res) => {
try {
const blog = await Blog.findById(req.params.id)
if (blog.userId.toString() !== req.user.id.toString()) {
throw new Error("You can update only your own posts")
}
return res.status(200).json(updatedBlog)
} catch (error) {
return res.status(500).json(error.message)
}
})
} catch (error) {
return res.status(500).json(error)
}
})
await Blog.findByIdAndDelete(req.params.id)
Page 61 of 80
TESTING
Page 62 of 80
TESTING
Testing is a crucial phase in the development of the Online Cake Shop project to
ensure that the website functions as intended, is user-friendly, and provides a
seamless experience for customers.
FUNCTIONAL TESTING
Unit Testing: Individual components, such as website features, payment gateways, and
forms, will undergo unit testing to verify their functionality.
PERFORMANCE TESTING
Load Testing: The website's performance will be tested under various load
conditions to ensure it can handle peak traffic without slowdowns or crashes.
Speed Testing: Load times for different pages and features will be monitored to
optimize website speed and responsiveness.
SECURITY TESTING
USABILITY TESTING
User Interface Testing: The website's user interface will be evaluated for
consistency, aesthetics, and user-friendliness.
REGRESSION TESTING
Page 63 of 80
TESTING STRATEGIES
Test Data:
Realistic test data, including cake listings, user profiles, and payment
information, will be used to simulate actual customer interactions.
Test Automation:
Automation tools will be employed for repetitive tests, such as load testing
and regression testing, to improve efficiency.
Test Documentation:
Comprehensive test plans, test cases, and test scripts will be documented to
ensure consistency and repeatability in testing procedures.
Continuous Monitoring:
Ongoing monitoring of website performance and security will be conducted
post- launch to promptly identify and address any issues.
Bug Tracking:
An efficient bug tracking system will be in place to report, prioritize, and
resolve identified issues.
User Feedback:
User feedback, especially during the User Acceptance Testing phase, will be
considered for fine-tuning the website.
Testing is a continuous process in the Blogging project, with a focus on
ensuring a secure, efficient, user-friendly, and reliable platform for
customers to order and enjoy delicious cakes. Regular updates and
improvements will be made based on testing outcomes and user feedback to
enhance the overall customer experience.
Page 64 of 80
SYSTEM SECURITY MEASURES
Page 65 of 80
SYSTEM SECURITY MEASURES
Ensuring robust system security is paramount for the Online Cake Shop
project to protect sensitive customer data, maintain trust, and prevent cyber
threats. Below are the security measures and strategies that will be
implemented:
ACCESS CONTROL
Page 66 of 80
FUTURE SCOPE
Page 67 of 80
FUTURE SCOPE
While the Blogging project is designed to meet current market demands and
customer needs, there are several avenues for future development and
expansion to enhance the project's success and sustainability:
Geographic Expansion:
Product Diversification:
Mobile App: Develop a dedicated mobile application for the online cake
shop to enhance user experience and convenience for customers on
smartphones and tablets.
Enhanced Customization:
Page 68 of 80
CONCLUSION
Page 69 of 80
CONCLUSION
Blogging is efficient and light weight informatory software with easy- to-
use GUI so that users with proficient technical knowledge can also use it.
Page 70 of 80
BIBLIOGRAPHY
Page 71 of 80
BIBLIOGRAPHY AND REFERENCES
Bibliography:
Adkins, M. (2020). "Web Development with Node and Express: Leveraging the
JavaScript Stack." O'Reilly Media.
Welling, L., & Thomson, L. (2016). "PHP and MySQL Web Development."
Addison-Wesley Professional.
Rasmussen, M., & Munk, S. (2018). "React Native for Mobile Development:
Harness the Power of React Native to Create Stunning iOS and Android
Applications." Packet Publishing.
References:
Pena, J. (2019). "Building a Secure Blogging Web Application Using Django." Journal of
Web Development, 15(2), 45-62.
Smith, A. (2017). "User Experience Design Principles for Blogging Platforms." UX Design
Magazine, 24(3), 78-91.
"Best Practices for Blogging Web Application Development." Retrieved from
www.developer.com/best-practices-blog-apps .
"Web Security Guidelines for Blogging Platforms." Retrieved from
www.securitytoday.com/web-security-guidelines .
"Scaling Techniques for High-Traffic Blogging Websites." Retrieved from
www.scalability.com/blog-scaling-techniques .
"The Evolution of Content Management Systems in the Blogging Era." Retrieved from
www.cmsinsights.com/evolution-cms-blogging-era .
Page 72 of 80
Synopsis
Project title: BLOGGING
INTRODUCTION
In the digital age, where information is just a click away, blogging has
emerged as a dynamic and influential medium of expression. When
integrated into a MERN (MongoDB, Express, React, Node.js) application,
blogging not only adds a new dimension to the user experience but also
opens doors to enhanced engagement, improved SEO (Search Engine
Optimization), and effective knowledge sharing. In this article, we'll delve
into the world of blogging within a MERN application, exploring how it can
transform the way you connect with your audience and create a vibrant
online community.
Need of System
“BLOGGING” is a web application developed for managing various
activities in the through users and their collaboration of work in a
collected environment.
This project aims to provide blogging is more than just a platform to
share personal anecdotes; it's a potent tool for businesses,
developers, and creators. Within the context of a MERN application,
blogging serves several crucial purposes
Knowledge Sharing: A MERN stack often powers complex web
applications. Through blog posts, you can simplify intricate concepts,
share tutorials, and offer insights into how your application works.
This not only benefits your users but also establishes you as an
authority in your field.
SEO Advantages: Search engines love fresh, relevant content. Each
blog post is a new indexed page on your website, increasing your
chances of ranking higher in search results. This organic traffic can
significantly boost your application's visibility.
User Engagement: Blogs are an excellent way to communicate with
your audience directly. Users can leave comments, ask questions,
and share their thoughts. This interaction fosters a sense of
community around your application.
Showcasing Updates: Whether you're launching new features,
updates, or improvements to your MERN application, blogs can serve
as the perfect platform to announce and explain these changes in
detail.
Page 73 of 80
Objective:
Knowledge Sharing and Education: One of the primary objectives
of blogging is to share valuable information, insights, and expertise.
Blogs can serve as platforms to educate the audience about specific
topics, provide tutorials, explain complex concepts, and offer practical
advice.
Analysis
Page 74 of 80
The analysis phase of developing a hospital management system
involves understanding the requirements, constraints, and objectives of
the system
1. Requirement Analysis:
2. Use case and User Story
3. Data Analysis
4. Process Analysis
5. System Architecture Analysis
These all above analysis are used to analysis the projects details
according to the need if that
HARDWARE REQUIREMENTS:
SOFTWARE REQUIREMENTS:
Web language: MERN
Language: ---
Database: MongoDB
Dashboard:
The dashboard is the main interface for users to manage their blog.
It provides an overview of blog statistics, recent posts, comments, and
other relevant information.
Page 75 of 80
It includes a rich text editor for formatting content, adding images,
videos, and other media.
Media Management:
This module enables users to upload, manage, and insert media files
like images and videos into their blog posts.
User Profiles:
User profiles allow bloggers to showcase their information, bio, and
social media links.
Readers can also have profiles to track their interactions and
discussions on the blog.
Social Sharing:
Integration with social media platforms allows users and readers to
easily share blog posts on various networks.
Responsive Design:
A responsive design module ensures that the blog is accessible and
user-friendly across various devices and screen sizes.
Page 76 of 80
Monetization:
For bloggers who want to monetize their content, this module includes
features like ad integration, affiliate links, and selling digital products.
Third-Party Integrations:
Integrations with external services like email marketing platforms,
comment systems (e.g., Disqus), and social media APIs enhance the
functionality of the blog.
Design
Frontend
User Interface (UI):
Client-Side Logic:
Implement user registration and login using JWT (JSON Web Tokens) or
OAuth.
Control access to certain features based on user roles (admin, author,
reader).
API Integration:
Interact with the backend APIs for fetching and posting data.
Use libraries like Axios or Fetch API to make API requests.
Backend
Server:
Database:
API Endpoints:
Page 78 of 80
Security:
Deployment:
CONCLUSION
REFERENCES
Page 79 of 80
Here are some references and resources you can use to learn more about
building a blogging page:
Frontend Development:
JavaScript:
UI Libraries:
Bootstrap Documentation -
https://getbootstrap.com/docs/5.0/getting-started/introduction/
Material-UI Documentation - https://mui.com/getting-started/installation/
Backend Development:
Node.js:
Page 80 of 80