Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
94e935b
Created file structure
charlesleezhaoyi Dec 16, 2023
0ac9609
Testing collaborators function on Github
charlesleezhaoyi Dec 16, 2023
ee098d7
Adding openAI
ianthehamster Dec 20, 2023
e1b3501
Deleted redundant file
ianthehamster Dec 20, 2023
2371bd5
Enabled map rendering with @react-google-maps/api
charlesleezhaoyi Dec 20, 2023
05bc0eb
Merge pull request #1 from charlesleezhaoyi/ian-testing
charlesleezhaoyi Dec 20, 2023
9240d1e
Merged and deconflicted Google Maps and Open AI implementation
charlesleezhaoyi Dec 20, 2023
e354c2b
Resolving conflicts
ianthehamster Dec 20, 2023
ddc7215
Adding UI layout improvements for login and main page
ianthehamster Dec 22, 2023
a0d6cef
Added further UI styling and select TextFields
ianthehamster Dec 23, 2023
3297df4
Update API key
ianthehamster Dec 24, 2023
7a6e2f7
Merge pull request #3 from charlesleezhaoyi/ian-testing
ianthehamster Dec 24, 2023
9a4fb09
Ignored .env file
ianthehamster Dec 24, 2023
74d03ec
Merge pull request #4 from charlesleezhaoyi/ian-testing
ianthehamster Dec 24, 2023
cd98e35
Delete .env
ianthehamster Dec 24, 2023
d67ea50
Merge pull request #5 from charlesleezhaoyi/ianthehamster-patch-1
ianthehamster Dec 24, 2023
aef89d8
refactoring of code changes + deconflict merge
charlesleezhaoyi Dec 24, 2023
8c4696b
Managed merge conflicts between GmapsAI-historian and main; merging m…
charlesleezhaoyi Dec 24, 2023
eb3a8c0
Refactored Google Maps functions and moved it into Component level wi…
charlesleezhaoyi Dec 24, 2023
1f79913
Merge pull request #7 from charlesleezhaoyi/GmapsAI-historian
charlesleezhaoyi Dec 24, 2023
d95aa49
Adding updates
ianthehamster Dec 27, 2023
26fb754
Mapped known landmarks, wrote coordinates to DB, read coordinates fro…
charlesleezhaoyi Dec 27, 2023
5974e0c
Fixing bugs in Quizzes page
ianthehamster Dec 28, 2023
6f03183
Added Cloud Firestore and quiz db for scores
ianthehamster Dec 28, 2023
91486f4
Added persistent drawer and moved links to the drawer component
ianthehamster Dec 30, 2023
40a12eb
Updated gitignore file to ignore .env
ianthehamster Dec 30, 2023
061808f
Updated env
ianthehamster Dec 30, 2023
b09355b
Enabled rendering of markers based on pill selection; also added pan …
charlesleezhaoyi Dec 30, 2023
367d13d
updated api key for openai
ianthehamster Jan 1, 2024
cbaf2e6
Remove .env file from repository
ianthehamster Jan 1, 2024
6fdadd7
Updated AppTest.js
ianthehamster Jan 1, 2024
1a43720
Updated main app to include all features of previous app
ianthehamster Jan 1, 2024
3f33d74
Modified layout of quizzes
ianthehamster Jan 1, 2024
bc75639
Updated temporary drawer
ianthehamster Jan 6, 2024
f8131c4
Resolved merge conflicts
ianthehamster Jan 6, 2024
15b2c26
Initiated PDF certificate generation branch and boilerplate code
charlesleezhaoyi Jan 6, 2024
7369536
Added certificate-background.png for PDF cert generation
charlesleezhaoyi Jan 6, 2024
b4bbb3e
Added quizzes by AI
ianthehamster Jan 6, 2024
b6bb112
Merge branch 'pdf-cert-generation'
charlesleezhaoyi Jan 7, 2024
0cb165a
Added "Generate Certificate" functionality
charlesleezhaoyi Jan 7, 2024
6b78b58
Added error validation for sign-ups; reinstalled packages due to brea…
charlesleezhaoyi Jan 7, 2024
00421f8
Finished styling of login page and openai quiz generation
ianthehamster Jan 8, 2024
2ce9341
Completed merge from main branch
ianthehamster Jan 9, 2024
efd1ca0
Merge pull request #10 from charlesleezhaoyi/ian-final-version
ianthehamster Jan 9, 2024
4938cd7
Added inline error when email is empty or invalid
charlesleezhaoyi Jan 9, 2024
5c0373b
Merge branch 'enhanced-onboarding'
charlesleezhaoyi Jan 9, 2024
74b1838
Added Forgot Password functionality - remaining bug: Two emails being…
charlesleezhaoyi Jan 9, 2024
645fc72
Merge pull request #11 from charlesleezhaoyi/forgot-password
charlesleezhaoyi Jan 9, 2024
4d6a5a2
test
ianthehamster Jan 11, 2024
f39b829
Fixed loading spinner
ianthehamster Jan 11, 2024
c1f12c0
Built forgot password flow, and remember me function
charlesleezhaoyi Jan 12, 2024
edc79e6
Corrected Remember Me function to persist auth locally, and not session
charlesleezhaoyi Jan 12, 2024
0e0b900
Merge pull request #12 from charlesleezhaoyi/forgot-password
charlesleezhaoyi Jan 12, 2024
47406ca
Added Transit and Traffic Layer
charlesleezhaoyi Jan 12, 2024
eebe29a
Removed redundant useEffect code
charlesleezhaoyi Jan 12, 2024
4a209dc
Overlay pre-selection pills onto rendered map
charlesleezhaoyi Jan 13, 2024
978cf89
Merge pull request #13 from charlesleezhaoyi/map-layer-styling
charlesleezhaoyi Jan 13, 2024
b3260cb
Updating the website for mobile responsiveness
ianthehamster Jan 13, 2024
e7084e1
Updating components
ianthehamster Jan 13, 2024
fe3c788
Added pills to the mobile version of the app
ianthehamster Jan 13, 2024
004456e
Created directions service v1 without instructions
charlesleezhaoyi Jan 14, 2024
88192ee
Removed CalculateRoute.js
charlesleezhaoyi Jan 14, 2024
e4524dd
Committing miscellanous changes
ianthehamster Jan 14, 2024
566eaf4
Finished protected routes and managed to get signup to onboarding page
ianthehamster Jan 15, 2024
0b73ce8
Miscecllanoues changes
ianthehamster Jan 16, 2024
ce6f946
Completed merge
ianthehamster Jan 16, 2024
902edec
Merge pull request #14 from charlesleezhaoyi/ian-final-version
ianthehamster Jan 16, 2024
eb07174
Test
ianthehamster Jan 16, 2024
7e0ead7
Test
ianthehamster Jan 16, 2024
3872e06
Directions Service Instructions v1 created
charlesleezhaoyi Jan 16, 2024
e289cb2
Merge to mai
ianthehamster Jan 16, 2024
f34ba60
Merge pull request #15 from charlesleezhaoyi/ian-final-version
ianthehamster Jan 16, 2024
b8c0767
merged remote main to local main
charlesleezhaoyi Jan 16, 2024
0e2e77b
Added password matching logic
charlesleezhaoyi Jan 16, 2024
2ebee31
Reinstated Forgot Password code
charlesleezhaoyi Jan 16, 2024
aa8a89a
synchronised changes on App.js to BackgroundApp.js
charlesleezhaoyi Jan 18, 2024
26461ee
Conditionally render components for existing and new users in prepara…
charlesleezhaoyi Jan 20, 2024
3d691f8
Enhanced sign-in so new users can still see overlay
charlesleezhaoyi Jan 20, 2024
be13110
Pulled main changes to QuizzesAI and handled merge conflicts
charlesleezhaoyi Jan 20, 2024
1bdd9d4
Merge pull request #16 from charlesleezhaoyi/directions-service
charlesleezhaoyi Jan 20, 2024
302e6c9
added uid when new user created
charlesleezhaoyi Jan 20, 2024
9156e6f
enlarged map and drawer. sliced Ai responses into paragraphs. able to…
charlesleezhaoyi Jan 20, 2024
99f35cc
Merge pull request #17 from charlesleezhaoyi/directions-instructions
charlesleezhaoyi Jan 20, 2024
53d296d
Changed App Links on Top Bar to Roboto Font
charlesleezhaoyi Jan 21, 2024
8f4f47e
Merging directions-instructions into main
charlesleezhaoyi Jan 21, 2024
d441d55
Merge pull request #18 from charlesleezhaoyi/directions-instructions
charlesleezhaoyi Jan 21, 2024
713cd49
Made color changes to landmark buttons and hamburrger icon
charlesleezhaoyi Jan 21, 2024
faefff1
Merged main to directions-instructions again
charlesleezhaoyi Jan 21, 2024
55e2b08
Merge pull request #19 from charlesleezhaoyi/directions-instructions
charlesleezhaoyi Jan 21, 2024
c41cd9d
Added AI response styling and bline break functions
charlesleezhaoyi Jan 21, 2024
78eec1b
Merge directions-instructions to main
charlesleezhaoyi Jan 21, 2024
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
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,18 @@

