Docsity

1644_Cloud Computing_Assignment 2, Assignments of Computer Programming

Toggle sidebar
bg1
ASSIGNMENT 2 FRONT SHEET
Qualification BTEC Level 5 HND Diploma in Computing
Unit number and title Unit 16: Cloud Computing
Submission date
Date Received 1st
submission
Re-submission Date Date Received 2nd
submission
Student Name Mai Tran Tuan Anh Student ID GCD201452
Class GCD0904 Assessor name Tran Trong Minh
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
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d

Partial preview of the text

Download 1644_Cloud Computing_Assignment 2 and more Assignments Computer Programming in PDF only on Docsity!

ASSIGNMENT 2 FRONT SHEET

Qualification BTEC Level 5 HND Diploma in Computing

Unit number and title Unit 16 : Cloud Computing

Submission date Date Received 1st submission

Re-submission Date Date Received 2nd submission

Student Name Mai Tran Tuan Anh Student ID GCD

Class GCD0904 Assessor name Tran Trong Minh

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 D

Summative Feedback:Resubmission Feedback:

Grade: Assessor Signature: Date:

Internal Verifier’s Comments:

Signature & Date:

Figure 1: Syntax to install express................................................................................................................................ 7 Figure 2: Visual Studio Code interface......................................................................................................................... 8 Figure 3: Mongodb atlas.............................................................................................................................................. 9 Figure 4: Heroku platform......................................................................................................................................... 10 Figure 5: Github interface.......................................................................................................................................... 11 Figure 6: Application use case diagram..................................................................................................................... 12 Figure 7: All application’s files................................................................................................................................... 13 Figure 8: Install package.json..................................................................................................................................... 13 Figure 9: Package.json............................................................................................................................................... 13 Figure 10: Install needed libraries............................................................................................................................. 13 Figure 11: Information of additional libraries............................................................................................................ 14 Figure 12: All libraries................................................................................................................................................ 15 Figure 13: Creating and running the server................................................................... Error! Bookmark not defined. Figure 14: Syntax to run the server................................................................................ Error! Bookmark not defined. Figure 15: Run the server successfully........................................................................... Error! Bookmark not defined. Figure 16: Login into mongodb...................................................................................... Error! Bookmark not defined. Figure 17: Creating new project.................................................................................... Error! Bookmark not defined. Figure 18: Given a name for the project........................................................................ Error! Bookmark not defined. Figure 19: Create a database......................................................................................... Error! Bookmark not defined. Figure 20: Choose deployment model........................................................................... Error! Bookmark not defined. Figure 21: Choose cloud provider and server region..................................................... Error! Bookmark not defined. Figure 22: Create new user............................................................................................ Error! Bookmark not defined. Figure 23: Choose type of database and adding new IP address................................... Error! Bookmark not defined. Figure 24: Database and cluster created successfully.................................................... Error! Bookmark not defined. Figure 25: Choose types of connection.......................................................................... Error! Bookmark not defined. Figure 26: Code to connect to the database.................................................................. Error! Bookmark not defined. Figure 27: Create a link for connection.......................................................................... Error! Bookmark not defined. Figure 28: Connection file.............................................................................................. Error! Bookmark not defined. Figure 29: Connection to database established............................................................. Error! Bookmark not defined. Figure 30: Main page................................................................................................................................................. 23 Figure 31: Add page....................................................................................................... Error! Bookmark not defined. Figure 32: Add success................................................................................................... Error! Bookmark not defined. Figure 33: New data has been added........................................................................................................................ 26 Figure 34: Edit page....................................................................................................... Error! Bookmark not defined. Figure 35: Edit information of toy 1............................................................................... Error! Bookmark not defined. Figure 36: Edit successfully............................................................................................ Error! Bookmark not defined. Figure 37: Toy edited................................................................................................................................................. 27 Figure 38: Click on delete button............................................................................................................................... 28 Figure 39: Delete confirm.............................................................................................. Error! Bookmark not defined. Figure 40: Toy deleted................................................................................................... Error! Bookmark not defined. Figure 41: Toy has been deleted................................................................................................................................ 28 Figure 42: Creating new repository........................................................................................................................... 29

