Final Report - 19070123125
Final Report - 19070123125
Submitted by
SHARMISHTHA TONGIA
PRN 19070123125
I hereby declare that the project work titled “ON CALL WEB APPLICATION” is an
authentic record of my own work carried out at Phonepe Pvt. Lmt. as requirements of five
months internship semester for the award of degree of B.Tech. ENTC Engineering,
Symbiosis Institute of Technology, Pune, under the guidance of Mr. Hans Gogia and
Mousumi Bhanja, during Jan to May.
(Signature of student)
19070123125
(PRN)
Date: ___________________
Certified that the above statement made by the student is correct to the best of our
knowledge and belief.
Phonepe has also expanded its offerings to include a variety of other services such as food
ordering ,cab bookings for movies and events.The platform has integrated with online
retailers so that users can pay directly through the app.
The phonepe app considers users in mind, it’s simple and effective to use, it has various
features for users to manage their money online and a simple way to secure payments
PhonePe's emphasis on security is another distinctive quality. To guarantee that user
transactions are safe and secure, PhonePe employs industry-standard security methods like
128-bit SSL encryption, two-factor authentication, and transaction limitations.
Overall, PhonePe is one of the most well-liked mobile payment platforms in India thanks
to its distinctive features. Millions of consumers love it because of its easy-to-use interface,
swift transactions, and variety of services. PhonePe is positioned to maintain its dominance
in India's mobile payments sector because to its emphasis on innovation and security.
TABLE OF CONTENT
INTRODUCTION TO PHONEPE 1
DETAILS OF PROJECT 2
WORK DONE 3-22
LEARNINGS 23-24
Introduction To Company
The way users interact on PhonePe has been improved by the constant addition of new
features in addition to its already robust set of capabilities. One of these features is PhonePe
Switch, which gives users instant access to a variety of services like restaurant ordering,
cab booking, among more, all within the PhonePe app. The customers can now access
different features without switching between many different applications, which has
increased convenience.
PhonePe's promotion of digital payments and reduction of the reliance on payments in cash
has significantly benefited the Indian economy. Interactions in a variety of industries,
including retail, hospitality, transportation, and more, have been made easier thanks to the
platform.
PhonePe has made a significant impact by facilitating financial inclusion. PhonePe has
made it feasible for people in India, where a substantial section of the population lacks
access to banking services, to conduct digital transactions. This has aided in closing the
gap between the populace that uses banks and that that doesn't, as well as helped the
economy as a whole expand.
The company PhonePe has made a significant impact by facilitating financial inclusion.
PhonePe has rendered it feasible for people in India, where a substantial section of the
population lacks access to banking services, to conduct digital transactions. This has aided
in closing the gap between the populace that uses banks and that that doesn't, as well as
helped the economy as a whole expand.
Additionally, PhonePe has assisted in the expansion of India's internet network. In order to
promote digital payments and advance the nation's overall digital infrastructure, it has been
closely collaborating with government officials and other parties in the equation. This has
aided in the formation of an ecosystem that is favorable for the expansion of digital
transactions and has helped the nation as a whole.
It has launched several campaigns to inform people about the benefits of digital payments
and encourage them to adopt it. These initiatives have helped increase people's awareness
of the importance of financial inclusion and contributed to the overall growth of India's
digital economy.
PROJECT UNDERTAKEN
Summary:
A web application powered by nginx using a distributed data system as backend which
demonstrate its high availability.
The web application is a user management system wherein a user can be added, updated
and deleted , it shows the users currently on rotation , it works through connecting with a
REST API which is connected to a mongodb cluster to fetch and update information to ,
the frontend and the backend are created on different instances on multipass while the
mongodb cluster is set up with ONE PRIMARY master node and 2 slave nodes to provide
high availability and scalability
For API-
Express
Node.js
Details:
this web application is built using nginx + javascript to showcase the high availability of
distributed data system - MongoDB
Features:
A distributed data system capable of maintaining high availability despite the failure of one
or more nodes using replica sets which maintain master and slave nodes
An nginx-hosted web application to manage Daily Oncall Roster. This web application
should support CRUD operations to add / fetch / update the name of the Oncall Person
using the Inputs from Web Page and APIs for the backend.
Even if one node of the distributed system enters a failing condition, the web application
should still function without any degradation.
1. CONFIGURING SERVERS
Servers are used to provide resources to a client over a network , servers are used
for web hosting , sharing resources, database management , they operate
continuously , providing access 24/7
We were supposed to configure multiple severs on multipass – a virtual machine , for all
the servers of my project .
-1 server for frontend
-1 server for backend
-3 server for database
-1 server for api
-1 server for nginx
To create a server in multipass I used the command , multipass launch and multipass list
Dependencies are modules that are installed through node package manager to add
functionality and development for the application , the dependencies used by me for my
project were as follows
Body-Parser: Body-Parser is parsers the request from the client side and can be used to
figure out values inserted in a form
Ejs (Embedded Java Script): It is a templating language that allows you to embed JS code
in html files , to access EJS , you need to use app.set a view engine with EJS
Mongoose – It is required for modelling my mongodb database schema and includes type-
casting , validation ,query building and other useful features
To configure a mongodb replica set , I had to first select a primary node and 2 slave nodes
so that all write requests are made to the primary node while all slave requests are made to
the secondary nodes.
To configure the replica set I had to edit the etc/hosts file for all the server files so their
ip’s could become publically accessible
Then I had to configure the firewall settings so the severs could talk to each other through
sudo ufw allow from 192.168.64.3 to any port 27017
After configuring the firewalls rule I had to configure the replica set by changing the
configuration file of mongod and adding a replica set name to the replication
After making the replication changes the mongod server is restarted then with rs.initiate a
replication set is configured where each node is given a priority , higher the priority , higher
are the chances for a node to become primary
Studio3T is IDE for MongoDB , a NOSQL database , it provides a GUI for interacting with
the MongoDB database , making it easier to view and manage data and perform database
functionalities
I first made a connection to my server with my primary node at 192.168.64.3 with the
application , after the connection I added random names , contacts and date information to
my database in a JSON format ({name: value, date:value , contact:value})
As visible from the image , the database is connected to my mongodb server 192.168.64.3
on port 27017 , which is the prime node of my mongodb cluster for accepting read requests
Now we check to see if the database is visible in all the nodes of the cluster
In the API , I first configure all the dependency modules like express, body-parser, ejs and
mongoose
Then I construct a try and catch block for trying to connect to the mongodb url and then a
catch for any errors that might come up , in the connection string for mongodb , I specify
try{
Mongoose.connect(“mongodb://user:password@hostname:portname,hostname:portname,
hostname:portname/dbname?authentication”)
}
Catch(err){
Console.log(err)
}
Const userSchema = {
name: String,
date:String,
contact:String
};
const User = mongose.model(“User”, userSchema);
I configure the API to work with GET, POST , PUT and Delete requests , the GET request
will fetch all the users in my dataset , the POST request will add a user to my database ,
the PUT will update a user and DELETE will delete a user
To test the functionality of my API I use tools like postman and Curl from the command
line , while making the header set to x-www-url-encoded
To testify the endpoint of my API , I use the tool postman and check if my api is
integrated with my mongodb cluster
Create EJS pages which will be served when user enters a particular path , require all the
dependencies installed in the first step and start a server at port 3000 which will listen for
any requests
when a client comes to the ‘/’ path , an index.html file is rendered , where the user can
make posts request which is then made to the api through FETCH API , after the user posts
the request , the user is then redirected to a page where all current users are listed
through res.redirect ‘/cuser’ , in the navigation bar the user can navigate to a update path
and a delete path
when a user navigates to the ‘/update’ path an updates.ejs file is rendered to the user which
will the let the user select the name , contact and date for updating the user , this is done
through sending a method:PUT through the fetch API
I provide fetch methods for all the pages in the script tag as
fetch(url){
method: Delete,
headers: {
content-type : ‘application/ x-www-form-urlencoded’
}
.then(response){
if(response.ok){
message = user deleted successfully}
else{
message = user deletion was not successful
]
I provide this for all the pages while changing the method to POST PUT OR GET
to deploy my node express app on nginx , I first had to install nginx and configure a server
block for the same in the /etc/nginx/sites-available directory if nginx
server{
server_name 192.168.64.2;
location /{
proxy pass http://192.168.64.2:3000;
proxy_http_version 1.1;
}
}
after creating the server block I create a symbolic link of my app in sites-enabled , and
remove the default website that nginx showcases
My website should now start on a browser and showcase nginx as a server in the
networking tools in the browser
It is possible to define the file system as the method of storing the data in a specific manner
in order for it to be located easily whenever it is essential to do so. The kind of file system
that was used is determined by the operating system that was used. The primary goal of the
file system is to simplify the process of storing information in a particular manner for both
the users and the operating system. This is done to ensure that both parties are able to store
or retrieve the files without difficulty. The file system is responsible for the files and
directories that are meant to be stored on the storage device using any operating system.
As its name suggests, the file system deals with these matters. The only thing the operating
system does is act as a go-between, facilitating the transmission of data from the data source
to the storage device so that it can be saved on that device.
Pwd :You can use the pwd command to print the working directory.
To list the contents of a directory, you use the ls command (short for list).
You can change to a different directory using the cd command (short for change directory).
Arguments is an input given as part of terminal commands.There can be one or more
arguments/parameters.
Options modify the behavior of a command.
Useful shortcuts.
up arrow key → will bring up the last command that was executed. Each press will bring
up the previous command executed.
history → will print out a list of the previous commands executed.
tab key → pressing the tab key can be used to auto-complete the directory and file names
while typing paths or filenames.
WEEK 2 OF TRAINING
User accounts are used to control access to Linux systems, and users are responsible for
monitoring and controlling their own activities once they have logged in.
Each user account has a username and a UID, both of which are completely unique
identifiers. When a user account is first created, the username associated with that account
is mapped to a certain UID.
A username is used by the user, but the UID is what the system refers to. It is impossible
for two users to share the same username.
UID cannot be changed. It is fixed in its current state. When it is allocated to a user account,
it does not change after that point onward.
Users are one-of-a-kind to a particular computer but are not one-of-a-kind across all
computers. This indicates that the user identifier (UID) on LAPTOP-1 may be the same as
the user identifier (UID) on LAPTOP-2, even if they are not the same user.
WEEK 3 OF TRAINING
Linux, just like other operating systems, uses permissions to guard its resources from
unauthorised access.
These permissions outline the proper procedures for a user to follow when accessing the
resources.
A person who accesses a resource, such as a user account, system process, or programme,
is considered to be a user of that resource.
A file or directory is an example of a resource, which refers to any object that users can
access.
There are three different levels of permissions for each object: user owner permissions,
group owner permissions, and other permissions. These permissions determine how a user,
group, and maybe other users can access an object.
(It is important to keep in mind that a group is simply a collection of users.)
person owner refers to the person who initially created the object in question or the user
who was designated as user owner by the user who actually owns the system or the root
(admin) user.
The major group of user owners or other groups selected by the actual owner or the root
user is referred to as the group owner.
Others refers to any users or groups that are not included in the previous two categories.
chmod 777 foldername will give read, write, and execute permissions for everyone. chmod
700 foldername will give read, write, and execute permissions for the user only.
chmod 327 foldername will give write and execute (3) permission for the user, w (2) for
the group, and read, write, and execute for the users.
Just for a moment, pretend that you are looking at a video on YouTube. That is exactly
what you plan to do next, which is to view the video. It is a huge relief to not have to
manually start the display services and network services and then keep an eye on them
throughout the day to make sure they are functioning correctly. We may thank daemons
for that because they take care of work of that nature on our behalf.
Daemons are useful programmes that operate invisibly in the background as daemons to
keep an eye on and maintain various subsystems in order to guarantee that the operating
system functions appropriately.
A systemd object that carries out or regulates a certain activity or operation is referred to
as a unit. Systemd makes use of units in order to start and stop services, manage those
services, organise the boot process, manage tasks and processes, generate sockets, mount
file systems, and initialise hardware.
A name, a type, and a configuration file make up what is known as a systemd unit. The
name gives the unit its own distinct identity throughout the world. The responsibility or
task that the unit is to perform is defined in the configuration file. The type allows the unit
to be grouped with other sorts of units that are comparable to it.
Consider systemd to be a bus driver and the units to be the controllers of the bus, such as
the gear, clutch, lever, brake, accelerator, and so on. This will help you grasp the connection
between systemd and the units. In the same way that the bus driver makes use of controllers
in order to drive and control the bus, the systemd makes use of units in order to drive and
control the system operations and services.
All sorts of software and operating systems use a file with the LOG file extension, which
is commonly referred to as a logfile, to keep account of anything that has occurred,
typically including an event detail, date, and time. It is possible to use it for anything that
the programme considers to be appropriate to record.
Antivirus software may, for instance, write information to a LOG file to describe the
findings of the most recent scan. This information may include the files and directories that
were scanned, those that were skipped, and the files that were identified as having harmful
code.
A programme that backs up files might generate a LOG file that can be opened at a later
time to look over a prior backup job, read through any errors that were encountered, or
view the location to which the files were backed up to.
Explaining the newest features that were added in the most recent update of a piece of
software is a far more straightforward goal for this format, which is why it was designed
the way it was. Release notes or changelogs are common names for these types of
documents.
LEARNING OUTCOMES
SRE TRAINING :