assignment 2 cloud computing bao gồm source code When confronted with the aforementioned issues, the first thing I did was to relearn how nodejs works. By Understanding the fundamental terms as well as the operational principles, I weighed the advantages and drawbacks before deciding on express as the framework for the project. Then I choose the hbs view engine since its syntax and keywords are simple to understand. Furthermore, because hbs has a large user base, it is simple to find information. because nodejs has inconsistent library name. So Ill just read the nodejs homepages articles and documentation. Also, when checking instructions on forums, I need to know which library Im using. For example, I have two libraries with handlebars view engine: hbs and handlebars.
Trang 1ASSIGNMENT 2
Trang 2 Summative Feedback: Resubmission Feedback:
Internal Verifier’s Comments:
Signature & Date:
Trang 4Table of Figures:
Figure 1: Use-case diagram _5Figure 2: Home page 6Figure 3: Toy inventory 7Figure 4: Thing that happen if we hit the button Delete _7Figure 5: Add toy _8Figure 6: Update toy information UI 8Figure 7: IDE visual studio code _9Figure 8: Using github to manage source code _10Figure 9: Database server _10Figure 10: Dowload nodejs 11Figure 11: Connect to DB _12Figure 12: Create DB _12Figure 13: Create new repository _13Figure 14: My git repository _13Figure 15: Template engine 15
Trang 5A Introduction
We discussed several fundamental cloud computing concepts in the last paper In accordance with themethod, I offered in the last report, we will create a web application in the cloud today A web applicationutilizing Node.js and mongodb as the database exists These projects will be made available online withHeroku
Trang 63 Webapp screenshots:
3.1 Home page
Figure 2: Home page
This is the first interface when using the website It will show product and a navbar for menu list offunction
Trang 73.2 /me/stored/courses
Figure 3: Toy inventory
This screen displays a list of items To display a list for each interface We'll have a table to display everyitem characteristic Two function will be in the last column Update function is the anchor ’edit’ Thedelete option
Figure 4: Thing that happen if we hit the button Delete
Trang 83.3 /courses/create
Figure 5: Add toy
3.4 /courses/:id/edit
Figure 6: Update toy information UI
This view will appear when you click on the word “edit” icon in the product list At this interface, productinformation will be displayed and users can update to suit their needs This functionality is available toboth
categories and suppliers
Trang 9Configure a Cloud Computing platform with a cloud service provider’s framework (P5)
Step 1: Login to Mongodb atlas
Step 2: Create new cluster then select driver and driver version then copy the connection string below
Trang 10Step 4: Add IP
Step 5: paste the connection string into URI blank and change username and password in correct format
Step 6: Now we just hit the button Connect we’ll appear in Mongodb compass UI to manage owndata
Trang 11II Code implement and deploy process (P6)
1.Tool and frameworks:
1.1 IDE
I use Visual Studio Code because:
It is very light in weight and takes very little time to start
Support many other programming different include a lot of extensions, open source
Many shortcuts are available to make the job easy
Visual Studio Code support terminal command for Heroku CLI and Git CLI
Figure 7: IDE visual studio code
1.2 Frameworks:
I'll be using the express framework for this project Express is a lightweight and adaptable Node.js webapplication framework that gives both online and mobile apps access to a robust feature set Making astrong API is quick and simple with the abundance of HTTP utility methods and middleware construction
at your disposal Express offers a wide range of fundamental web application functionalities withouthiding the beloved Node.js features from view
Trang 121.3 Source code manager
Github will help me manage and share source with other members of the project team It also helps instoring
and also backing up source code
Figure 8: Using github to manage source code
Trang 13Figure 9: Database server
Trang 142 Deploy
2.1 Config framework express on the env
Express is a framework of nodejs, therefore the first thing which we need to do is download and installnodejs
Figure 10: Dowload nodejs
After finish the first stage, we need to create project and user terminal command to install express with
Node package manager: npm install express And check it in package.json file
Trang 152.2 Config and connect with mongodb
The next stage is connect to database In this project, we will use mongodb atlas because it's moresuitable for the project than setting up mongodb in local Therefore we need to create mongodb atlasaccount
Step 1: Connet to the mongodb server
Figure 11: Connect to DB
Step 2: Create new datebase and fill the DB name, collection name then hit the button create DB
Figure 12: Create DB
Trang 162.3 Config git and upload file to github
During web application development, I need to use Github to manage source and deploy it in heroku totest For each project, I will create one repository to manage
Figure 13: Create new repository
Then sync then folder with github by following command:
- git init
- git remote add origin <paste your git repo URL here>
-You can find the source code in your repository in github if upload successful
Figure 14: My git repository
Trang 17I II Difficulties which one can face during the development process (P7)
When I create and carry out this project, I encounter several challenges But I did my homework anddiscovered how to repair it I'll outline some challenges I've faced in this section and explain how Iovercame them
During the first use, when I don’t remember the exactly name of handlebars and only install handlebarlibrary but it's still work till I have some bugs and need to uninstall and reinstall handlebars Each libraryhas its own specific syntax,
so I confused a lot when looking up their functions
Next, I ran into a problem working with the view engine Different from writing server side and client-sidecode together in one file Source Code is structured in a model that is almost equivalent to MVC Hencetransferring the data between my view and routes in the early stages encountered some difficulties
Trang 18b Solution:
When confronted with the aforementioned issues, the first thing I did was to re-learn how nodejs works
By Understanding the fundamental terms as well as the operational principles, I weighed the advantagesand drawbacks before deciding on express as the framework for the project Then I choose the hbs viewengine since its syntax and keywords are simple to understand Furthermore, because hbs has a large userbase, it is simple to find information because nodejs has inconsistent library name So I'll just read thenodejs homepage's articles and documentation
Also, when checking instructions on forums, I need to know which library I'm using For example, I havetwo libraries with handlebars view engine: hbs and handlebars
Figure 15: Template engine
Trang 19b) Solution
Use VPN, VPN has two main advantage in this case
Cost-effectively provide employees, wherever they are, with a secure connection to both the company’scloud and data center-based applications and data
Authenticate users and ensure comprehensive, consistent security without having to purchase expensivehardware or networking equipment, or add IT complexity
of the system is required in order to avoid technical errors and security mishaps
Trang 20II Security issues and solution in cloud computing environment.
1 Data Loss/Leakage
Cloud-based environments make it easy to share the data stored within them These environments areaccessible directly from the public Internet and include the ability to share data easily with other partiesvia
direct email invitations or by sharing a public link to the data
Although this is one of the primary benefits of the cloud, the simplicity with which data may be shared viathe cloud raises serious worries regarding data loss or leakage In fact, 69 percent of enterprises cite this astheir primary cloud security concern Data interchange via shared connections or the establishment of apublic cloud-based archive makes it available to anyone with link information, and there are unique tools
on the Internet for searching for these unsecured cloud installations
Solution:
To protect the business's data from the aforementioned concerns of unauthorized discovery andloss, the organization should implement a data security solution This entire data security solution mustfulfill at least these requirements:
- Requirements for data categorization and standardization
- Requirements for data confidentiality
- Requirements for the capacity to monitor, identify, and prevent unwanted data transfer outside of thecompany
- Requirements for the solution set to operate effectively
2 Physical Security Risk
The security measures are useless if an attacker can connect directly to the system That way,they'll be able to bypass the majority of security systems and third-party security services like cloudflare.Besides,
criminals can directly harm the physical servers of the cloud
Solution:
The CSP must safeguard the physical location of the cloud data center to prevent unwanted on-site access
to CSC data There should also be security protocols in place, such as system guards or supervisors Torestrict access to critical data center sites, security methods such as fingerprint scanning, keycard access,and biometric scans are available
Trang 213 Organization:
If a Cloud Service Provider (CSP) goes out of business or is bought out by another organization Theremay be a space for the danger of hostile insiders within the corporation who may do harm by leveragingthe data generated by their CSCs (Customer/Consumer of Cloud Service)
Solution: The likelihood of a CSP hiring malevolent staff can be reduced by imposing severe legalconstraints on contracts when recruiting employees A complete security breach notification mechanism,
as well as a full assessment of the CSP It is critical for users to collaborate closely with the newdistributor's agent to understand contractual conditions Furthermore, users must create forms in order tosafeguard data