generated from agiledev-students-fall2023/generic-project-repository
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into workflows-action
Showing
46 changed files
with
1,848 additions
and
868 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# The Group Bill Splitting App | ||
|
||
## Description of Project | ||
|
||
The Group Bill Splitting App is designed to streamline the process of splitting bills among groups of people. In today's social and financial landscape, individuals often find themselves sharing expenses in various settings, such as dining out, traveling, or living together. This application aims to provide an efficient and user-friendly solution for managing shared expenses, ensuring that everyone pays their fair share effortlessly. | ||
|
||
### Product Vision Statement | ||
|
||
In a world where coming together and sharing moments are core to our daily lives - whether it's traveling abroad, dining out with friends, going on work trips with colleagues, or handling routine household bills with family - dealing with shared financial responsibilities should be simple and straightforward. Our vision is to introduce a unified platform where handling and dividing shared expenses is as easy as a single click. We aim for an app that makes group financial transactions clear-cut while prioritizing clarity, adaptability, and user comfort. The Group Bill Splitting App is designed to enable users to easily track, manage, and clear their shared expenses, fostering trust and enhancing the pleasure of shared moments without the monetary hassle. | ||
|
||
## Core Team Members | ||
|
||
- [Allison Ji](https://github.com/Allison67) | ||
- [Joy Chen](https://github.com/joyc7) | ||
- [Cindy Liang](https://github.com/cindyliang01) | ||
- [Laura Zhao](https://github.com/HedwigO) | ||
- [Elaine Zhang](https://github.com/elaineZhang67) | ||
|
||
## Contribution | ||
|
||
Please refer to [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to this project. | ||
|
||
## Instructions for Building and Testing | ||
|
||
To be updated | ||
|
||
## Additional Links | ||
|
||
- [User Experience Design](UX-DESIGN.md) | ||
|
||
## Notes |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,6 @@ | |
"chai": "^4.3.10", | ||
"chai-http": "^4.4.0", | ||
"mocha": "^10.2.0", | ||
"nodemon": "^3.0.1" | ||
"nodemon": "^3.0.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,36 @@ | ||
const express = require('express'); | ||
const express = require("express"); | ||
const router = express.Router(); | ||
const { User } = require("../models/User.js"); | ||
|
||
router.post('/', async (req, res) => { | ||
const { currentUserId, friendUserId } = req.body; | ||
router.post("/", async (req, res) => { | ||
const { currentUserId, friendUserId } = req.body; | ||
|
||
try { | ||
const currentUser = await User.findById(currentUserId); | ||
const friendUser = await User.findById(friendUserId); | ||
try { | ||
const currentUser = await User.findById(currentUserId); | ||
const friendUser = await User.findById(friendUserId); | ||
|
||
if (!currentUser || !friendUser) { | ||
return res.status(404).send("One or both users not found"); | ||
} | ||
|
||
if (!currentUser.friends.includes(friendUserId)) { | ||
currentUser.friends.push(friendUserId); | ||
await currentUser.save(); | ||
console.log(`Added ${friendUserId} to ${currentUser.id}'s friends list.`); | ||
} else { | ||
return res.status(200).send("Already friends"); | ||
} | ||
if (!currentUser || !friendUser) { | ||
return res.status(404).send("One or both users not found"); | ||
} | ||
|
||
if (!friendUser.friends.includes(currentUserId)) { | ||
friendUser.friends.push(currentUserId); | ||
await friendUser.save(); | ||
} | ||
if (!currentUser.friends.includes(friendUserId)) { | ||
currentUser.friends.push(friendUserId); | ||
await currentUser.save(); | ||
console.log(`Added ${friendUserId} to ${currentUser.id}'s friends list.`); | ||
} else { | ||
return res.status(200).send("Already friends"); | ||
} | ||
|
||
res.status(200).send("Friends added successfully"); | ||
|
||
} catch (error) { | ||
console.error("Error in addFriend route:", error); | ||
res.status(500).send("Error adding friend"); | ||
if (!friendUser.friends.includes(currentUserId)) { | ||
friendUser.friends.push(currentUserId); | ||
await friendUser.save(); | ||
} | ||
|
||
res.status(200).send("Friends added successfully"); | ||
} catch (error) { | ||
console.error("Error in addFriend route:", error); | ||
res.status(500).send("Error adding friend"); | ||
} | ||
}); | ||
|
||
module.exports = router; | ||
module.exports = router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.