Skip to content

Lab Assignment 10: Mongo CRUD Operation with Amazon AWS

Moulika Chadalavada edited this page Nov 3, 2016 · 4 revisions

Mongo CRUD Operation with Amazon AWS

Class Id: 8
Student Id: 16234180
Student Name: Moulika Chadalavada


Objective

The main aim of this tutorial is to develop REST services for CRUD operation in MongoDB, this REST service is used in web application which contains Admin Login, Employee Registration, Home page where admin can view list of employees and also admin can update/delete details. This application has to be deployed in Amazon AWS.

Softwares/Tools Used

Mongo DB, Amazon AWS, Eclipse, JSP, HTML, Java, CSS, Tomcat

Application Desciption

This application is mainly to perform CRUD operations in Mongo DB with REST Service. Application contains Login page where the Admin has to login with valid details. After login list of employees are fetched from Mongo DB and displayed on Home Screen. Admin can also add new employees by giving employee details. Apart from this admin can update the employee details and can delete the existing employee. This application is deployed in Amazon AWS with below WAR file .

WAR File: https://github.com/cmoulika009/ASE-Lab-Assignments/blob/master/Lab-10-AWS-Mongo_CRUD/Source/AWSMognoProject.war

Once the application is deployed successfully in AWS a link is generated. Through which any one can access to the application.

Amazon AWS Link: http://asesampleproject.cpmgzupmmd.us-west-2.elasticbeanstalk.com/

Once the link is access the user can see login page, where the admin has to login with valid email id and password as shown below. If the user has not entered any details then validation will thrown to user. Also validation will be thrown if user has not entered valid email id (Email Id doesn't contain '@'/'.')

Admin Login Screen



Validation if no details entered in Login



Validation if invalid email id is entered



Login page with valid details



Once the admin is logged in successfully, the admin can view employee details which are fetched from MongoDB. So initially the connection is made to MongoDB by specifying the respective Collection Name. (**Mongo URL:** mongodb://root:password@ds057386.mlab.com:57386/aseproject). If there are no details then null values are displayed in Home screen.

Mongo DB Collection with no details



Home Screen with No Details



To add employee details 'Click here to add new employees!!!' has to be clicked which will redirected to employee register page. Here the admin can select all the employee details and once submits the form the details are stored in Mongo DB and the same is displayed in Home screen

Employee Registration Screen



Employee Details Displayed in Home Screen



Employee Details stored in Mongo DB



Once again if the admin logout and login again, all the record in DB are displayed in Home screen.

Apart from adding new employees, admin can update the employee details. The updated details will be stored in Mongo DB and the same in displayed in Home Screen also.

Update Link in Home Screen



Update Details Screen where Salary and Address is changed



Updated details in Mongo DB



Updated details in Home Screen



Admin can also delete the user from the Home screen, the deleted user is also removed from Mongo DB and the user is not displayed in Home screen.

Delete Link in Home Screen



Home Screen after deleting user



Amazon AWS Link for this application:

http://asesampleproject.cpmgzupmmd.us-west-2.elasticbeanstalk.com/

Source Code:

https://github.com/cmoulika009/ASE-Lab-Assignments/tree/master/Lab-10-AWS-Mongo_CRUD/Source

References

ASE Tutorial-10

http://stackoverflow.com

https://mlab.com

https://aws.amazon.com/

http://getbootstrap.com/

Clone this wiki locally