# misc
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please give your PRs a fitting title

.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# Ignore .env files
.env

npm-debug.log*
yarn-debug.log*
yarn-error.log*

#Ignore Test files
.AppTestIan.js
34,823 changes: 13,541 additions & 21,282 deletions package-lock.json

Large diffs are not rendered by default.

24 changes: 22 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,30 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@mui/icons-material": "^5.15.1",
"@mui/material": "^5.15.0",
"@react-google-maps/api": "^2.19.2",
"axios": "^1.6.3",
"cors": "^2.8.5",
"dotenv": "^16.3.1",
"express": "^4.18.2",
"firebase": "^10.7.1",
"history": "^5.3.0",
"jspdf": "^2.5.1",
"ldrs": "^1.0.1",
"openai": "^4.22.1",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-scripts": "5.0.1"
"react-router-dom": "^6.21.1",
"react-scripts": "5.0.1",
"use-places-autocomplete": "^4.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build"
"build": "react-scripts build",
"dev": "node server.js"
},
"eslintConfig": {
"extends": [
Expand All @@ -27,5 +44,8 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11"
}
}
38 changes: 38 additions & 0 deletions public1/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>ChatGPT Demo</title>
</head>
<body>
<div id="chat-container">
<div id="chat-log"></div>
<input type="text" id="user-input" placeholder="Type a message..." />
<button onclick="sendMessage()">Send</button>
</div>

