Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
31ff0eb
Create .DS_Store
ntselet Jun 20, 2021
39d9926
add api url
ntselet Jun 29, 2021
3bcab56
edit home page
ntselet Jun 29, 2021
e914b8e
Update index.html
ntselet Jun 29, 2021
155c599
Merge remote-tracking branch 'upstream/main' into Predict
ntselet Jun 30, 2021
ba109a2
Update index.html
ntselet Jul 3, 2021
6b87344
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 3, 2021
e1ea751
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 3, 2021
2e21a74
Create me.jpg
ntselet Jul 3, 2021
411908b
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 3, 2021
dfa86ab
Update index.html
ntselet Jul 3, 2021
c1965b4
Update contact_me.js
ntselet Jul 3, 2021
944bc85
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 3, 2021
940b5d7
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 3, 2021
c5985a2
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 3, 2021
e00093d
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 3, 2021
101bb7b
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 3, 2021
370edc6
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 4, 2021
9c66486
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 4, 2021
0cc6557
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 4, 2021
068e448
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 4, 2021
9a428f3
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 4, 2021
9126b0a
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 4, 2021
6dd0e16
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 4, 2021
ced5b3a
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 4, 2021
52e4031
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 4, 2021
780c19c
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 4, 2021
b72eced
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 4, 2021
f7cdec6
Update index.html
ntselet Jul 4, 2021
9ff5390
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 4, 2021
bf8a395
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 4, 2021
9f86664
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 5, 2021
15b19fe
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 5, 2021
b70fa93
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 5, 2021
29efe12
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 5, 2021
779b7eb
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 5, 2021
cc3115e
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 5, 2021
8c7c8a7
Update contact_me.js
ntselet Jul 5, 2021
bd4070c
Update contact_me.js
ntselet Jul 5, 2021
49b5f76
Update contact_me.js
ntselet Jul 5, 2021
ccb73eb
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 5, 2021
32edd1e
Update contact_me.js
ntselet Jul 5, 2021
3f7e7b4
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 5, 2021
c16290a
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 5, 2021
408adf1
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 5, 2021
a723dd7
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 6, 2021
567da0d
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 6, 2021
89db50c
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 6, 2021
c451257
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 6, 2021
6fee07c
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 6, 2021
d15f06f
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 6, 2021
842cda3
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 6, 2021
05582b1
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 6, 2021
41a5c7d
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 6, 2021
fd7e08c
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 6, 2021
ce016aa
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 6, 2021
c824228
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 14, 2021
8160bb3
https://dwj3642neg.execute-api.eu-west-1.amazonaws.com/default/Predic…
ntselet Jul 14, 2021
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
Binary file added .DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/cloud-computing-predict.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions .idea/csv-plugin.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added assets/img/me.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/portfolio/BI.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/portfolio/BI2.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/portfolio/data-warehousing.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/portfolio/dataengin.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/portfolio/datawarehouse.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/portfolio/pipeline.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/mail/contact_me.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ $(function () {
var json = {name: name, phone: phone, email: email, message: message}
$.ajax({
// --- CHANGE THIS LINE TO YOUR OWN API GATEWAY --------
url: "{Insert your own AWS API Gateway Endpoint URL here}",
url: "https://98005irfla.execute-api.eu-west-1.amazonaws.com/rootfunction",
// ------------------------------------------------------
type: "POST",
data: JSON.stringify(json),
Expand Down
36 changes: 18 additions & 18 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<! --The html code below is used to set the text on the web page tab -->
<! --You can set this to whatever you want -->
<! --For example: {Your name - Portfolio Type} -->
<title>Explore Data Science Academy - Serverless Student Portfolio Web page</title>
<title>Thulasizwe Ntsele - Serverless Student Portfolio Web page</title>
<!-- Favicon-->
<link rel="icon" type="image/x-icon" href="assets/img/Untitled.ico" />
<!-- Font Awesome icons (free version)-->
Expand Down Expand Up @@ -41,12 +41,12 @@
<header class="masthead bg-primary text-white text-center">
<div class="container d-flex align-items-center flex-column">
<!-- Masthead Avatar Image-->
<img class="masthead-avatar mb-5" src="assets/img/avataaars.svg" alt="" />
<img class="masthead-avatar mb-5" src="assets/img/me.jpg" alt="" />
<!-- Masthead Heading-->
<!-- ========= CUSTOMISE SECTION =========== -->
<!-- You can change 'Cloud Computing Predict' to 'Your Name' -->
<!-- The Masthead will then read: '{Your Name} - Project Portfolio' -->
<h1 class="masthead-heading text-uppercase mb-0">Cloud Computing Predict - Project Portfolio</h1>
<h1 class="masthead-heading text-uppercase mb-0">Thulasizwe Ntsele Cloud Computing - Project Portfolio</h1>
<!-- ======================================= -->
<!-- Icon Divider-->
<div class="divider-custom divider-light">
Expand All @@ -57,7 +57,7 @@ <h1 class="masthead-heading text-uppercase mb-0">Cloud Computing Predict - Proje
<!-- Masthead Subheading-->
<!-- ========= CUSTOMISE SECTION =========== -->
<!-- Change this to a list of three or four of your most relevant skills-->
<p class="masthead-subheading font-weight-light mb-0">Machine Learning - Time Series - Dashboarding</p>
<p class="masthead-subheading font-weight-light mb-0">Data Warehouse - Data Engineering - Business Intelligence - Predictive Models</p>
<!-- ======================================= -->
</div>
</header>
Expand All @@ -82,7 +82,7 @@ <h2 class="page-section-heading text-center text-uppercase text-secondary mb-0">
</div>
<!-- ========= CUSTOMISE SECTION =========== -->
<!-- Replace the link in the `src` string below to depict an image related to a project of yours -->
<img class="img-fluid" src="assets/img/portfolio/christopher-robin-ebbinghaus-pgSkeh0yl8o-unsplash.jpg" alt="" />
<img class="img-fluid" src="assets/img/portfolio/datawarehouse.jpeg" alt="" />
<!-- ======================================= -->
</div>
</div>
Expand Down Expand Up @@ -240,9 +240,9 @@ <h2 class="page-section-heading text-center text-uppercase text-secondary mb-0">
<div class="col-lg-4 mb-5 mb-lg-0">
<h4 class="text-uppercase mb-4">Location</h4>
<p class="lead mb-0">
12th Floor, Rennie House, 19 Ameshoff St
3A Violet Close
<br />
Johannesburg, 2001
Cape Town, 7441
</p>
</div>
<!-- ======================================= -->
Expand All @@ -261,9 +261,9 @@ <h4 class="text-uppercase mb-4">Around the Web</h4>
<!-- ========= CUSTOMISE SECTION =========== -->
<!-- You may wish to modify this text to align with your personal portfolio website -->
<div class="col-lg-4">
<h4 class="text-uppercase mb-4">Explore AI Cloud Computing Predict</h4>
<h4 class="text-uppercase mb-4">Thulasizwe AI Cloud Computing Project</h4>
<p class="lead mb-0">
Create your own data science portfolio with an intelligent NPL bot handling enquiries for you.</a>
Data is the future off all organisation therefore it must be treated with respect.</a>
</p>
</div>
<!-- ======================================= -->
Expand Down Expand Up @@ -294,7 +294,7 @@ <h4 class="text-uppercase mb-4">Explore AI Cloud Computing Predict</h4>
<div class="col-lg-8">
<!-- Portfolio Piece - Title-->
<!-- Modify the title of the first portfolio project here -->
<h2 class="portfolio-modal-title text-secondary text-uppercase mb-0" id="portfolioModal1Label">Credit Fraud Detector</h2>
<h2 class="portfolio-modal-title text-secondary text-uppercase mb-0" id="portfolioModal1Label">Data Warehouse</h2>
<!-- Icon Divider-->
<div class="divider-custom">
<div class="divider-custom-line"></div>
Expand All @@ -303,10 +303,10 @@ <h2 class="portfolio-modal-title text-secondary text-uppercase mb-0" id="portfol
</div>
<!-- Portfolio Piece - Image-->
<!-- Modify the image of the first portfolio project here-->
<img class="img-fluid rounded mb-5" src="assets/img/portfolio/ales-nesetril-ex_p4AaBxbs-unsplash.jpg" alt="" />
<img class="img-fluid rounded mb-5" src="assets/img/portfolio/data-warehousing.jpeg" alt="" />
<!-- Portfolio Piece - Text-->
<!-- Modify the description of the first portfolio project here-->
<p class="mb-5">Built a credit card fraud detection system for one of South Africas big four banks</p>
<p class="mb-5">Build an electronic method of organizing, analyzing, and reporting information</p>
<button class="btn btn-primary" data-dismiss="modal">
<i class="fas fa-times fa-fw"></i>
Close Window
Expand Down Expand Up @@ -335,7 +335,7 @@ <h2 class="portfolio-modal-title text-secondary text-uppercase mb-0" id="portfol
<div class="col-lg-8">
<!-- Portfolio Piece - Title-->
<!-- Modify the title of the second portfolio project here -->
<h2 class="portfolio-modal-title text-secondary text-uppercase mb-0" id="portfolioModal2Label">Rock Formation Classifier</h2>
<h2 class="portfolio-modal-title text-secondary text-uppercase mb-0" id="portfolioModal2Label">DATA ENGINEERING</h2>
<!-- Icon Divider-->
<div class="divider-custom">
<div class="divider-custom-line"></div>
Expand All @@ -344,10 +344,10 @@ <h2 class="portfolio-modal-title text-secondary text-uppercase mb-0" id="portfol
</div>
<!-- Portfolio Piece - Image-->
<!-- Modify the image of the second portfolio project here-->
<img class="img-fluid rounded mb-5" src="assets/img/portfolio/sebastian-pichler-oqFHLfLFtmc-unsplash.jpg" alt="" />
<img class="img-fluid rounded mb-5" src="assets/img/portfolio/pipeline..jpeg" alt="" />
<!-- Portfolio Piece - Text-->
<!-- Modify the description of the second portfolio project here-->
<p class="mb-5">Designed and built a PoC rock formation density classifier to aid engineers in the preliminary building design phase</p>
<p class="mb-5">A data pipeline is a set of actions that ingest raw data from disparate sources and move the data to a destination for storage and analysis. A pipeline also may include filtering and features that provide resiliency against failure</p>
<button class="btn btn-primary" data-dismiss="modal">
<i class="fas fa-times fa-fw"></i>
Close Window
Expand Down Expand Up @@ -376,7 +376,7 @@ <h2 class="portfolio-modal-title text-secondary text-uppercase mb-0" id="portfol
<div class="col-lg-8">
<!-- Portfolio Piece - Title-->
<!-- Modify the title of the third portfolio project here -->
<h2 class="portfolio-modal-title text-secondary text-uppercase mb-0" id="portfolioModal3Label">Search for Dark Matter Hints with Machine Learning</h2>
<h2 class="portfolio-modal-title text-secondary text-uppercase mb-0" id="portfolioModal3Label">Business Intelligence</h2>
<!-- Icon Divider-->
<div class="divider-custom">
<div class="divider-custom-line"></div>
Expand All @@ -385,10 +385,10 @@ <h2 class="portfolio-modal-title text-secondary text-uppercase mb-0" id="portfol
</div>
<!-- Portfolio Piece - Image-->
<!-- Modify the image of the third portfolio project here -->
<img class="img-fluid rounded mb-5" src="assets/img/portfolio/halgatewood-com-OgvqXGL7XO4-unsplash.jpg" alt="" />
<img class="img-fluid rounded mb-5" src="assets/img/portfolio/BI.jpeg" alt="" />
<!-- Portfolio Piece - Text-->
<!-- Modify the description of the third portfolio project here-->
<p class="mb-5">This project covers several cases of detector design optimization in high energy physics experiments using Bayesian optimization with Gaussian processes</p>
<p class="mb-5">Business intelligence (BI) is a technology-driven process for analyzing data and delivering actionable information that helps executives, managers and workers make informed business decisions.</p>
<button class="btn btn-primary" data-dismiss="modal">
<i class="fas fa-times fa-fw"></i>
Close Window
Expand Down
176 changes: 176 additions & 0 deletions student_solution_files/DB.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@

"""
Lambda function that decodes and writes data from your portfolio website to your DynamoDB database.

Author: Explore Data Science Academy.

Note:
---------------------------------------------------------------------
The contents of this file should be added to a AWS Lambda function
created as part of the EDSA Cloud-Computing Predict.
For further guidance around this process, see the README instruction
file which sits at the root of this repo.
---------------------------------------------------------------------

"""

# Lambda dependencies
import boto3 # Python AWS SDK
import json # Used for handling API-based data.
import base64 # Needed to decode the incoming POST
import random
import uuid
from botocore.exceptions import ClientError

#CREATE_RAW_PATH = "/contactme"

def lambda_handler(event, context):
if event["rawPath"]== "/contactme":
# Perform JSON data decoding
body_enc = json.loads(event['body'])
body_enc = event['body']
dec_dict = json.loads(base64.b64decode(body_enc))

table.put_item(Item={'ResponsesID': rid, # <--- Insert the correct variable
'Name': dec_dict['name'], # <--- Insert the correct variable
'Email': dec_dict['email'], # <--- Insert the correct variable
'Cell': dec_dict['phone'], # <--- Insert the correct variable
'Message': dec_dict['message'] # <--- Insert the correct variable
})

# --- Write to dynamodb ---

# ** Create a variable that can take a random value between 1 and 1 000 000 000.
# This variable will be used as our key value i.e the ResponsesID and should be of type integer.
# It is important to note that the ResponseID i.e. the rid variable, should take
# on a unique value to prevent errors when writing to DynamoDB. **

# --- Insert your code here ---
rid =random.randint(1,1000000)
# rid = None # <--- Replace this value with your code.
# -----------------------------

# ** Instantiate the DynamoDB service with the help of the boto3 library **

# --- Insert your code here ---
dynamodb = boto3.resource('dynamodb')#,region_name='eu-west-1') # <--- Replace this value with your code.
# -----------------------------

# Instantiate the table. Remember pass the name of the DynamoDB table created in step 4
table = dynamodb.Table('PredictDB')

# ** Write the responses to the table using the put_item method. **

# Complete the below code so that the appropriate
# incoming data is sent to the matching column in your DynamoDB table
# --- Insert your code here ---
"""db_response = table.put_item(Item={'ResponsesID': rid, # <--- Insert the correct variable
'Name': dec_dict['name'], # <--- Insert the correct variable
'Email': dec_dict['email'], # <--- Insert the correct variable
'Cell': dec_dict['phone'], # <--- Insert the correct variable
'Message': dec_dict['message'] # <--- Insert the correct variable
})
# -----------------------------
"""
#email_text = 'Hello world'

# ** SES Functionality **

# Replace sender@example.com with your "From" address.
# This address must be verified with Amazon SES.
# --- Insert your code here ---
""""SENDER = 'ntseleta@gmail.com'
ses.send_mail(
Source='ntseleta@gmail.com',
Destination={
'ToAddresses': [
'ntselet@hotmail.com',
]
},
Message={
'Subject': {
'Data': 'Predict',
'Charset': 'UTF-8'
},
'Body': {
'Text': {
'Data': email_text,
'Charset': 'UTF-8'
},

}
},
)
# -----------------------------

# Replace recipient@example.com with a "To" address. If your account
# is still in the sandbox, this address must be verified.
# --- Insert your code here ---
RECIPIENT = 'ntseleta@gmail.com'
# -----------------------------

# The subject line for the email.
# --- DO NOT MODIFY THIS CODE ---
SUBJECT = f"Data Science Portfolio Project Website - Hello {dec_dict['name']}"
# -------------------------------

# The email body for recipients with non-HTML email clients
BODY_TEXT = (email_text)

# The character encoding for the email.
CHARSET = "UTF-8"

# Create a new SES service resource
client = boto3.client('ses')

# Try to send the email.
try:
# Provide the contents of the email.
ses_response = client.send_email(
Destination={
'ToAddresses': [
RECIPIENT,
# 'edsa.predicts@explore-ai.net', # <--- Uncomment this line once you have successfully tested your predict end-to-end
],
},
Message={
'Body': {

'Text': {
'Charset': CHARSET,
'Data': BODY_TEXT,
},
},
'Subject': {
'Charset': CHARSET,
'Data': SUBJECT,
},
},
Source=SENDER,
)

# Display an error if something goes wrong.
except ClientError as e:
print(e.response['Error']['Message'])
else:
print("Email sent! Message ID:"),
print(ses_response['MessageId'])


# ** Create a response object to inform the website
# that the workflow executed successfully. **
lambda_response = {
'statusCode': 200,
'body': json.dumps({
'Name': dec_dict['Name'],
'Email': dec_dict['Email'],
'Cell': dec_dict['Phone_number'],
'Message': dec_dict['Message'],
'DB_response': db_response
})
}"""

return lambda_response



Loading