You are on page 1of 34

INTERNSHIP REPORT

A report submitted in partial fulfillment of the requirements for the Award of Degree of

BACHELOR OF TECHNOLOGY
In
COMPUTER SCIENCE AND ENGINEERING
By
NIKHIL
MURUGESAN
Reg. No: 18BCE10173
Under Supervision of
Virtusa Chennai.
(Duration: 7th Jan, 2022 to 31st March, 2022)

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


VIT BHOPAL UNIVERSITY
2018 – 2022

i
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
VIT BHOPAL UNIVERSITY

CERTIFICATE

This is to certify that the “Internship report” submitted by R. K. NIKHIL


MURUGESAN (Regd. No.: 18BCE10173) is work done by her and submitted during
2020 – 2021 academic year, in partial fulfillment of the requirements for the award of the
degree of BACHELOR OF TECHNOLOGY in COMPUTER SCIENCE AND
ENGINEERING, at Virtusa.

College Internship Guide Program Chair Dean


    Dr.   AVR Mayuri , Dr. Sandip Mal Dr. S. Poonkuntran
Senior Assistant Professor Senior Assistant Professor Dean/SCSE

ii
CERTIFICATION

iii
ACKNOWLEDGEMENT

First I would like to thank the Director of Virtusa for giving me the opportunity to do an
internship within the organization.

I also would like all the people that worked along with me in Virtusa with their patience
and openness they created an enjoyable working environment.

It is indeed with a great sense of pleasure and immense sense of gratitude that I
acknowledge the help of these individuals.

I am highly indebted to Dean Dr. S. Poonkuntran, for the facilities provided to accomplish this
internship.

I would like to thank my Program Chair Dr. Sandip Mal for his constructive criticism
throughout my internship.

I would like to thank Dr. AVR Mayuri for her support to get and complete internship in
above said organization.

I am extremely great full to my department staff members and friends who helped me in
successful completion of this internship.

NIKHIL MURUGESAN
(18BCE10173)

iv
ABSTRACT

Online Mobile Recharge is a web-based application developed in VS Code to


recharge mobile phones. The project focuses at providing an easy and reliable platform
to recharge mobile of any telecommunication company through online without buying
recharge card. The registered users of the system can recharge their prepaid mobile
phones or can pay their postpaid mobile bills from anywhere at any time.

The proposed project for recharging mobiles developed to automate the mobile
recharging process. It roots out the manual card system of recharge and introduces a
new and genuine online recharge process.

The online mobile recharge system is beneficial to both the admins and users.
Using the online application, the admin can add new operators, tariff plans, offers and
update or modify the existing tariff plans. It helps the users in creating their account,
and then recharging the mobiles phones at any time.

v
Methodology:
The system comprises of 2 major modules following with submodules:
1. Admin Module
 Add Operator
 Add Plans
 Add Offer
 View User
 View Transaction
 View / Edit Operator
 View Feedback

2. User Module
 Register
 New Recharge (Select Operator, Select Plan / Enter Amount)
 View Past Transaction
 View Offer
 Feedback

Programmes and opportunities:


The Institute combines pioneering research with top class education. An
innovative curriculum allows the student flexibility in selecting courses and projects.
Students, even at the undergraduate level, get to participate in ongoing research and
technology development - an opportunity unprecedented in India. As a result, a vibrant
undergraduate programme co-exists with a strong postgraduate programme.

Organization Information:
Virtusa Corporation is an American information technology services company founded in
1996in Sri Lanka and has its headquarters in Southborough, Massachusetts, United States. The
company provides IT consulting, business consulting, systems implementation and application
outsourcing services to large enterprises and software vendors.
The company has a community support program that focuses on education and uses its
IT competencies for meeting the needs of the community.