I. INTRODUCTION

  • As we have mentioned before, we are responsible for developing a cloud web for a toy company which

named ATN. The cloud will provide the solution for managing the store in real time with a web

application deployed on cloud. This assignment will go deeper on how I design, implement code and

deploy the application onto cloud web

II. FRAMEWORK AND TOOLS

1. Express and NodeJS

  • I decided to use NodeJS as the main programming language for this application. Therefore, I also chose

to use express. Express is a straightforward and adaptable Node.js web application framework that offers

a complete set of functionalities for creating web and mobile applications. It enables the quick building

of Web applications with a Node framework. Here are some of the main characteristics of the Express

framework:

 Enables middleware to be configured to reply to HTTP requests.

 Establishes a routing table that is utilized to carry out various operations based on HTTP Method

and URL.

 Allows for the dynamic rendering of HTML pages based on template arguments.

  • To install express, we need to type a command inside the project that we have created: Figure 1 : Syntax to install express
  1. Visual Studio Code
  • Microsoft created the free open-source text editor known as Visual Studio Code (often referred to as VS

Code). Linux, macOS, and Windows all support VS Code. VS Code has recently become one of the most

widely used development environment tools, despite the editor's relatively modest weight and robust

capabilities.

  • VS Code supports a wide range of programming languages, including CSS, Go, and Dockerfile in addition

to Java, C++, and Python. In addition, VS Code enables you to add new extensions like code linters,

debuggers, and support for cloud and web development.

Figure 2 : Visual Studio Code interface

  1. Heroku
  • Heorku is a Platform as a Service (PaaS) cloud solution that enables the creation of Web services and

applications. It is a platform for building cloud applications that offers cloud management capabilities,

scalable processing capacity, and development tools. Originally designed for Ruby on Rails, Heroku now

supports a number of other programming languages.

  • To build, test, deploy, and manage the full application development lifecycle, Heroku offers a set of

development tools and application-specific services on a single platform. Heroku is made up of a number

of parts that work together to offer a full-featured cloud development environment. As an illustration,

APIs offer scalability, release management, collaboration, access control management, and other

operations management functions.

Figure 4 : Heroku platform

  1. Github
  • For software developers, GitHub is a web-based platform for version control and collaboration. Git is a

tool for storing source code for projects and keeping track of all code modifications. By providing tools

for handling potentially contradictory modifications from many developers, it enables developers to

work on a project more successfully. Developers can modify, adapt, and improve software from GitHub's

public repositories without paying a fee, but the company offers a number of premium plans for private

repositories. All of a project's files, as well as each file's revision history, are stored in each public or

private repository. Repositories can be either public or private, and they can have several collaborators.

  • GitHub offers an on-premises version in addition to the well-known SaaS product. GitHub Enterprise

supports integrated development environments and continuous integration tool integration, as well as a

litany of third-party apps and services. It offers increased security and auditability than the SaaS version

Figure 5 : Github interface

Figure 7 : All application’s files

  • First, I need to set up the environment. I will type command npm init to install the package.json file Figure 8 : Install package.json Figure 9 : Package.json
  • Then I will install all necessary libraries into the application using the command “npm i express” and

follow up with library needed. I will install morgan, nodemon, ejs, body parser and axios dotenv. All

information of these library will be put into the package.json file. This command will also create a new

package-lock.json file

Figure 10 : Install needed libraries

Figure 11 : Information of additional libraries 3.1 Server file

  • All code that related to creating and running the server will be put inside the app.js file. Also, all library

needed for the application such as express, body parser are also import here.

  • Find PostgreSQL and add into project Figure 14 : Find PostgreSQl Figure 15 : Install into the application

Figure 16 : Submit order form Figure 17 : Postgre is added into the application

  • For now, you need to install an application called pgadmin to be able to query and use the database. A

management tool for relational databases derived from PostgreSQL, such as EnterpriseDB's EDB

Advanced Server, is pgAdmin. It can be used as a desktop or web application.

Figure 20 : Pgadmin main page

  • At pgadmin main page, you will right click on server and choose register server. Figure 21 : Create new server