Developing A Social Platform Using MERN Stack
Developing A Social Platform Using MERN Stack
Abstract—This is the era of internet and there are a lot of and much more in an unaltered, content controlled environ-
Social Media platforms out there that facilitate the sharing of a ment.
vast variety of user generated content. LinkedIn is a business
and employment oriented social platform whereas Twitter is
used to share recent news trends and updates. Pinterest is about
II. O BJECTIVE
discovering new content and ideas while Facebook is more about MERN Stack is a web development framework that uses
catching up with friends and family. These networks and virtual
communities cast a tremendous amount of influence on their MongoDB, ExpressJS, ReactJS and NodeJS as its four main
users. Here we have a similar content-oriented platform called technologies. Performance is much more important now be-
Social. It is designed and built for the users to connect and cause of the explosive growth in the number of electronic
share digital content (like text, images and/or gifs) related to devices with real-time and Internet capabilities. Consequently,
community, social, healthcare and welfare services. MERN stands the web development sector has experienced rapid expansion.
for MongoDB, ExpressJS, ReactJS and NodeJS (the four key
technologies that make the stack) and is used to built this fully The most popular web development frameworks over the past
responsive web application in conjugation with other APIs and few years have been based on conventional technologies like
tools. Servlets, ASP.NET, and PHP. The performance expectations of
Index Terms—MongoDB, ExpressJS, React, Node, Backend, today’s consumers are not met by these technologies, despite
Frontend, dependencies, Social Media, APIs, SPA (Single Page their widespread use and lengthy histories of research and de-
Application)
ployment. Recently, the MERN stack was developed because
I. I NTRODUCTION of its consistency and simplicity to address this performance
issue [3].
Interactive Web 2.0 Internet-based applications make up so-
The four technologies employed here in MERN stack are
cial media platforms. Simply put, they support the proliferation
all Javascript based in addition to being high-performance and
of online social networks by tying a user’s profile to those of
customizable. Therefore, the backend, frontend, and database
other persons or organisations. Through online communities
can be controlled easily if one knows JavaScript (and JSON),
and networks, social media platforms enable the development
which makes the technology a very popular choice. The
and dissemination of user-generated content that consists of
goal here is to utilize the fore-mentioned technologies to
knowledge, ideas, interests, and other kinds of expression [1].
design and implement a fully functional, user-friendly social
Social Media is not simply an important tool for communi-
platform. This web application will not only demonstrate the
cation, connecting people locally and globally, it also lets peo-
deployment of these tools but will also provide as a gizmo for
ple to share, create, and spread information. These platforms
further research along the lines of network formation, online
also cast an immense influence on consumer’s purchase habits
behaviour, social influence and much more.
and decisions through their product reviews, marketing tactics
and advertising algorithms. Businesses utilize social media
III. L ITERATURE R EVIEW
to interact with their target market, build brand awareness,
create leads, increase sales, and make money. Businesses may Facebook and Twitter-like social media platforms are start-
effectively target their advertising because to social networks’ ing to have a significant impact on academic publications as
exclusive access to members’ most sensitive information, well as corporate practises. Over the past few years, there
including their interests, hobbies, and frequented areas. It have been numerous academic study papers on the usage of
allows companies to not only engage with the customers on social media in business. Twitter has been studied to see what
a personal level but also influence them with the appropriate role it plays in a range of marketing contexts, from promoting
content, triggering desire and formulating purchase patterns brands and enterprises (Greer and Ferguson 2001) to having an
[2]. impact on political campaigns (Towner and Dulio 2012). The
Here we develop a fully functional and user-friendly social most widely used social media platform, Facebook, has been
platform that does not include any of the business models or studied in a variety of areas, like how it affects a company’s
customised advertising. It can be used as a tool for various or brand’s value (Plangger, 2012) to fundraising campaigns
studies on Influence, social network formations, homophily (Vericat 2010) [4].
Social media platforms are among the simplest and most
effective ways to disseminate information because they are so
widely used and because access to the internet is so quick
and inexpensive. As of March 5, 2020, the top 100 videos
on YouTube with the keyword ”coronavirus” had had more
than 165 million views collectively, with 85% of those views
coming from news channels, according to a recent study by
Basch et al. This clearly demonstrates how the accessibility,
influence and reach of Social Media effects all major aspects of
our life. Social networks work in fascinating manner, growing
more complex by the day. Using the concept of Homophily,
social networks facilitate a formation of clusters between
similar individuals across the world. These miniature networks
usually have influencers that trigger heard behaviour among
the users and active sharers that stimulate a chain or reactions.
By examining the sentiment occurring in a given social media
content and keeping track of a user’s information sharing
behaviour, one can eventually decipher customer behaviour Fig. 1. 3 Tier MERN Architecture.
and buying habits and by extension even predict and formulate
group patterns.
This is how news go viral, products go trending and exactly A single-page web application (SPA) or website interacts
why social media marketing is equivalent to a gold mine for with the user and dynamically updates the current web page
companies right now. That being said, we now know how rewriting the new or modified data from the web server, in
social media platforms are the single most effective medium contrast to the traditional practise of a web browser loading
to influence people and promote ideas globally. entirely new pages. The webpage will transition more quickly
to boost the appearance of a native app.
IV. F RAMEWORK (MERN) As opposed to the traditional way, all essential HTML,
MERN stack is a framework used for creating websites JavaScript, and CSS code is either fetched by the browser with
(web app development). MongoDB, ExpressJS, ReactJS, and a single page load or the required resources are dynamically
NodeJS make up its functional components. The specific role updated and loaded to the webpage as needed, generally in
of each of these elements while creating a web application are reaction to user activities. A SPA never refreshes the page [8].
listed below: Even using the tools mentioned above, it is difficult to build
a high-performance app that is fast, responsive, user-friendly
• MongoDB: The application data is stored in this by design and secure, maintaining user integrity and security.
document-oriented, No-SQL database.
• NodeJS: This is the JavaScript runtime environment that V. BACKEND (S ERVER - SIDE )
is used to run the JavaScript code on the machine itself, Building websites and web apps has always been done
instead of a browser. using server-side rendering, also referred to as back-end web
• ExpressJS: It is a framework that sits atop NodeJS and development. When we access a page, we send a request for
is used to create a website’s backend using NodeJS func- data to the server, which processes it and sends back a response
tions and structures. NodeJS was created to run JavaScript to the browser.
on computers, not to create websites, so ExpressJS was All the activities required to build an HTML page that the
created to fill that gap. web browser can understand are carried out on the remote
• ReactJS: It is a library that Facebook built. It is used server that houses the website or web application when a web-
to build the UI elements that go into a single page web site renders server-side. This entails processing any required
application’s user interface. logic as well as information queries from databases for that
As shown in Fig 1, the user interacts with the ReactJS web application.
UI components in the front-end of the application, which is While it waits for the distant server to finish processing the
situated in the browser. The backend of this application, which request and provide the response, the web browser on the other
is located on a server, is served by ExpressJS, which is built end sits idle. When a response is sent, web browsers interpret
upon NodeJS [7]. it and show the material on the screen.
A request to change data is sent to the Express server, which
is built on NodeJS, after any interaction. When necessary, VI. F RONTEND (C LIENT- SIDE )
Express fetches information from the MongoDB database and Client-side rendering, often known as front-end develop-
sends it to the application’s front end, where it is shown to ment, is a new style of site rendering that is employed in
the user. contemporary apps. JavaScript, which is now the de facto
standard web language, is used to render the content on React acts as the MVC’s ”V,” or view. JavaScript, HTML,
your computer as opposed to a distant web server in client- and CSS are used to create the Client layer (View), which is
side rendering. In actuality, this indicates that a browser built using the ReactJS framework. To access the features of
is responsible for generating the HTML output of the web our application, the user will have to interact with this level
application and that a server is only needed to provide the of the architecture.
raw web application. Additionally, it shows that a piece of the
presentation logic—the reasoning used to create a web page
and display it to the user on the screen—is handled on the
client-side.
With the introduction of JavaScript libraries like Angular,
React, and Vue, client-side rendering became more common.