A team from Virtusa designed and developed a school management system, AKURA,
to assist schools with an effective mechanism to manage daily activities. The school
management system allows easy and centralised access to student information such as
schedules, report cards, attendance, grades, and extracurricular activities, as well as
teacher information. Through the system teachers and parents can collaboratively view
vi
students' progress. The system has been adopted by schools and universities across
different countries, and has been downloaded more than 6,000 times.
Virtusa facilitated setting up IT laboratories for 50 schools in the Uva province of Sri
Lanka. The program was carried out in partnership with a local university in Sri Lanka.
In 2010, the company leveraged its technology/QA expertise to support the One Laptop
Per Child (OLPC) program.
In the wake of the 2004 tsunami, its employees actively participated in the development
of Sahana, an open-source disaster management system.

Benefits to the company / institution through your report:

The Institute combines pioneering research with top class education. An


innovative curriculum allows the student flexibility in selecting courses and projects.
Students, even at the undergraduate level, get to participate in ongoing research and
technology development - an opportunity unprecedented in India.

vii
Learning Objectives/Internship Objectives

 Internships are generally thought of to be reserved for college students looking to


gain experience in a particular field. However, a wide array of people can benefit
from Training Internships in order to receive real world experience and develop
their skills.
 An objective for this position should emphasize the skills you already possess in
the area and your interest in learning more
 Internships are utilized in a number of different career fields, including
architecture, engineering, healthcare, economics, advertising and many more.
 Some internships are used to allow individuals to perform scientific research
while others are specifically designed to allow people to gain first-hand
experience working.
 Utilizing internships is a great way to build your resume and develop skills that
can be emphasized in your resume for future jobs. When you are applying for a
Training Internship, make sure to highlight any special skills or talents that can
make you stand apart from the rest of the applicants so that you have an improved
chance of landing the position.

viii
WEEKLY OVERVIEW OF INTERNSHIP ACTIVITIES

DATE DAY NAME OF THE TOPIC/MODULE COMPLETED


Reporting at office with all Photocopies of
10/1/22 Monday Documents.
Overview to Company Profile & Total Internship Schedule
1st WEEK

11/1/22 Tuesday Brief Introduction on Using GIT


12/1/22 Wednesday Discuss PROS & CONS of Full Stack
13/1/22 Thursday Learning the Angular and SpringBoot
14/1/22 Friday Learn FrontEnd
15/1/22 Saturday Holiday

DATE DAY NAME OF THE TOPIC/MODULE COMPLETED

17/1/22 Monday Holiday

18/1/22 Tuesday Learning FrontEnd


WEEK

19/1/22 Wednesday Working with VS Code


2nd

20/1/22 Thursday Holiday

21/1/22 Friday Sample Projects

22/1/22 Saturday Holiday

ix
DATE DAY NAME OF THE TOPIC/MODULE COMPLETED

24/1/22 Monday Holiday

25/1/22 Tuesday Introduction to API


WEEK

26/1/22 Wednesday Configuring VS Code


3rd

27/1/22 Thursday Holiday

28/1/22 Friday GIT Issues

29/1/22 Saturday Holiday

DATE DAY NAME OF THE TOPIC/MODULE COMPLETED


31/1/19 Monday Discussion on left over Topics
WEEK

1/2/22 Tuesday Holiday


2/2/22 Wednesday Holiday
th

3/2/22 Thursday Assigning Projects


4

4/2/22 Friday Developing Frontend


5/2/22 Saturday Developing Frontend
6/2/22 Monday Holiday
7/2/22 Tuesday Developing Frontend
Developing Frontend
8/2/22 Wednesday
9/2/22 Thursday Developing Frontend
For the upcoming weeks it was development of frontend and
backend

x
DATE DAY NAME OF THE TOPIC/MODULE COMPLETED

Integration of FrontEnd and BackEnd


FINAL WEEK

28/3/22 Monday

29/3/22 Tuesday Group Meeting regarding integration


30/3/22 Wednesday Intern Meet by Virtusa
31/3/22 Thursday Presenting the project
1/4/22 Friday Review by the Manager
2/4/22 Saturday Holiday

xiii
INDEX

SNo. Contents Page


no.

1. Introduction 13
Background
Objective
Purpose
Scope

2. Architecture 14
Requirement and Analysis:
Planning and Scheduling
Problem Definition
Advantages of Proposed System

3. Preliminary Product Description 15


Feasibility Study
Economic Feasibility
Operational Feasibility
Schedule Feasibility
Legal Feasibility