<script>
async function sendMessage() {
const userInput = document.getElementById("user-input").value;
const chatLog = document.getElementById("chat-log");

// Display user message in the chat log
chatLog.innerHTML += `<div>User: ${userInput}</div>`;

// Send user input to the server
const response = await fetch("/send-message", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ message: userInput }),
});

const data = await response.json();

// Display AI's response in the chat log
chatLog.innerHTML += `<div>AI: ${data.message}</div>`;
}
</script>
Comment on lines +14 to +36
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were you not able to define this within the App.js context? It is JS after all and rendering something. Usually we do not touch the index.html. Also, why is there a public1 folder alongside the public folder?

</body>
</html>
40 changes: 40 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
const express = require("express");
const { config } = require("dotenv");
const { OpenAI } = require("openai");
const cors = require("cors");
const path = require("path");

config();

const app = express();
const port = 3002;

const openai = new OpenAI({
apiKey: process.env.API_KEY,
});

// app.use(cors({ origin: "http://localhost:3001" }));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove comments like such

app.use(cors());
app.use(express.static("public1"));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay public1 makes sense now, but you should have a separate project folder altogether if you run a backend for your frontend

app.use(express.json());

app.post("/send-message", async (req, res) => {
const userMessage = req.body.message;

try {
const response = await openai.chat.completions.create({
model: "gpt-3.5-turbo",
messages: [{ role: "user", content: userMessage }],
});

const aiResponse = response.choices[0].message.content;
res.json({ message: aiResponse });
} catch (error) {
console.error("Error processing the message:", error);
res.status(500).json({ error: "Error processing the message" });
}
});

app.listen(port, () => {
console.log(`Server running at http://localhost:${port}`);
});
67 changes: 65 additions & 2 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
.App {
text-align: center;
/* .App {
display: flex;
justify-content: center;
align-items: center;
} */

Comment on lines +1 to +6
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

@media all and (max-width: 500px) {
.app-container {
width: 10%;
}

.link-container,
.pills-landmarks {
display: none;
font-family: "Roboto";
}
}

@media all and (min-width: 501px) {
.drawer-links {
display: none;
}

.pills-landmarks {
display: flex;
}
}

.App-logo {
Expand All @@ -17,3 +41,42 @@
font-size: calc(10px + 2vmin);
color: white;
}

@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}

.ai-response {
animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}

.ai-response {
animation: fadeIn 0.5s ease;
}

.overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
backdrop-filter: blur(8px); /* Adjust the blur strength */
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment is redundant

z-index: 1000; /* Ensure it's above other elements */
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment is redundant

display: flex;
justify-content: center;
align-items: center;
}
Loading