Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
109c430
Setting up GitHub Classroom Feedback
github-classroom[bot] Sep 27, 2022
7f0e104
First Commit
mattlee24 Nov 17, 2022
cb0ba21
Merge pull request #2 from BUCOMPAdvancedDevelopment/master
mattlee24 Nov 17, 2022
138be7c
Local styling updates test
mattlee24 Nov 17, 2022
f1f9554
Merge pull request #3 from BUCOMPAdvancedDevelopment/main
mattlee24 Nov 17, 2022
e6adbd9
Merge pull request #4 from BUCOMPAdvancedDevelopment/master
mattlee24 Nov 17, 2022
15700bd
Home page stylings
mattlee24 Nov 17, 2022
413d460
Firebase Authentication Working
mattlee24 Nov 19, 2022
9d4db9c
Merge branch 'main' into master
mattlee24 Nov 19, 2022
55a893c
Merge pull request #5 from BUCOMPAdvancedDevelopment/master
mattlee24 Nov 19, 2022
89c46ad
Firebase Login to the main website
mattlee24 Nov 20, 2022
4aec56c
github sign up added and responsive css updated
mattlee24 Nov 21, 2022
bac3fdf
Token Expired Problem Fixed
mattlee24 Nov 22, 2022
b53488a
Updated Requirements
mattlee24 Nov 22, 2022
3a9673c
Scripts Updated
mattlee24 Nov 22, 2022
16eee8e
Merge branch 'main' of https://github.com/BUCOMPAdvancedDevelopment/a…
mattlee24 Nov 22, 2022
e95247c
Minor Changes
mattlee24 Nov 22, 2022
de0b812
Merge branch 'main' of https://github.com/BUCOMPAdvancedDevelopment/a…
mattlee24 Nov 22, 2022
40d3f84
Minor Changes
mattlee24 Nov 22, 2022
ad140f2
Merge pull request #7 from BUCOMPAdvancedDevelopment/master
mattlee24 Nov 22, 2022
08d7d2a
Git and Google logings working
mattlee24 Nov 22, 2022
87244a0
Merge pull request #8 from BUCOMPAdvancedDevelopment/master
mattlee24 Nov 22, 2022
89a6ad7
Commit from Virtual Environment (Test)
mattlee24 Nov 22, 2022
0ff7efe
Create README.md
mattlee24 Nov 22, 2022
fed9d2c
Update README.md
mattlee24 Nov 22, 2022
44340fb
Merge branch 'main' of https://github.com/BUCOMPAdvancedDevelopment/a…
mattlee24 Nov 22, 2022
bd88389
Merge pull request #10 from BUCOMPAdvancedDevelopment/master
mattlee24 Nov 22, 2022
901f696
Delete share/doc/jwcrypto directory
mattlee24 Nov 22, 2022
c395267
Delete __pycache__ directory
mattlee24 Nov 22, 2022
0b585a4
Delete Scripts directory
mattlee24 Nov 22, 2022
007d5b9
Delete Lib/site-packages directory
mattlee24 Nov 22, 2022
6d9624d
Delete package-lock.json
mattlee24 Nov 22, 2022
1c77618
Delete pyvenv.cfg
mattlee24 Nov 22, 2022
ae38857
Delete package.json
mattlee24 Nov 22, 2022
e6783d8
.git Ignore File Added
mattlee24 Nov 22, 2022
f279c36
Added .gitignore file
mattlee24 Nov 22, 2022
98fa011
Git Ignore File Added and Tested
mattlee24 Nov 23, 2022
5e36d34
Pusing from Virtual Environment
mattlee24 Nov 23, 2022
197dc35
Master Branch From Local
mattlee24 Nov 23, 2022
a19b902
Merge pull request #11 from BUCOMPAdvancedDevelopment/master
mattlee24 Nov 23, 2022
5293672
Added and Connected to MongoDB
mattlee24 Nov 23, 2022
21ab49b
MongoDB Data Displaying On Site
mattlee24 Nov 23, 2022
575f664
Merge pull request #12 from BUCOMPAdvancedDevelopment/master
mattlee24 Nov 23, 2022
8976efb
Further Additions To MongoDb + Styling to "Games" Page
mattlee24 Nov 23, 2022
bcdcdb4
Merge pull request #13 from BUCOMPAdvancedDevelopment/master
mattlee24 Nov 23, 2022
4187317
Ability to Add A Game to MongoDB
mattlee24 Nov 24, 2022
7336992
Merge pull request #14 from BUCOMPAdvancedDevelopment/master
mattlee24 Nov 24, 2022
93d30f0
Game Details Added. Stylings Updated. Footer Added.
mattlee24 Nov 25, 2022
a21bd4f
Merge pull request #15 from BUCOMPAdvancedDevelopment/master
mattlee24 Nov 25, 2022
0cfaec3
Edit Game and Delete Game Working
mattlee24 Nov 25, 2022
c93fab3
Removed some unused print statements
mattlee24 Nov 25, 2022
ecbacb9
Merge pull request #16 from BUCOMPAdvancedDevelopment/master
mattlee24 Nov 25, 2022
ec5a7a0
Styling Updates, CRUD fully operational. Only Certified users can edi…
mattlee24 Nov 27, 2022
c2fc69d
Merge pull request #17 from BUCOMPAdvancedDevelopment/master
mattlee24 Nov 27, 2022
9ca545a
Issue with remembering google and git users once signed in for the fi…
mattlee24 Nov 27, 2022
f447be2
Merge pull request #18 from BUCOMPAdvancedDevelopment/master
mattlee24 Nov 27, 2022
339f3e4
Sign out of alternative providers fix
mattlee24 Nov 27, 2022
ac6cae3
Merge pull request #19 from BUCOMPAdvancedDevelopment/master
mattlee24 Nov 27, 2022
df17e8a
Unused pages removed
mattlee24 Nov 28, 2022
e990991
Merge pull request #20 from BUCOMPAdvancedDevelopment/master
mattlee24 Nov 28, 2022
dab737e
Added Unit Test to check pages loading correctly and adding games wor…
mattlee24 Nov 28, 2022
eaf1001
Merge pull request #21 from BUCOMPAdvancedDevelopment/master
mattlee24 Nov 28, 2022
7612711
Update README.md
mattlee24 Nov 28, 2022
1c71742
Update README.md
mattlee24 Nov 28, 2022
b2e73b3
Update README.md
mattlee24 Nov 28, 2022
2b84405
Update README.md
mattlee24 Nov 28, 2022
6d23911
Update README.md
mattlee24 Nov 28, 2022
7edc937
Update README.md
mattlee24 Nov 28, 2022
9fc713f
Update README.md
mattlee24 Nov 28, 2022
3e4cb3b
Update README.md
mattlee24 Nov 28, 2022
0fe4f14
Update README.md
mattlee24 Nov 28, 2022
945969b
Update README.md
mattlee24 Nov 28, 2022
3785d40
Update README.md
mattlee24 Nov 28, 2022
e119b99
Requirements Updated
mattlee24 Nov 28, 2022
aca0462
Merge pull request #22 from BUCOMPAdvancedDevelopment/master
mattlee24 Nov 28, 2022
85277d8
Data Pushing and Pulling to Datastore
mattlee24 Nov 28, 2022
f41e6bb
Merge pull request #23 from BUCOMPAdvancedDevelopment/master
mattlee24 Nov 28, 2022
c73fe3e
Game deleted unit test
mattlee24 Nov 29, 2022
828c981
Merge pull request #24 from BUCOMPAdvancedDevelopment/master
mattlee24 Nov 29, 2022
d8516c4
Cloud Functions, get all, get one and delete
mattlee24 Nov 29, 2022
d5fb9ef
Update Game Cloud Function
mattlee24 Nov 29, 2022
715a1cb
Add Game Cloud Function
mattlee24 Nov 29, 2022
cd75964
Merge pull request #25 from BUCOMPAdvancedDevelopment/master
mattlee24 Nov 29, 2022
8a9d617
User Details Pushed to Cloud Datastore
mattlee24 Nov 30, 2022
7325054
Merge pull request #26 from BUCOMPAdvancedDevelopment/master
mattlee24 Nov 30, 2022
bbaf7b3
Indexs Updated
mattlee24 Nov 30, 2022
d0421d2
Merge pull request #27 from BUCOMPAdvancedDevelopment/master
mattlee24 Nov 30, 2022
68bc966
Index.yaml Updated
mattlee24 Nov 30, 2022
4b03b7b
Merge pull request #28 from BUCOMPAdvancedDevelopment/master
mattlee24 Nov 30, 2022
964b8c5
Index Updated on cloud to be run in local dev
mattlee24 Nov 30, 2022
82391cd
Merge pull request #29 from BUCOMPAdvancedDevelopment/master
mattlee24 Nov 30, 2022
4fbdea1
User details pushed to cloud datastore and displayed on account page
mattlee24 Nov 30, 2022
5ef8b0d
Merge pull request #30 from BUCOMPAdvancedDevelopment/master
mattlee24 Nov 30, 2022
4cb2615
Profile Card Created and Filled with Data
mattlee24 Nov 30, 2022
a61fb07
Merge pull request #31 from BUCOMPAdvancedDevelopment/master
mattlee24 Nov 30, 2022
9539bf7
Account and Account Info Pages Dynamic
mattlee24 Dec 1, 2022
06ded09
Merge pull request #32 from BUCOMPAdvancedDevelopment/master
mattlee24 Dec 1, 2022
9f61c2f
Deleting optinal user data
mattlee24 Dec 1, 2022
cf5c73c
Merge pull request #33 from BUCOMPAdvancedDevelopment/master
mattlee24 Dec 1, 2022
9b00217
Shopping Cart Added, Full functionality with MongoDB
mattlee24 Dec 2, 2022
dd82da8
Merge pull request #34 from BUCOMPAdvancedDevelopment/master
mattlee24 Dec 2, 2022
b31a943
Cart shows total price (jinja2). Added the ability to remove items fr…
mattlee24 Dec 3, 2022
6ecf1a7
Update README.md
mattlee24 Dec 3, 2022
d61aa68
Fully functional basket and order page, unique to the user
mattlee24 Dec 3, 2022
bc50742
Merge pull request #35 from BUCOMPAdvancedDevelopment/master
mattlee24 Dec 3, 2022
bf91eb4
Update README.md
mattlee24 Dec 3, 2022
23dee4a
Cloud Functions Separted into folders
mattlee24 Dec 5, 2022
adf337d
Merge pull request #36 from BUCOMPAdvancedDevelopment/master
mattlee24 Dec 5, 2022
73ee97a
Basket Errors Fixed - Total Calculated and Added to Each Order
mattlee24 Dec 6, 2022
8cf54d9
Merge pull request #37 from BUCOMPAdvancedDevelopment/master
mattlee24 Dec 6, 2022
d4964f4
Update README.md
mattlee24 Dec 6, 2022
aa740bf
Update README.md
mattlee24 Dec 6, 2022
a380854
Update README.md
mattlee24 Dec 6, 2022
86da3f9
Final Commit - Code Documented
mattlee24 Dec 8, 2022
195390e
Merge pull request #38 from BUCOMPAdvancedDevelopment/master
mattlee24 Dec 8, 2022
4d59dc3
Tests working.
mattlee24 Dec 8, 2022
df02d0c
Merge pull request #39 from BUCOMPAdvancedDevelopment/master
mattlee24 Dec 8, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .gcloudignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This file specifies files that are *not* uploaded to Google Cloud
# using gcloud. It follows the same syntax as .gitignore, with the addition of
# "#!include" directives (which insert the entries of the given .gitignore-style
# file at that point).
#
# For more information, run:
# $ gcloud topic gcloudignore
#
.gcloudignore
# If you would like to upload your .git directory, .gitignore file or files
# from your .gitignore file, remove the corresponding line
# below:
.git
.gitignore

