diff --git a/.gitignore b/.gitignore index c75f740..c9d2afa 100644 --- a/.gitignore +++ b/.gitignore @@ -2,8 +2,6 @@ */node_modules .DS_Store -*~/backend/index.js - .vscode/* !.vscode/extensions.json .idea diff --git a/backend/recommondation.go b/backend/recommondation.go deleted file mode 100644 index 3a82edb..0000000 --- a/backend/recommondation.go +++ /dev/null @@ -1,43 +0,0 @@ -package main - -import ( - "fmt" - "math" -) - -func cosine(x, y []int) float64 { - var dotProduct, normX, normY float64 - for i := 1; i < len(x); i++ { - dotProduct += float64(x[i] * y[i]) - normX += float64(x[i] * x[i]) - normY += float64(y[i] * y[i]) - } - return dotProduct / (math.Sqrt(normX) * math.Sqrt(normY)) -} - -func main() { - history := [][]int{ - {1, 0, 1, 0}, - {0, 1, 0, 1}, - {1, 0, 1, 1}, - } - - productCategory := [][]int{ - {1, 1, 0, 0}, - {0, 0, 0, 1}, - {0, 0, 1, 0}, - {0, 0, 1, 1}, - {0, 1, 0, 0}, - - {0, 1, 1, 1}, - {1, 1, 1, 0}, - {0, 0, 0, 1}, - {1, 1, 1, 1}, - } - - // Calculate similarity between first search and each product - for i, product := range productCategory { - sim := cosine(history[0], product) - fmt.Printf("Similarity with product %d: %f\n", i, sim) - } -} diff --git a/backend/utils/database.js b/backend/utils/database.js index 020e67c..0bd82e5 100644 --- a/backend/utils/database.js +++ b/backend/utils/database.js @@ -5,7 +5,6 @@ const pool = mysql.createPool({ host: "localhost", user: "root", database: "marketplace", - password: "12345678", }); //Export a promise for promise-based query diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 5a65c60..f6f42cd 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -70,7 +70,7 @@ function App() { email: userData.email, // Add any other required fields }), - } + }, ); if (!response.ok) { @@ -119,7 +119,7 @@ function App() { email: tempUserData.email, code: code, }), - } + }, ); if (!response.ok) { @@ -163,7 +163,7 @@ function App() { "Content-Type": "application/json", }, body: JSON.stringify(userData), - } + }, ); if (!response.ok) { @@ -222,11 +222,12 @@ function App() { setError("Email and password are required"); setIsLoading(false); return; - } else if (!formValues.email.endsWith("@ucalgary.ca")) { - setError("Please use your UCalgary email address (@ucalgary.ca)"); - setIsLoading(false); - return; } + // else if (!formValues.email.endsWith("@ucalgary.ca")) { + // setError("Please use your UCalgary email address (@ucalgary.ca)"); + // setIsLoading(false); + // return; + // } try { if (isSignUp) { // Handle Sign Up with verification @@ -265,7 +266,7 @@ function App() { email: formValues.email, password: formValues.password, }), - } + }, ); if (!response.ok) { @@ -509,8 +510,8 @@ function App() { {isLoading ? "Please wait..." : isSignUp - ? "Create Account" - : "Sign In"} + ? "Create Account" + : "Sign In"} diff --git a/SQL_code/Schema.sql b/mysql-code/Schema.sql similarity index 100% rename from SQL_code/Schema.sql rename to mysql-code/Schema.sql diff --git a/SQL_code/init-db.py b/mysql-code/init-db.py similarity index 100% rename from SQL_code/init-db.py rename to mysql-code/init-db.py