Tải bản đầy đủ (.pdf) (88 trang)

Assignment 2 Cloud Computing 1644 Distinction

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (5.15 MB, 88 trang )

ASSIGNMENT 2 FRONT SHEET
Qualification

BTEC Level 5 HND Diploma in Computing

Unit number and title

Unit 16: Cloud Computing

Submission date

25/12/2023

Date Received 1st submission

Re-submission Date

25/12/2023

Date Received 2nd submission

Student Name

Tran Duc Long

Student ID

GCH210562

Class


GCH1106

Assessor name

Nguyen Dinh Tran Long

Student declaration
I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that
making a false declaration is a form of malpractice.

Student’s signature
Grading grid
P5

P6

P7

P8

M3

M4

D2

D3


 Summative Feedback:


 Resubmission Feedback:

2.1

Grade:

2.2

Assessor Signature:

Internal Verifier’s Comments:

Signature & Date:

2.4

Date:

2.3


Table of Contents
A.

Introduction ............................................................................................................................................ 8

B.

Design ...................................................................................................................................................... 9

I.

Overview Function .............................................................................................................................. 9
1.

Solution ............................................................................................................................................ 9

2.

Use-case diagram............................................................................................................................. 9

3.

Website Screenshots: .................................................................................................................... 12

II.

Code implement and deploy process ................................................................................................ 24
1.

Tools and framework ..................................................................................................................... 24

2.

Deploy ............................................................................................................................................ 28

3.

Code Implement ............................................................................................................................ 35


4.

Source code and website ............................................................................................................... 52

III.
Difficulties which one can face during the development process and how to overcome them
(M3-D2) ..................................................................................................................................................... 52

C.

1.

Programming ................................................................................................................................. 52

2.

Debugging ...................................................................................................................................... 55

3.

Deploy ............................................................................................................................................ 61

Security.................................................................................................................................................. 65
I.

Some issue of Cloud computing platform ......................................................................................... 65
1.

Public Cloud ................................................................................................................................... 65


2.

Private Cloud.................................................................................................................................. 66

3.

Hybrid Cloud .................................................................................................................................. 67

II.

Security issues and solution in cloud computing environment (M4) ............................................... 67
1.

Cloud defense breaches ................................................................................................................ 68

2.

Misconfiguration............................................................................................................................ 68

3.

Data sharing risks ........................................................................................................................... 70

4.

Lack of clear visibility ..................................................................................................................... 71

5.

Cyberattacks .................................................................................................................................. 72


6.

Data leakage hazards ..................................................................................................................... 73


7.

Data privacy ................................................................................................................................... 74

8.

Data management ......................................................................................................................... 75

III.

How an organization should protect their data (D3) .................................................................... 76

1.

Using reputable Cloud Server service ............................................................................................ 76

2.

Set Up Backup And Recovery Options ........................................................................................... 77

3.

Encrypt Your Data .......................................................................................................................... 78


4.

Set user Permissions ...................................................................................................................... 79

5.

Set Up Property Passwords for users ............................................................................................ 81

6.

Secure End User Devices................................................................................................................ 83

7.

Avoid Uploading Confidential Data to cloud ................................................................................. 83

D. Summary ............................................................................................................................................... 84
E.

Conclusion ............................................................................................................................................. 86

References .................................................................................................................................................... 87


Table of Figures
Figure 1: Admin use-case diagram ............................................................................................................... 10
Figure 2: Customer use-case diagram .......................................................................................................... 11
Figure 3: Login and Register page ................................................................................................................ 12
Figure 4: Forgot-password and reset password ........................................................................................... 12
Figure 5: Dashboard page ............................................................................................................................ 13

Figure 6: Category management page ......................................................................................................... 13
Figure 7: Add Product and Show Product page ........................................................................................... 14
Figure 8: Show order and Detail order page ................................................................................................ 14
Figure 9: Show feedback and send email user contacted with shop ........................................................... 14
Figure 10: Show user and add/edit user page ............................................................................................. 15
Figure 11: Home page .................................................................................................................................. 15
Figure 12: Profile Page.................................................................................................................................. 16
Figure 13: Product page ............................................................................................................................... 16
Figure 14: For example, the product detail page of a product in shop ....................................................... 17
Figure 15:Favorite product page .................................................................................................................. 18
Figure 16: Cart Page ..................................................................................................................................... 19
Figure 17: Order page................................................................................................................................... 19
Figure 18: Contact page................................................................................................................................ 20
Figure 19: Footer in interface customer ...................................................................................................... 20
Figure 20: Function chat automatically ........................................................................................................ 21
Figure 21: Order exported by pdf ................................................................................................................. 22
Figure 22: Statistics on the amount of all orders from a user ..................................................................... 22
Figure 23: Email bills ..................................................................................................................................... 22
Figure 24:Use stripe for payment................................................................................................................. 23
Figure 25: Example about function asynchronous search in my website .................................................... 23
Figure 26: Example about some sweetAlert notifications are used on the website ................................... 24
Figure 27: Example about session alert in my website ................................................................................ 24
Figure 28: Visual studio code ....................................................................................................................... 25
Figure 29: Github .......................................................................................................................................... 26
Figure 30: MongoDB compass ...................................................................................................................... 27
Figure 31: Render ......................................................................................................................................... 27
Figure 32: Download Nodejs ........................................................................................................................ 28
Figure 33: Initial express project .................................................................................................................. 28
Figure 34: New cluster in mongdb ............................................................................................................... 29
Figure 35: Security Quickstart ...................................................................................................................... 29

