Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
6dd46d2
added the seeds
Jan 26, 2024
a9b2b0a
set up branch for leaflet code, test map
jjyh Jan 26, 2024
f28a432
figuring pop up etc in just js leaflet, lat long order and crs
jjyh Jan 26, 2024
10b9bab
add css to start creating ring frame around map
jjyh Jan 26, 2024
17c3687
Update Axios, React Version and React Scripts
maryanibrahim Jan 26, 2024
9cded41
add top navigation bar
maryanibrahim Jan 26, 2024
5092698
add loop for more markers, fix testing csv
jjyh Jan 27, 2024
83dd46e
troubleshooting loop markers
jjyh Jan 27, 2024
cb7202c
troubleshooting loop markers
jjyh Jan 27, 2024
6688e56
troubleshooting loop markers
jjyh Jan 27, 2024
32e8330
figured out issue - coordinates are exactly the same so could not see
jjyh Jan 27, 2024
9ffa827
added google seed
Jan 27, 2024
a9c7a7b
Merge branch 'map-leaflet' into react-front-end
maryanibrahim Jan 27, 2024
fe888e8
removed extraneous testing file
jjyh Jan 28, 2024
92ad639
changed test csv data to latest from Feda, excerpted for Victoria
jjyh Jan 29, 2024
edc1a0a
changed some test code to match Victoria data
jjyh Jan 29, 2024
857f9dc
changed static zoom level, changed pop-up to only open for the lowest…
jjyh Jan 29, 2024
8641491
pull recent changes
ckats123 Jan 30, 2024
751f660
install dependencies
ckats123 Jan 30, 2024
10e0285
setup puppeteer
ckats123 Jan 30, 2024
393ef62
incorporate puppeteer into react
ckats123 Jan 30, 2024
5b0e32c
Merge pull request #1 from ckats123/map-leaflet
ckats123 Jan 31, 2024
ebfaf32
t Merge branch 'express_backend'
ckats123 Jan 31, 2024
79a4928
create LocationComponent.js
ckats123 Jan 31, 2024
c846411
create LocationComponent.js
ckats123 Jan 31, 2024
82d5ffe
set up branch for leaflet code, test map
jjyh Jan 26, 2024
bd3fea8
figuring pop up etc in just js leaflet, lat long order and crs
jjyh Jan 26, 2024
2cb334f
add css to start creating ring frame around map
jjyh Jan 26, 2024
c152e7d
add loop for more markers, fix testing csv
jjyh Jan 27, 2024
594f14f
troubleshooting loop markers
jjyh Jan 27, 2024
3355901
troubleshooting loop markers
jjyh Jan 27, 2024
5a53f2c
troubleshooting loop markers
jjyh Jan 27, 2024
a24bd68
figured out issue - coordinates are exactly the same so could not see
jjyh Jan 27, 2024
14841eb
removed extraneous testing file
jjyh Jan 28, 2024
f32b2f0
changed test csv data to latest from Feda, excerpted for Victoria
jjyh Jan 29, 2024
c8f9a33
changed some test code to match Victoria data
jjyh Jan 29, 2024
e37a592
changed static zoom level, changed pop-up to only open for the lowest…
jjyh Jan 29, 2024
282fc3f
Merge branch 'react_dependencies'
ckats123 Jan 31, 2024
1057fa8
create login and signup
maryanibrahim Jan 31, 2024
46a145d
Add login, signup, and profile routes; update dependencies
maryanibrahim Jan 31, 2024
a73488c
updated dataset
Jan 31, 2024
fb6a624
Merge branch 'master' into dataset
fedamuhammadian Jan 31, 2024
5381e5f
Merge pull request #2 from ckats123/dataset
ckats123 Jan 31, 2024
f4b4f09
install nodemon locally
ckats123 Feb 1, 2024
20ae8bc
add dependencies to run both react and express concurrently
ckats123 Feb 1, 2024
03ea495
Prepare react-front-end branch for merging with master
maryanibrahim Feb 1, 2024
63a5fc1
Merge branch 'react-front-end' of https://github.com/ckats123/gas-sta…
fedamuhammadian Feb 2, 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
Binary file added .DS_Store
Binary file not shown.
Binary file added express-back-end/.DS_Store
Binary file not shown.
5 changes: 5 additions & 0 deletions express-back-end/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"cSpell.words": [
"usersdatabase"
]
}
Empty file added express-back-end/README.md
Empty file.
Binary file added express-back-end/api/.DS_Store
Binary file not shown.
38 changes: 38 additions & 0 deletions express-back-end/api/users/login.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
const express = require('express');
const router = express.Router();
const bcrypt = require('bcrypt');

// Simulated user database (for demonstration purposes)
const users = [];

// Login route
router.post('/', (req, res) => {
const { userName, password } = req.body;

// Check the username against user database.
const user = users.find((user) => user.userName === userName);

if (user) {
// Compare the provided password with the hashed password from the user object
bcrypt.compare(password, user.password, (err, result) => {
if (err) {
// Handle error
res.status(500).json({ message: "Internal server error" });
} else if (result) {
// Passwords match, login successful
res.json({
message: "Login successful",
userName: user.userName,
token: "your_generated_token",
});
} else {
// Passwords don't match, return 401
res.status(401).json({ message: "Invalid credentials" });
}
});
} else {
res.status(401).json({ message: "Invalid credentials" });
}
});

module.exports = router;
27 changes: 27 additions & 0 deletions express-back-end/api/users/profile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const express = require('express');
const router = express.Router();

// Simulated user database (for demonstration purposes)
const users = [];

// Profile route
router.get('/:userName', (req, res) => {
const { userName } = req.params;

// Find the user by username ( should perform this check in database)
const user = users.find((user) => user.userName === userName);

if (user) {
res.json({
userName: user.userName,
email: user.email,
firstName: user.firstName,
lastName: user.lastName,
phoneNumber: user.phoneNumber,
});
} else {
res.status(404).json({ message: "User not found" });
}
});

module.exports = router;
43 changes: 43 additions & 0 deletions express-back-end/api/users/signup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
const express = require('express');
const router = express.Router();
const bcrypt = require('bcrypt');
const saltRounds = 10;

// Simulated user database
const users = [];

// POST route for user signup
router.post('/', async (req, res) => {
const { userName, password, email, firstName, lastName, phoneNumber } = req.body;

// Check if the user already exists
const existingUser = users.find(user => user.userName === userName);
if (existingUser) {
return res.status(400).json({ message: "Username already exists" });
}

// Hash the password
try {
const hashedPassword = await bcrypt.hash(password, saltRounds);

// Create a new user object
const newUser = {
userName,
password: hashedPassword,
email,
firstName,
lastName,
phoneNumber
};

// Add the new user to the database
users.push(newUser);

// Respond with a success message
res.status(201).json({ message: "Signup successful", user: newUser });
} catch (error) {
res.status(500).json({ message: "Error hashing password" });
}
});

module.exports = router;
Loading