brtnd is an app that connects hosts to bartenders and bartender to hosts. If you have an event, you have a bartender. If you have drinks, you have a gig.
- MongoDB
- Express.js
- Node.js
- React
- Host (user) Interface
- Bartender (user) Interface
- Order C.R.U.D.
- Bartender Reviews
- Google Maps API to display pins for bartender location (origin), host location(destination), and estimated time of arrival.
- Host can tip a bartender
Users can enter the app as a bartender or host, each with its own interface and features.
Hosts have the ability to place and view their active order. Until their order is complete, hosts are able to update, save, and delete their order through the interface, sending those changes to their bartender.
Bartenders have the ability to accept an open order via the open orders link. From there, they can also view their current reviews to keep track of their progress and hone their craft.
Hosts are able to review bartenders, bartenders are able to view their reviews
In creating the user's and bartender's ordering abilities, we wanted to limit each party to one order at a time so to ensure that a user would not make unneccesary orders that they would frequently cancel and a bartender could not monopolize available gigs. In order to do this, we had to create a custom route on our backend that utilized mogoose's findOne method, and accounting for the possibility of returning an empty array. Our final post route is as follows:
router.post("/signup", (req, res) => {
const { errors, isValid } = validateSignupInput(req.body);
if (!isValid) {
return res.status(400).json(errors);
}
// Check to make sure nobody has already signuped with a duplicate email
User.findOne({ email: req.body.email }).then((user) => {
if (user) {
// Throw a 400 error if the email address already exists
return res
.status(400)
.json({ email: "A user has already registered with this address" });
} else {
// Otherwise create a new user
const newUser = new User({
firstName: req.body.firstName,
lastName: req.body.lastName,
email: req.body.email,
password: req.body.password,
});
bcrypt.genSalt(10, (err, salt) => {
bcrypt.hash(newUser.password, salt, (err, hash) => {
if (err) throw err;
newUser.password = hash;
newUser
.save()
.then((user) => res.json(user))
.catch((err) => console.log(err));
});
});
}
});
});