-
Notifications
You must be signed in to change notification settings - Fork 13
/
index.html
83 lines (72 loc) · 3.97 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--DO NOT CHANGE THE FOLLOWING LINES !!!-->
<link rel="stylesheet" href="styles.css">
<script src="https://habahram.github.io/ISTA330/practicum/week-8/tests.js" type="text/javascript"></script>
<title>Document</title>
</head>
<body>
<div>
In the previous practicum, you developed a <a href="https://restfulapi.net">REST API</a> using Nodejs and
Express and you deployed your REST API on Heroku. In this practicum, you will add
a <a href="https://www.postgresql.org/about/">PostgreSQL</a> database to your imagequiz-backend API.
<ul>
<li>To attach a PostgreSQL database to your imagequiz-backend application, you need to navigate
to the Resources tab in the header of your napplication's dahsboard.
Then type Heroku Postgres into the Add-ons search field.
Then select the suggested Heroku Postgres add-on from the dropdown.
The next popup asks you to choose a pricing plan for the database.
Select the Hobby Dev - Free plan and click Provision.
</li>
<li>
To find the credentials and the connection URL for the PostgreSQL database,
you need to navigate to the Resources tab in your application's dashboard on heroku and
select the Heroku Postgres resource. This brings you to the configuration screen of the your PostgreSQL
database.
Now select the Settings tab in the header of that screen.
Click the View Credentials button to see the credentials of your PostgreSQL database.
You can use these credentials to connect to your PostgreSQL database from DBeaver client tool.
</li>
<li>
<a href="https://dbeaver.io/about/">DBeaver</a> is a database tool using which you can connect to
your database and run sql commands on your database. Download and install a free community edition of
DBeaver
using <a href="https://dbeaver.io/download/">DBeaver official website</a>.
</li>
<li>To be able to use relational databases, we need to use the <a href="https://www.w3schools.com/sql/">SQL
language</a>. Refer to the lecture 'Adding a postgreSQL database to Express/Node.js API' on d2l for
more information about this language and how it is used to manipulate/query data in a relational database.
</li>
<li>
Using DBeaver, connect to your postgreSQL database on heroku and create the following tables with the
specified columns:
<ol>
<li>customer: id, name, email, password
(note: never save the actual password into the database.
You should always encrypt the password and save the hashed password.)</li>
<li>question: id, picture, choices, answer</li>
<li>category: id, name</li>
<li>quiz: id, name, category_id</li>
<li>quiz_question: quiz_id, question_id</li>
<li>flower: id, name, picture</li>
</ol>
</li>
<li>
Modify your imagequiz-backend to insert/get data to/from the postgreSQL database that you added to your imagequiz-backend
API. Refer to the lecture 'Adding a postgreSQL database to Express/Node.js API' to learn how to complete this step.
</li>
<li>
Deploy your modifed imagequiz-backend API to heroku.
</li>
</ul>
</div>
<div id="test-the-api">
</div>
<div class="iframe-container">
<iframe id="myApplicationFrame" src="" allowfullscreen></iframe>
</div>
</body>
</html>