4. Project Implementation 16

5. Source Code 20

6. Input/Output 30

7. Conclusion 32

8. Bibliography & References 33

xiv
INTRODCTION

Background:
In the current system the user who want to recharge their mobile have to go to any shop where
recharge is available. They have to go the shop and ask for the specific recharge. The
shopkeeper keeps the record of the number in any book.

Objective:
This project useful for online recharging of mobile. This System provides recharge of many mobile
companies as well as all kind of recharge are possible. This System will provide facility for customer
to recharge mobile at anytime from anywhere. This System keeps the history of the past recharges. The
user have to register himself.
Purpose :
The purpose of the web application is the automation of mobile recharge. It provides facilities
to
Admin:
 To add Tariff plans.
 To update, create and delete the tariff plans.

User:
 To enter and modify personal detail.
 To register himself.
 Can recharge at anytime.

Scope:
This website would help the customers to recharge their phones from anywhere and anytime
online.
1. ARCHITECTURE

Requirement and Analysis:


Planning and Scheduling:

The basic plan is to design such a website which would help the customer order
computer accessories at one click as per their requirement.We have scheduled to design this
system in about 2 months which will include entire coding of the website.
Problem Definition:
 Takes lot of time
 In current system maintaining security is very difficult.
 There are calculation errors.
 In today’s world most of the people don’t have time to go to retail shops and do the
recharge.
 Every time your talk time runs out, you have to rush to the vendor for buying recharge.
 Sometime while having an important talk/discussion with your friends/family/client, the
talk time get over.

Advantages of Proposed System:


 This is useful for customer to recharge mobile from anywhere and anytime.
 Easy to get information as per requirement.
 More user friendly since .net is a easy language.
 Maintain history of past as well as present recharges.
 Reduces paperwork.
 Very easy to maintain data and information about data.

14
Preliminary Product Description
Feasibility Study:
Feasibility – It is an evaluation of proposal designed to determine the difficulty in carrying out a
designated task. Generally a feasibility study precedes technical development and project
implementation. In other words, a feasibility study is an evolution or analysis of the potential impact of
proposed project. It is the important part of the primary investigation because only feasible project go
to development stages.
 Economic Feasibility:-
It deals with economic impact of system on the environment. It is used i.e. benefits in
creating the system. We are assuming economically feasible solution. The profit is
dependent on the sale of vouchers. Therefore, project is economically feasible.
 Operational Feasibility:-

It is a measure of how well a proposed system solves the problem and takes advantage of
the opportunity identified during scope definition and how it satisfies the requirements
identified in the requirements analysis phase of the system development.
 Schedule Feasibility:-
It is a measure of how reasonable project timetable is given by our technical expertise, are
the project deadline reasonable? Some projects are initiated with specific deadlines. You
need to determine whether the deadlines are mandatory or desirable.
A project will fall if it takes too long to be completed before it is useful. Typically this
means estimating how long the system will take to develop and if it can be completed in a
given time period using some methods like payback period.

 Legal Feasibility:-

Determine whether the proposed system conflicts with legal requirements.

15
11. Project Implementation

Users of the System:


1. Admin
2. Organizer
Functional Requirements:
- Build an application that customers can select plans and recharge online.

- The user will have option to select the plan and recharge it.

- The user can also select the add-ons required.

- The admin can add/view/edit/delete prepaid plans.

- The admin can also add/edit/view/delete postpaid plans.

- The admin can also add add/edit/view/delete add-ons.

- The admin can also add/edit/view/delete recharges.

- The user can give reviews.

Output/ Post Condition:


□ Records Persisted in Success & Failure Collections
□ Standalone application / Deployed in an app Container

Non-Functional Requirements:

Security ● App Platform – Username/Password-Based Credentials


● Sensitive data has to be categorized and stored in a securemanner
● Secure connection for transmission of any data

Performance ● Peak Load Performance (during Festival days, National holidaysetc.)

16
● Admin application < 2 Sec
● Non-Peak Load Performance
● Appointment Application< 2 Sec
● Admin Application < 2 Sec
Availability ● 99.99 % Availability