Figure 36: Select IP to connect ..................................................................................................................... 30


Figure 37: Connect cluster............................................................................................................................ 30
Figure 38: Copy string to connect mongoDB compass ................................................................................ 31
Figure 39: Connect mongoDB compass ....................................................................................................... 31
Figure 40: Git init .......................................................................................................................................... 31
Figure 41: Git add . ....................................................................................................................................... 32
Figure 42: Git commit ................................................................................................................................... 32
Figure 43: Git remote ................................................................................................................................... 32
Figure 44: Git push ....................................................................................................................................... 32
Figure 45: Result of configure git ................................................................................................................. 32
Figure 46: Setup port to deploy web on cloud ............................................................................................. 33
Figure 47: Login to Render by github account ............................................................................................. 33
Figure 48: Create a new Web Service .......................................................................................................... 33
Figure 49: Deploy code from a git repository .............................................................................................. 33
Figure 50: Choose project to deploy ............................................................................................................ 34
Figure 51: Name and configure the run command ...................................................................................... 34
Figure 52: Deploy to render successfully ..................................................................................................... 34
Figure 53: Render Web on internet ............................................................................................................. 35
Figure 54: Config router ............................................................................................................................... 35
Figure 55: All model in my project ............................................................................................................... 35
Figure 56: All views in my project ................................................................................................................ 36
Figure 57: UserModel in my project............................................................................................................. 36
Figure 58: Function register in my project ................................................................................................... 37
Figure 59: Function Login in my website ...................................................................................................... 39
Figure 60: Router forgot password .............................................................................................................. 40
Figure 61: Router reset password ................................................................................................................ 41
Figure 62: Router handle upload file ............................................................................................................ 42
Figure 63: Utils in my project ....................................................................................................................... 43

Figure 64: Function cash order in my website ............................................................................................. 46
Figure 65: Order by credit card .................................................................................................................... 48
Figure 66: Use ajax to build function search ................................................................................................ 49
Figure 67: The router handles the search process ....................................................................................... 50
Figure 68: Function print_pdf in my website ............................................................................................... 51
Figure 69: Difficulty in dividing the layout when using hbs ......................................................................... 53
Figure 70: Use view EJS for this project ....................................................................................................... 54
Figure 71: Solution for choosing database ................................................................................................... 55
Figure 72: The main routers in my project ................................................................................................... 56
Figure 73: Callback hell in my project .......................................................................................................... 58
Figure 74: Use async / await in my project .................................................................................................. 59


Figure 75: Example of how nodemon detects errors in my project ............................................................ 60
Figure 76: Example of code using try catch on my website ......................................................................... 61
Figure 77: Mongoose warning error when deploying web to render ......................................................... 62
Figure 78: Set up IP address for cluster ........................................................................................................ 62
Figure 79: Config connect with mongoDB.................................................................................................... 63
Figure 80: Outdated library warning ............................................................................................................ 64
Figure 81: Install puppeteer library .............................................................................................................. 64
Figure 82: Websites review Render service provider .................................................................................. 77
Figure 83: Office 365 .................................................................................................................................... 79
Figure 84: Use middleware to authorize the website .................................................................................. 81
Figure 85: Use strong passwords for websites ............................................................................................. 82


A. Introduction
We live in a modern society where everything is modern and innovative. Every day, there is a
lot of innovation, especially in technology. When it comes to technology, we must admit that
it has permeated every aspect of our lives, from simple devices such as phones and computers

to complex programming applications. Currently, digital transformation technology is gaining
popular in a variety of disciplines, particularly e-commerce system. While offline stores are
progressively becoming outdated, online shops are an excellent solution for developing this
model.
In this assignment, I will demonstrate the design and process of building a fullstack toyStores
website for ATN company, specifically how I design and apply the MVC pattern in nodejs, using
the api for the project along with accompanying supporting technologies such as boostrap, ajax
and jquery to build a complete website for users and deploy it on cloud render. My website has
two main interfaces, admin and customers, and I have authorized for them so that customers
can go to the website to purchase and the administrator can receive data about orders as well
as perform other tasks, functions like add, edit, delete, send email, export orders , etc.


B.Design
I.

Overview Function
1. Solution
According to early 2023 data, the market has had a resurgence after the pandemic.
Recent statistics show that the number of consumers is increasing, especially in the
entertainment toy industry spanning many different age groups. Realizing this growing
trend, ATN company, which specializes in selling toys to teenagers in many provinces
and cities across Vietnam, hired me to launch an online business project with the main
focus on selling entertainment toys. This e-commerce venture includes a retail platform
for toys and related products, emphasizing the supply of genuine items sourced from
reputable brands. The website, called ToyStores, reflects the intention to replicate this
business model and provide high-quality products to an expanding consumer base. I
chose cloud computing, after clearly analyzing the needs of ATN businesses as well as
the benefits that cloud computing brings. The details of this implementation will be
detailed in this report.