# Python pycache:
__pycache__/
# Ignored by the build system
/setup.cfg
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
__pycache__/
Include/
Lib/
Scripts/
share/
package-lock.json
package.json
pyvenv.cfg
19 changes: 19 additions & 0 deletions CloudFunctions/add_game/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

import pymongo
from pymongo import MongoClient
from bson.json_util import dumps
import os
import requests
import json
# end imports

def add_game(request):
# Search data from Mongodb
cluster=MongoClient( "mongodb+srv://dpUser:[email protected]/?retryWrites=true&w=majority")
db=cluster["Games"]
collection=db["Games"]

passed_new_game = json.loads(request.args.get('new_game'))

collection.insert_one(passed_new_game)
return passed_new_game
6 changes: 6 additions & 0 deletions CloudFunctions/add_game/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Function dependencies, for example:
# package>=version
pymongo==4.3.3
dnspython
functions-framework==3.2.0
requests
22 changes: 22 additions & 0 deletions CloudFunctions/delete_game/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import pymongo
from pymongo import MongoClient
from bson.json_util import dumps
import os
import requests
import json
# end imports

def delete_game(request):
# Search data from Mongodb
cluster=MongoClient( "mongodb+srv://dpUser:[email protected]/?retryWrites=true&w=majority")
db=cluster["Games"]
collection=db["Games"]