Standard ● Scalability
Features ● Maintainability
● Usability
● Availability
● Failover
Logging & ● The system should support logging(app/web/DB) & auditing at
Auditing all levels
Monitoring ● Should be able to monitor via as-is enterprise monitoring tools
Cloud ● The Solution should be made Cloud-ready and should have a
minimum impact when moving away to Cloud infrastructure
Browser ● All latest browsers
Compatible

Technology Stack
Front End Angular 10+
Material Design
Bootstrap
Server Side Spring Boot
Database MySQL

17
API Endpoints:

Admin Side:
Action URL Method Response
POST-Sends email
Admin Login /admin/login Return True/False
ID and password

Admin SignUp /admin/signup POST-Sends Admin added


Admin Model
data
Add plan /admin/addPlan POST – Send Plan Plan Added
Model Data
View Plan /admin/getAllPlan GET – Fetches Plan Retrieves all the plan details
data
Edit Plan /admin/editPlan/{pla PUT – Sends plan Id Plan Edited
nId}
Delete Plan /admin/deletePlan DELETE – Sends Plan Deleted
plan Id
Add add-on /admin/addAddon POST – Sends Add- Add-on Added
on Model data
View add-on /admin/getAddon GET – Get Addon Retrieve all the addon data
data
Edit add-on /admin/editAddon/{a PUT – send Addon Id Add-on edited
ddOnId}
Delete add-on /admin/deleteAddon/ DELETE – send Delete Addon
{addOnId} Addon Id

18
User Side:

Action URL Method Response


POST-Sends
User Login /user/login Return True/False
email ID and
password
POST-Sends
Admin SignUp /user/signup User added
User Model
data
Add Recharge /user/addRecharge POST – Send Plan
Plan data Recharged

View Recharge /user/getRecharge GET – Get Retrieve all


Plan data recharge
plans
Edit Recharge /user/editRecharge/{rechar PUT – Send Recharge plan
geId} recharge Id edited
Delete Recharge /user/deleteRecharge/recha DELETE – Recharge plan
rgeId} Sends Recharge deleted
Id
Add review /user/addReview POST – Sends Review added
Review data
View Reviews /user/getReview GET – Fetches Fetches all the
Review data reviews
Edit Reviews /user/editReview/{reviewI PUT – Sends Review edited
d} Review Id
Delete Reviews /user/deleteReview/{revie DELETE – Sends Review deleted
wId} review Id

19
12. Source Code

FrontEnd:

<script>
  $(document).ready(function() {
      $('#identicalForm').bootstrapValidator();
  });
  </script>

<div class="bg">

</div>

<div class="sidenav col-md-6 offset-md-3">
  <h3 class="main-head text-center font-weight-bolder text-white"> Login </h3>
  <form  (ngSubmit)="login()" #LoginForm="ngForm">
  
      
  
    <small class="text-danger">{{msg}}</small>
    <div class="form-group font-weight-bold text-white">
      <label> Email Id</label>
   
      <input type="text" class ="form-control" id = "emailId" [(ngModel)] = "user.emailId" n
ame = "emailId" placeholder="Enter EmailId"  >
  </div>
  
  <div class="form-group font-weight-bold text-white">
      <label> Password</label>
      <input type="password" class ="form-control" id = "password" [(ngModel)] = "user.passw
ord" name = "password" placeholder="Enter the password"  > 
          
  </div>
      
      <div class="form-group">
      
      <button type="submit" class="btn btn-success" [disabled]="!
LoginForm.form.valid">Submit</button>
      <p class="text-white">I already have an account. <a href="/signup">SignUp</a></p>
      </div>
  </form>
20
  </div>

<script>
    $(document).ready(function() {
        $('#identicalForm').bootstrapValidator();
    });
    </script>