2. Use-case diagram
Each interface will have a separate login account to access the website. You can sign up
for a normal account. The customer account cannot access the admin page.

2.1. Admin use-case diagram


Figure 1: Admin use-case diagram

In my website, admin can add, delete, update products and categories on the website,
in addition, censoring customer information is also very necessary. Administrators can
also add/edit user accounts and delete accounts and users that violate the terms.
Administrators can read customer feedback on products, email them to customers or
delete them once read. Admins can also approve and export orders as pdfs, view order
details, or delete canceled or long-delivered orders.


2.2. Customer use-case diagram

Figure 2: Customer use-case diagram

When accessing the website, customers can view products as well as search for
products they want to buy. Customers will not be able to access the shopping cart page
if they do not have an account in the system. Therefore, customers can register, log in
to use the website, update their personal information, view information about items on
the website and place an order, and can also delete products added to the cart.
Customers have 2 forms of payment: cash or credit card. After placing an order,
customers can view the orders they have purchased as well as their shipping process
and can send feedback to the shop to evaluate the quality of the items.



3. Website Screenshots:
3.1. Login and Register
Users can log in or register to create an account. Forgot password function so users can
retrieve their password by entering the email registered on the system to reset the
password.

Figure 3: Login and Register page

Figure 4: Forgot-password and reset password

3.2. Interface admin
a. Dashboard page
When the admin enters the website, the first interface will be the Dashbroad page, which will
display the statistics of the entire website including: revenue, total products, total customers, total
feedback, etc.


Figure 5: Dashboard page

b. Category management page
When the admin clicks on the category item on the slider, it will be redirected to the category
management page. Here they can add, edit or delete product categories at their discretion. They
can also search categories by name. Below is the category page after successfully adding Lego:

Figure 6: Category management page

c. Product management page
When the admin clicks on the product section here, there will be 2 options: add product and display

product. When they click on the add product option, they will be taken to a page to add or edit
products. Data when adding or editing products on the product add page will be displayed on the
product display page. On this page they can remove defective products or repair them. The edit
page is the same as the add page. If the user wants to edit a product on the system, they will click
the edit button on that product and the data will be returned to the add page.


Figure 7: Add Product and Show Product page

d. Order management page
When the admin clicks on orders, they are redirected to the order management page, where they
can view order details, export orders to pdf or delete old orders that have been shipped or
canceled. When the admin clicks the Details button in the orders management page of any order,
the website will take you to the details page of that order.

Figure 8: Show order and Detail order page

e. Feedback management page
When the admin clicks on the feedback item, they will be redirected to the feedback management
page where they can see the customer feedback for the website, they can perform Mark Read,
Delete or Feedback operations. If admin clicks on the feedback button of any feedback, it will be
redirected to the send Email page of the email with that feedback to send emails in response to
customers who have provided feedback.

Figure 9: Show feedback and send email user contacted with shop


f. User management page
When the admin clicks on the user section, they will be redirected to the user management page,
where they can add accounts, edit user rights as well as delete violated user accounts in the system.

The admin account cannot be deleted.

Figure 10: Show user and add/edit user page

3.3. Interface Customer
a. Home page
When customers log in successfully, they will go to the home page, where they will be able to
perform all the functions of the customers page.

Figure 11: Home page


b. Profile
This profile page allows customers to update their account information:

Figure 12: Profile Page

c. Product page
When people click on the products item in the navbar, they will be taken to the product page,
which will display all the products in the website. They can search, see detail or buy products.

Figure 13: Product page

d. Product detail


When users select any product on the products page, they will be redirected to that product's
detail page. Here they can see details, add to cart, add to love, comment product, reply
comment.


Figure 14: For example, the product detail page of a product in shop


d. Favorite Product
After a user clicks on the add to love button on the product detail page of any product, that
product will be added to that user's favorites. Users can find this page by clicking account and
selecting favorite to go to the page. This will contain all the products that the user has selected.
They can click to buy or cancel their favorites at will.

Figure 15:Favorite product page


e. Cart Page
When people click on the cart icon on the navbar, they will be redirected to the checkout page,
where they can delete or edit the products they have previously selected, then choose a payment
method by cash or credit card.

Figure 16: Cart Page

f. Order Page
Once users have placed their order, they can go to the ordering section of the navigation bar to
see the progress of their order. This page contains all the order information that users have
placed on the shop, where they can cancel or delete previously delivered orders.

Figure 17: Order page


g. Contact Page
When the user clicks on the contact item on the navbar, it will be redirected to the contact page
where the user can enter information to contact the shop, the data will be displayed on the

feedback management page in the admin interface.

Figure 18: Contact page

h. Footer in interface customer
This is a common footer to display for all pages in the customer interface

Figure 19: Footer in interface customer



×