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
b682bca
defined user model
pedrosortega Jul 31, 2025
1883fcc
created db tables and associations
Jul 31, 2025
1e08c30
Merge pull request #1 from LockIn-Capstone2/define-user-model
BenjaminA-cs-hub Jul 31, 2025
2d4fdfb
created db tables and associations
Jul 31, 2025
48f2663
added validation for email format
pedrosortega Jul 31, 2025
ffcd831
Added get and post route for the task manager feature
Aug 1, 2025
dcdea0d
Merge pull request #2 from LockIn-Capstone2/define-user-model
BenjaminA-cs-hub Aug 1, 2025
e7a49f0
Merge branch 'main' of https://github.com/LockIn-Capstone2/Capstone-2…
Aug 1, 2025
65a52a3
Fixed tasks table
Aug 1, 2025
72a17d6
Fixed the seed to correspond with the changes made in the tasks model
Aug 1, 2025
603cd15
Merge pull request #3 from LockIn-Capstone2/benjamin
ElianEchavarria Aug 1, 2025
0f5253d
cleaning up calculator model
KidCharlles Aug 3, 2025
ddd1630
post method for creating new grade entry. AKA calculating a final grade
KidCharlles Aug 3, 2025
86c1556
get route for fetching all of user's previous grade entries
KidCharlles Aug 4, 2025
d6bd3f5
route for fetching a user's specific grade entry
KidCharlles Aug 4, 2025
78ad9d0
delete route
KidCharlles Aug 4, 2025
ee0a7c1
Added get route to retreive task of a specefic user, post route to cr…
Aug 4, 2025
ea86ee0
put route and small fixes
KidCharlles Aug 5, 2025
663103b
Created multiple routes for the task organizer: Update Task By ID , D…
Aug 5, 2025
65416b5
Merge pull request #4 from LockIn-Capstone2/benjamin
pedrosortega Aug 5, 2025
875c226
Added route where user can filter tasks by their status
Aug 6, 2025
961d7d6
Updated tasks model, priority now has ENUM
Aug 6, 2025
bee3ea4
Created a filter by className route and filter by priority route
Aug 6, 2025
f42e8d1
fixes failed route tests
KidCharlles Aug 6, 2025
3202cdf
changing db back to it's initial state so it doesn't get merged in my…
KidCharlles Aug 6, 2025
bebe1c5
Made the filter by className route not case sensitive
BenjaminA-cs-hub Aug 6, 2025
0d1dab7
Merge pull request #6 from LockIn-Capstone2/benjamin
pedrosortega Aug 6, 2025
a3f33c0
Merge branch 'main' into charles-backend
KidCharlles Aug 6, 2025
4b87219
Merge pull request #5 from LockIn-Capstone2/charles-backend
BenjaminA-cs-hub Aug 6, 2025
11f118d
tested route works for getting duration
pedrosortega Aug 7, 2025
cb96d39
reworked route to only get duration rows
pedrosortega Aug 7, 2025
974e3ba
set API for Claude Ai ✅
ElianEchavarria Aug 8, 2025
cf28258
rout now returns created_at as well for plotting purposes in the fron…
pedrosortega Aug 8, 2025
6a34fc8
Added users to the seed
BenjaminA-cs-hub Aug 11, 2025
34b8073
updated seed
BenjaminA-cs-hub Aug 11, 2025
6fe5780
Fix Ai Route to parse the Ai quiz json ✅
ElianEchavarria Aug 11, 2025
44676b8
Merge branch 'main' into study-timer-data
pedrosortega Aug 11, 2025
a691627
Merge pull request #7 from LockIn-Capstone2/study-timer-data
BenjaminA-cs-hub Aug 11, 2025
42b147a
added username column for signup config issues
pedrosortega Aug 11, 2025
9e8dd8f
Merge pull request #8 from LockIn-Capstone2/define-user-model
ElianEchavarria Aug 12, 2025
2070103
edited routes and mounted so the signup can work
pedrosortega Aug 12, 2025
4e2643f
Merge pull request #9 from LockIn-Capstone2/study-timer-data
BenjaminA-cs-hub Aug 12, 2025
02cab25
Updated the system prompt behavior to avoid suggesting flashcards or …
ElianEchavarria Aug 13, 2025
95b5579
Edited seed
BenjaminA-cs-hub Aug 13, 2025
3297ab0
Merge branch 'main' into elian-backend
ElianEchavarria Aug 13, 2025
5074353
Merge pull request #10 from LockIn-Capstone2/elian-backend
pedrosortega Aug 13, 2025
153441b
Merge branch 'main' into benjamin
pedrosortega Aug 13, 2025
e98f06a
Merge pull request #11 from LockIn-Capstone2/benjamin
pedrosortega Aug 13, 2025
d28f2fd
Updated aichat api, fix some issues for the quiz✅
ElianEchavarria Aug 14, 2025
98c4911
Merge with main
ElianEchavarria Aug 14, 2025
37a6aff
Merge pull request #12 from LockIn-Capstone2/elian-backend
pedrosortega Aug 14, 2025
7c93c82
Fixed the seed file so that it has the proper ENUM values for status
BenjaminA-cs-hub Aug 14, 2025
04ed3d1
Merged
BenjaminA-cs-hub Aug 14, 2025
c81baea
Merge pull request #13 from LockIn-Capstone2/benjamin
pedrosortega Aug 14, 2025
6944aa1
Added a new route to keep track of User study sessions when the user …
ElianEchavarria Aug 16, 2025
860680d
Merge branch 'main' of https://github.com/LockIn-Capstone2/Capstone-2…
ElianEchavarria Aug 16, 2025
900210c
Merge pull request #14 from LockIn-Capstone2/elian-backend
pedrosortega Aug 16, 2025
be789f3
added route to post the user study session to the db
pedrosortega Aug 16, 2025
b9b0c04
Merge pull request #15 from LockIn-Capstone2/study-timer-posting
ElianEchavarria Aug 16, 2025
4e599b4
Updated Streak Session route
ElianEchavarria Aug 16, 2025
26a9e17
Merge pull request #16 from LockIn-Capstone2/elian-backend
pedrosortega Aug 16, 2025
b1fa3d7
New Routes to track user progress
ElianEchavarria Aug 18, 2025
19a8782
edited get route to return cleaner date format
pedrosortega Aug 18, 2025
f8430d9
Merge pull request #17 from LockIn-Capstone2/study-timer-posting
ElianEchavarria Aug 19, 2025
3f56235
Minor route fixing and new badge route
ElianEchavarria Aug 19, 2025
6349145
Merge pull request #18 from LockIn-Capstone2/elian-backend
pedrosortega Aug 19, 2025
0e676f6
Deleted some files
ElianEchavarria Aug 19, 2025
35a9af5
Merge pull request #19 from LockIn-Capstone2/elian-backend
pedrosortega Aug 19, 2025
c604b16
implemented google oauth
BenjaminA-cs-hub Aug 19, 2025
44c9b13
fixing backend changes. Updating seed file
KidCharlles Aug 19, 2025
c72f18f
removed console.log
KidCharlles Aug 19, 2025
c0b19f2
Fix authenctication with JWT functions
ElianEchavarria Aug 19, 2025
0155162
Merge pull request #21 from LockIn-Capstone2/elian-backend
pedrosortega Aug 19, 2025
3fad577
used token to get the users data
pedrosortega Aug 19, 2025
a50f837
Merge pull request #22 from LockIn-Capstone2/route-changes
ElianEchavarria Aug 19, 2025
3d617cf
Update .gitignore
ElianEchavarria Aug 19, 2025
23942c3
Merge pull request #20 from LockIn-Capstone2/charles-backend-2
ElianEchavarria Aug 19, 2025
692e9bd
fixed user model issue
pedrosortega Aug 19, 2025
91a3130
Merge pull request #23 from LockIn-Capstone2/route-changes
ElianEchavarria Aug 19, 2025
fdd2690
Fix nanoid ES module compatibility issue by downgrading to v3.3.7
ElianEchavarria Aug 20, 2025
f4dfde1
Add enhanced debugging to session endpoints and fix nanoid compatibility
ElianEchavarria Aug 20, 2025
f6fb272
Delete FlashcardPage.jsx
ElianEchavarria Aug 20, 2025
c9e6eb4
Merge pull request #24 from LockIn-Capstone2/elian-backend
pedrosortega Aug 20, 2025
25a20e2
Fix some route issue
ElianEchavarria Aug 20, 2025
a6d07fd
fix some route issue
ElianEchavarria Aug 20, 2025
1431930
Merge pull request #25 from LockIn-Capstone2/elian-backend
pedrosortega Aug 20, 2025
1920599
fix cors frontend url
ElianEchavarria Aug 20, 2025
85051c3
Merge pull request #26 from LockIn-Capstone2/elian-backend
pedrosortega Aug 20, 2025
642b308
Implemented GoogleOauth routes in the back end
BenjaminA-cs-hub Aug 20, 2025
219d7e0
merge
BenjaminA-cs-hub Aug 20, 2025
0f67488
Merge
BenjaminA-cs-hub Aug 20, 2025
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
413 changes: 413 additions & 0 deletions CALENDAR_INTEGRATION.md