<div class="bg"></div>

    <!--<div class="sidenav col-md-6 offset-md-3">
    <h3 class="main-head text-center font-weight-bolder text-black"> Sign Up </h3>
    <form  (ngSubmit)="onSubmit()" #SignupForm="ngForm">
    
        <div class="form-group font-weight-bold text-black " >
            <label> UserName</label>
            <input  type="text" class ="form-control" id = "username" 
                [(ngModel)] = "user.username" name = "username" placeholder="Enter UserName" 
  >

                

                
        </div>
    
        <div class="form-group font-weight-bold text-black">
            <label> MobileNumber</label>
            <input type="text" class ="form-control" id = "mobilenumber"
                [(ngModel)] = "user.mobilenumber" name = "mobilenumber"  pattern="^\d{10}$" 
placeholder="Enter your MobileNumber"  >
        </div>
    
        <div class="form-group font-weight-bold text-black">
            <label> Email Id</label>
            <input type="text" class ="form-control" id = "emailId"
                [(ngModel)] = "user.emailId" name = "emailId" placeholder="Example@gmail.com
" pattern=".+@gmail.com" size="30" min='5'  >
        </div>
        
        
            <input type="password" class ="form-control" id = "password"

21
                [(ngModel)] = "user.password" name = "password" placeholder="up to 8 charac
ters(One should be upperCase atleast and also @#₹ symbol must need)" pattern="(?=.*\d)(?
=.*[a-z])(?=.*[A-Z]).{8,}" 
                   />

                <div *ngIf="password.errors && (password.invalid && password.touched)" class
="alert alert-danger" style="margin-top: 10px;">
                    <div *ngIf="password.hasError(' ')">Password is  </div>
                    <div *ngIf="password.hasError('pattern')">Enter Valid password</div>
                   </div>

        </div>
        <div class="form-group font-weight-bold text-black">
            <label> Confirm Password</label>
            <input type="password" class ="form-control" id = "confirmpassword"  (ngModel) = 
"user.password"
             name = "confirmpassword" placeholder="Repeat the password again" pattern=".
{8,}"   
             [class.is-invalid]="password.invalid && password.touched"   />

             <span class="alert alert-danger"  [class.d-
none]="(confirmpassword.value==password.value) || password.untouched" style="margin-top: 10p
x;">Password doesn't Match</span>
                
        </div>

        <div class="form-group">
        
        <button type="submit" class="btn btn-success" [disabled]="!
SignupForm.form.valid">Submit</button>
        <p class="text-black">I already have an account. <a href="/login">Login</a></p>
        </div>
    </form>
    </div>-->
    <div class="sidenav col-md-6 offset-md-3">
        <h3 class="main-head text-center font-weight-bolder text-danger"> Sign Up </h3>
            <form [formGroup]="signupform" (ngSubmit)="onSubmit()" >
                <small class="text-danger">{{msg}}</small>
                <div class="form-group font-weight-bold text-black">
                    <label>Email:</label>
                    <br>
                    <input [(ngModel)] = "user.emailId" type="email" id="emailId" class ="f
orm-control" placeholder="Enter email" name="emailId" formControlName="emailId" pattern=".
+@[a-z]+[.][a-z]{3}" size="30" min='5'   >

22
                    <span style="color:red" *ngIf="emailId && emailId.invalid && emailId.to
uched">Please enter valid emailId</span>
                </div>
                <div class="form-group font-weight-bold text-black " >
                    <label> UserName:</label>
                    <br>
                    <input [(ngModel)] = "user.username" type="text" id="username" placehol
der="Enter Username" name="username" formControlName="username" class="form-control"  >
                    <span style="color:red" *ngIf="username && username.invalid && username
.touched">Please enter valid username</span>
                </div>
                <div class="form-group font-weight-bold text-black">
                    <label> Mobile Number:</label>
                    <br>
                    <input [(ngModel)] = "user.mobilenumber" type="text" id="mobilenumber" 
class ="form-control" placeholder="Enter Mobilenumber" name="mobilenumber" formControlNam
e="mobilenumber"  >
                <span style="color:red" *ngIf="mobilenumber && mobilenumber.invalid && mobi
lenumber.touched">Please enter valid mobile number</span>
                </div>
                <div class="form-group font-weight-bold text-black">
                    <label> Password:</label>
                    <br>
                    <input [(ngModel)] = "user.password" type="password" id="password" clas