passed_slug = request.args.get('slug')

myCursor = None
# create queries
game_query = {"slug": {"$eq": passed_slug}}
collection.delete_one({"$and": [game_query]})

return passed_slug
6 changes: 6 additions & 0 deletions CloudFunctions/delete_game/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Function dependencies, for example:
# package>=version
pymongo==4.3.3
dnspython
functions-framework==3.2.0
requests
22 changes: 22 additions & 0 deletions CloudFunctions/edit_game/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import pymongo
from pymongo import MongoClient
from bson.json_util import dumps
import os
import requests
import json
# end imports

def edit_game(request):
# Search data from Mongodb
cluster=MongoClient( "mongodb+srv://dpUser:[email protected]/?retryWrites=true&w=majority")
db=cluster["Games"]
collection=db["Games"]

passed_slug = request.args.get('slug')
passed_update_game = request.args.get('update_game')

game_query = {"slug": {"$eq": passed_slug}}
update_game = json.loads(passed_update_game)

collection.update_one(game_query, update_game)
return update_game
6 changes: 6 additions & 0 deletions CloudFunctions/edit_game/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Function dependencies, for example:
# package>=version
pymongo==4.3.3
dnspython
functions-framework==3.2.0
requests
20 changes: 20 additions & 0 deletions CloudFunctions/get_mongodb_items/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import pymongo
from pymongo import MongoClient
from bson.json_util import dumps
import os
import requests
import json
# end imports