Large diffs are not rendered by default.

104 changes: 104 additions & 0 deletions api/Calculator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
const express = require("express");
const router = express.Router();
const { Calculator } = require("../database");

// POST: Calculate a final grade. Creates a new grade entry in db
router.post("/new-grade-entry", async (req, res) => {
const { user_id, assignment_type, assignment_name, assignment_grade, assignment_weight } =
req.body;
try {
// check that required fields are not omitted
if (
!assignment_type ||
!assignment_name ||
assignment_weight == null ||
assignment_grade == null
) {
return res.status(400).json({ error: "Missing required fields" });
}

// Create new grade entry in db
const newGradeEntry = await Calculator.create({
user_id: req.body.user_id,
assignment_type: req.body.assignment_type,
assignment_name: req.body.assignment_name,
assignment_grade: req.body.assignment_grade,
assignment_weight: req.body.assignment_weight
});
newGradeEntry.save()

// Return new created grade entry
res.status(201).json(newGradeEntry);
} catch (error) {
console.error("Error creating new grade entry: ", error);
res.status(500).json({ error: "Unable to calculate final grade. Sorry!" });
}
});

// GET: Fetch all of user's past grade-calculator entries.
router.get("/grade-entries/:userId", async (req, res) => {
try {
const userId = req.params.userId;
const entries = await Calculator.findAll({ where: { user_id: userId } });
res.status(200).json(entries);
} catch (error) {
console.error("Error fetching previous grade entries for user", error);
res
.status(500)
.json({ error: "Unable to return your previous grade entries. Sorry!" });
}
});