s ="form-control" placeholder="Enter password" name="password" formControlName="password" (c
hange)="onPasswordChange()"  >
                    <span style="color:red" *ngIf="password && password.invalid && password
.touched">Please enter valid password</span>
                </div>
                <div class="form-group font-weight-bold text-black">
                    <label> Confirm Password</label>
                    <br>
                    <input type="password" id="confirmpassword" class ="form-control" place
holder="Confirm password" name="confirmpassword" formControlName="confirmpassword" (change)=
"onPasswordChange()" re >
                    <span style="color:red" *ngIf="confirmpassword && confirmpassword.inval
id && confirmpassword.touched &&confirm_password.hasError('mismatch')">Password and confirm 
password missmatch</span>
                </div>
                <br>
                
                <button type="submit" [disabled]="signupform.invalid" class="btn btn-
success" id="submitButton">Submit</button>
                Already a user ? <a id="signinLink" href="/login" >Login</a>
        
23
            </form>
    </div>

<!DOCTYPE html>
<meta name="viewport" content="width=device-width, initial-scale=1" charset="utf-8">

<html lang="en">
    
    <head>
        <link rel="stylesheet" href="popularplans.component.css">
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/
5.15.4/css/all.min.css">
    </head>
    <body>
        <div class="bg"></div>
        <div class="header">
            
            <a href="#" class="logo">AirNet </a>
        
            <nav class="navbar">
                <a href="/popularplans" class="userPlans" id="active">Popular Plans</a>
                <a href="/addons" class="userAddons">Addons</a>
                <a href="/notifications" class="notifications">Notifications</a>
                <a href="/login" class="login">Logout</a>
            </nav>
        </div>   
        <br>
        <br>
        <br>
        <div class="container">
            <div class="popularPlansGrid" *ngFor = "let plan of plans" >  
                <h1 class="heading">{{plan.planName}}</h1>
                <h2 class="service__price">Rs.{{plan.planPrice}}</h2>
                <ul class="features__list">
                    <li>Plan Type:{{plan.planType}}</li>
                    <li>Validity:{{plan.planValidity}}</li>
                    <li>Details:{{plan.planDetails}}</li>
                </ul>
                <h4><a><button class="recharge__button" (ngSubmit)="OnSubmit()" (click)="rec
hargeconfirmation(plan.planId)">Recharge</button></a></h4>
            </div>   
        </div>
</body>
</html>

24
BackEnd:

package com.examly.springapp.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.io.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.examly.springapp.service.UserModelService;

import com.examly.springapp.exception.ResourceNotFoundException;
import com.examly.springapp.model.UserModel;
import com.examly.springapp.repository.UserModelRepository;

