README.md 4.91 KB
Newer Older
Mohammed Ahmed's avatar
Mohammed Ahmed committed
1
2
This application we have created allows users to monitor the food intake. Users will have 2 database include users and ingridients. The users database will manage all usets who are bale to update the application. Weheras, the ingridinets database will be used to CRUD data. ALl front on development can be found in the views folder, middleware/backend data can be found in routes/main.js. I have also submitted a copy of the main.js for the convients of the users.

Mohammed Ahmed's avatar
Mohammed Ahmed committed
3
4
1.Readme file submitted?, 2. Is the URL of the app submitted and working? 3. Is the URL of gitlab repo submitted and working? 4. Is it a Node.js app? (requirement 1) other programming languages are not acceptable. -Complete

Mohammed Ahmed's avatar
Mohammed Ahmed committed
5
2.Requirement 2 Home page-Complete:(/views/index.html):File can be found in views/index.html. This contains all the HTML content of the main page including navigations to other pages. All navigations can be found in the main.js.
Mohammed Ahmed's avatar
Mohammed Ahmed committed
6
7

3.Requirement 3 Register page-Complete:(/views/register.html):This contains the HTML content of the register page. When a users registers, the registered information after the validation checks is then stored in the listuserdb
Mohammed Ahmed's avatar
Mohammed Ahmed committed
8
-Email also has isEmail() validation. Lastly, if register form "isEmpty()", we will loop back to the form itself until the criterias are met.
Mohammed Ahmed's avatar
Mohammed Ahmed committed
9
10
11

4.Requirement 4 Login, test with the username you registered in requirement 3-Complete:(/views/login.html):This contains the login HTML content. When the form is filled, it checks the main.js and sees if we have a user called user1. 

Mohammed Ahmed's avatar
Mohammed Ahmed committed
12
5.Requirement 5 Add food page-Complete:(/views/addfood.html/Line:..):Html page whch has a form. When a logged in users adds food, it is stored into the ingridients database
Mohammed Ahmed's avatar
Mohammed Ahmed committed
13
14
15
16
17

6.Requirement 8 List page-Complete:(/views/list.html):This page list all food added to the ingridients database;

7.Requirement 11 database back-end, check list page, can you see recently added (or updated or deleted) food in the list page?-Complete:(/views/updatefood.html):this page includes two form which adds and removes and updated food from the daatabase;

Mohammed Ahmed's avatar
Mohammed Ahmed committed
18
8.Requirement 6 Update food page, test with the recipe you added in requirement 5, check list page and remark requirement 11 if necessary-Complete:(/views/updatefood.html/routes/main.js/Line 110):This HTML page can be found in the views folder. This page updates food. Code to updating can be found in main.js "app.post(updatefood)"
Mohammed Ahmed's avatar
Mohammed Ahmed committed
19

Mohammed Ahmed's avatar
Mohammed Ahmed committed
20
9.Requirement 7 Delete food page, test with the recipe you added in requirement 5, check list page and remark requirement 11 if necessary-Complete:(/views/updatefood.html or /routes/main.js/line:107):HTML page used to delte food. This is also linked to the update food form which is called when the user deletes food using the form
Mohammed Ahmed's avatar
Mohammed Ahmed committed
21

Mohammed Ahmed's avatar
Mohammed Ahmed committed
22
10.Requirement 9 form-validation, such as checking email address or length of password or username-Complete:(/routes/main.js/Lines 41,79,112,157,188,219,254,294):This can be found in the main.js. All forms have a "IsEmpty()" validation,IsLength() and isEmail() when Email is needed.
Mohammed Ahmed's avatar
Mohammed Ahmed committed
23

Mohammed Ahmed's avatar
Mohammed Ahmed committed
24
11.Requirement 10 suitable feedback messages to user when an operation is successful or unsuccessful-Complete:(/routes/main.js,Line 95,138,175,203,241,278):Found in the main.js, All submission will include a output message to user display operation result.
Mohammed Ahmed's avatar
Mohammed Ahmed committed
25

Mohammed Ahmed's avatar
Mohammed Ahmed committed
26
12.Requirement 13 sessions, access control add, update and food pages are available only to logged-in users-Complete:(/routes/main.js/Line 107)
Mohammed Ahmed's avatar
Mohammed Ahmed committed
27

Mohammed Ahmed's avatar
Mohammed Ahmed committed
28
13.Requirement 14 hashed password, check code in main.js file, search for 'bcrypt' and see if hashed password is saved in registered route in the database (insertOne function)-Complete:(/routes/main.js/Line 250)
Mohammed Ahmed's avatar
Mohammed Ahmed committed
29

Mohammed Ahmed's avatar
Mohammed Ahmed committed
30
14.Requirement 15 Logout-Complete:(/routes/main.js/Line 290)&&:(/views/logout.html):Logout can be found in views.html aswell as main.js
Mohammed Ahmed's avatar
Mohammed Ahmed committed
31

Mohammed Ahmed's avatar
Mohammed Ahmed committed
32
15.Requirement 16 api-Complete:(/routes/main.js/Line 399);2 API's including the weather and food API
Mohammed Ahmed's avatar
Mohammed Ahmed committed
33

Mohammed Ahmed's avatar
Mohammed Ahmed committed
34
16.Requirement 17 link all pages to home page-Complete(Line 3-5 on All pages(views Folder)):All pages are linked by having navigation
Mohammed Ahmed's avatar
Mohammed Ahmed committed
35

Mohammed Ahmed's avatar
Mohammed Ahmed committed
36

Mohammed Ahmed's avatar
Mohammed Ahmed committed
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59


DATA MODEL FOR LISTUSERS:
This database contains all the information related to the user. When a user register, information after vaidation will be inputted into the corosponding fields. Each entity wil have its on primary key field,firstname fields,lastname ect. When a user logs in user information which has already been added to listuserdb, main.js .... will check if information is valid to proceed.
listuserdb:
PK-ID
firstname-name
surname-name
adress-Home Address
phone Number-int
Hashed Password;


DATA MODEL FOR INGRIDIENTS:
This database contains all informtaion regrading ingridients, when a user is logged in, users are able to add food using /addfood routes and submit the information . There are also validation to insure valid information is added forinstance, name requires to be text format and not integer. Fields are also required to have data entry and cannot be left blank.
FK-ID
PK-Ingridient name
value-VAlue per kg
Carbs-carbs of item
Protein-Protein in item
salt-salt in item
sugar-sugar in item