def get_mongodb_items(request):
# Search data from Mongodb
cluster=MongoClient( "mongodb+srv://dpUser:[email protected]/?retryWrites=true&w=majority")
db=cluster["Games"]
collection=db["Games"]

myCursor = None

myCursor = collection.find()
list_cur = list(myCursor)
json_data = dumps(list_cur)
return json_data
6 changes: 6 additions & 0 deletions CloudFunctions/get_mongodb_items/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Function dependencies, for example:
# package>=version
pymongo==4.3.3
dnspython
functions-framework==3.2.0
requests
24 changes: 24 additions & 0 deletions CloudFunctions/get_single_game/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import pymongo
from pymongo import MongoClient
from bson.json_util import dumps
import os
import requests
import json
# end imports

def get_single_game(request):
# Search data from Mongodb
cluster=MongoClient( "mongodb+srv://dpUser:[email protected]/?retryWrites=true&w=majority")
db=cluster["Games"]
collection=db["Games"]

passed_slug = request.args.get('slug')

myCursor = None
# create queries
game_query = {"slug": {"$eq": passed_slug}}

myCursor = collection.find({"$and": [game_query]})
list_cur = list(myCursor)
json_data = dumps(list_cur)
return json_data
6 changes: 6 additions & 0 deletions CloudFunctions/get_single_game/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Function dependencies, for example:
# package>=version
pymongo==4.3.3
dnspython
functions-framework==3.2.0
requests
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Advanced Devlopement Unit Coursework - Matt Lee s5207970

### Coursework for Advanced Dev Unit, Final Year (Year 3)

#### To access Site on the cloud, use the following link:

https://ad-gamezone.ew.r.appspot.com (Not optimised for mobile!...yet)

# Local Server Commands

#### To run in a local environment, run the following commands:

Create a local virtual environment with flask installed.

Copy contents of git folder inside virtual enviroment.

pip3 install -r requirements.txt

1. set FLASK_APP=main.py
2. set FLASK_DEBUG=1 (Devlopment Only)
3. flask run
4. ctrl-c (Shut down local server)

### Important - Don't forget: os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = (r"Path to Credentials file on YOUR machine")
### It will not run unless this is changed accordingly.

#

#### To run unit tests

- run command "test.py" in terminal


25 changes: 25 additions & 0 deletions app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
runtime: python39

handlers:
# This configures Google App Engine to serve the files in the app's static
# directory.
- url: /static
static_dir: static
# This handler routes all requests not caught above to your main app. It is
# required when static routes are defined, but can be omitted (along with
# the entire handlers section) when there are no static files defined.
- url: /.*
script: auto
7 changes: 7 additions & 0 deletions application_default_credentials.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"client_id": "764086051850-6qr4p6gpi6hn506pt8ejuq83di341hur.apps.googleusercontent.com",
"client_secret": "d-FL95Q19q7MQmFpd7hHD0Ty",
"quota_project_id": "ad-gamezone",
"refresh_token": "1//03O_u9vyrlU6WCgYIARAAGAMSNwF-L9IrF1lVSqybxxjKc6239wFWShPL-JTjWIm11e06L-NntoUORJ8V6I4zgYjOyowq0C0FNNk",
"type": "authorized_user"
}
31 changes: 31 additions & 0 deletions index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

indexes:

- kind: visit
ancestor: yes
properties:
- name: timestamp
direction: desc

- kind: userDetails
ancestor: yes
properties:
- name: FavouriteGame
- name: gamertag
- name: genre
- name: platform
- name: timestamp
direction: desc
Loading