@CrossOrigin(origins = "https://8081-
fcaafabafbacafecddebfdaffdacedbbebcbf.examlyiopb.examly.io")
@RestController
@RequestMapping("/api/v1/")
public class UserModelController {

    @Autowired
    private UserModelRepository UserModelRepository;

    @Autowired
    private UserModelService service;
    
    // get all UserModels
    @GetMapping("/Users")
    public List<UserModel> getAllUsers(){
        return UserModelRepository.findAll();
    }       
    
    // create User rest api

25
    /*@PostMapping("/Users")
    public UserModel createUser(@RequestBody UserModel user) {
        return UserModelRepository.save(user);
    }*/

    @PostMapping("/Users")
    public UserModel createUser(@RequestBody UserModel user)throws Exception {
        String tempEmailId =user.getEmailId();
        if(tempEmailId != null && !"".equals(tempEmailId))
        {
            UserModel userobj=service.fetchUserByEmailId(tempEmailId);
            if (userobj!=null)
            {
                throw new Exception("user with "+tempEmailId+"is present");
            }
        }
        UserModel userobj =null;
        userobj =service.saveUser(user);
        return userobj;
    }
    
    // get user by id rest api
    @GetMapping("/Users/{id}")
    public ResponseEntity<UserModel> getUserById(@PathVariable Long id) {
        UserModel user = UserModelRepository.findById(id)
                .orElseThrow(() -> new ResourceNotFoundException("User not exist with id :" 
+ id));
        return ResponseEntity.ok(user);
    }
    @GetMapping("/Users/email/{emailId}")
    public ResponseEntity<UserModel> getUserByemailId(@PathVariable String emailId) {
        UserModel user = UserModelRepository.findUserByEmailId(emailId);
        return ResponseEntity.ok(user);
    }
    
    // edit user rest api
    
    @PutMapping("/Users/{id}")
    public ResponseEntity<UserModel> editUser(@PathVariable Long id, @RequestBody UserModel 
userDetails){
        UserModel user = UserModelRepository.findById(id)
                .orElseThrow(() -> new ResourceNotFoundException("User not exist with id :" 
+ id));
        
        user.setusername(userDetails.getusername());
26
        user.setmobilenumber(userDetails.getmobilenumber());
        user.setEmailId(userDetails.getEmailId());
        user.setpassword(userDetails.getpassword());
        user.setuser_role(userDetails.getuser_role());
        
        UserModel editduser = UserModelRepository.save(user);
        return ResponseEntity.ok(editduser);
    }
    
    // delete user rest api
    @DeleteMapping("/Users/{id}")
    public ResponseEntity<Map<String, Boolean>> deleteuser(@PathVariable Long id){
        UserModel user = UserModelRepository.findById(id)
                .orElseThrow(() -> new ResourceNotFoundException("user not exist with id :" 
+ id));
        
        UserModelRepository.delete(user);
        Map<String, Boolean> response = new HashMap<>();
        response.put("deleted", Boolean.TRUE);
        return ResponseEntity.ok(response);
    }
    
    
}

package com.examly.springapp.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "Users")
public class UserModel {
    
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private long id;
    
    @Column(name = "username")
    private String username;

27
    @Column(name = "mobilenumber")
    private String mobilenumber;
    
    @Column(name = "email_id")
    private String emailId;
    @Column(name = "password")
    private String password;
    @Column(name = "user_role")
    private String user_role;
    
    public UserModel() {
        
    }
    
    public UserModel(String username, String mobilenumber, String emailId , String password, 
String user_role) {
        super();
        this.username = username;
        this.mobilenumber = mobilenumber;
        this.emailId = emailId;
        this.password = password;
        this.user_role=user_role;
    }
    public long getId() {
        return id;
    }
    public void setId(long id) {
        this.id = id;
    }
    public String getusername() {
        return username;
    }
    public void setusername(String username) {
        this.username = username;
    }
    public String getmobilenumber() {
        return mobilenumber;
    }
    public void setmobilenumber(String mobilenumber) {
        this.mobilenumber = mobilenumber;
    }
    public String getEmailId() {
        return emailId;
    }
28
    public void setEmailId(String emailId) {
        this.emailId = emailId;
    }
    public String getpassword() {
        return password;
    }
    public void setpassword(String password) {
        this.password = password;
    }
    public String getuser_role() {
        return user_role;
    }
    public void setuser_role(String user_role) {
        this.user_role = user_role;
    }
}

package com.examly.springapp;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ComponentScan;
//import org.springframework.data.jpa.repository.config.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.context.annotation.Bean;

@Configuration
@ComponentScan
@EnableAutoConfiguration

@SpringBootApplication

public class SpringappApplication {

    public static void main(String[] args) {
        SpringApplication.run(SpringappApplication.class, args);
    }

29
}

30
13. INPUT/OUTPUT

31
32
CONCLUSION

The project ONLINE MOBILE RECHARGE SYSTEM has been successfully designed
and tested. Integrating features of all the software components used have developed it.
Presence of every module has been reasoned out and placed carefully thus contributing to
the best working of the unit.
Full stack web developers have the ability to design complete web applications and websites.
They work on the frontend, backend, database and debugging of web applications or websites.

33
14. BIBLIOGRAPHY

REFERENCES :
 https://nevonprojects.com/online-mobile-recharge-portal-project/
 https://jpinfotech.org/online-mobile-e-recharge-portal/
 https://github.com/iamneo-production/382d18ed-e287-4db7-8cf3-da4093ab0e40
 https://github.com/NikhilMurugesan/Angular-10-Spring-Boot-CRUD-Full-Stack-App

34

You might also like