// GET: Fetch a specific grade-calculator entry
router.get("/grade-entry/:entryId", async (req, res) => {
try {
const entryId = req.params.entryId;
const entry = await Calculator.findByPk(entryId);
if (!entry) {
return res.status(404).json({ error: "Entry not found" });
}
res.json(entry);
} catch (error) {
console.error("Error fetching previous grade entry");
res
.status(500)
.json({ error: "Unable to return previous grade entry. Sorry!" });
}
});

// PUT: Update a specific grade entry by ID
router.put("/grade-entry/:entryId", async (req, res) => {
try {
const entryId = req.params.entryId;
const { assignment_grade, assignment_weight } = req.body;
const entry = await Calculator.findByPk(entryId);
if (!entry) {
return res.status(404).json({ error: "Entry not found" });
}
// update the assignment grade and weight if provided; otherwise, keep the existing values
entry.assignment_grade = assignment_grade ?? entry.assignment_grade;
entry.assignment_weight = assignment_weight ?? entry.assignment_weight;
await entry.save();
res.json(entry);
} catch (error) {
console.error("Error updating grade entry: ", error);
res.status(500).json({ error: "Unable to update grade entry. Sorry!" });
}
});

// DELETE: Delete a specific grade entry
router.delete("/grade-entry/:entryId", async (req, res) => {
try {
const entryId = req.params.entryId;
const deleted = await Calculator.destroy({ where: { id: entryId } });
if (!deleted) {
return res.status(404).json({ error: "Entry not found" });
}
res.json({ message: "Grade entry deleted" });
} catch (error) {
console.error("Error deleting grade entry: ", error);
res.status(500).json({ error: "Unable to delete grade entry" });
}
});

module.exports = router;
Loading