Gathering Point is an e-ticketing site (clone of Eventbrite), where users can sign up for tournaments for the game, Magic: the Gathering.
https://gathering-point.herokuapp.com/
- PostgreSQL
- JavaScript
- Express
- Sequelize
- React
- Redux
- Node.js
- Heroku
- Events are divided into Categories (by tournament type).
- Users can click Events to go to individual Event pages for more details on that Event.
- Once logged in, Events can be created using the "Create an event" button on the Navigation bar.
- Once logged in, Events can be updated/deleted by the Event's owner, using buttons on the Event's page.
- Deleting an Event will cascade-delete the connected Tickets and Likes.
- On each Event page, there is a Register button for creating a Ticket for the user.
- If a user that is not logged-in clicks the Register button, the log-in modal appears.
- Once logged in, when the user does not have a Ticket, clicking the Register button creates a Ticket.
- Once logged in, when the user does have a Ticket, the Register button becomes a "Registered! (Cancel Ticket)" button, which can be clicked to delete a Ticket.
- Once logged in, a user can view that user's Tickets via buttons on the Navigation bar.
- On each Event page, the home page, and the search page, there is a Like button for creating a Like for the user.
- If a user that is not logged-in clicks the Like button, the log-in modal appears.
- Once logged in, when the user does not have a Like, clicking the Register button creates a Like.
- Once logged in, when the user does have a Like, the Like button is highlighted, which can be clicked to delete a Like.
- Once logged in, a user can view that user's Likes via buttons on the Navigation bar.
- Events on the home page and search page can be filtered by Category, using the clickable bar.
- The search bar can be used to search by the Event name and/or Event description.
The Like button for this website handles a number of cases:
- If there is no user logged in, clicking the button opens the log-in modal with a message.
- Upon login, the button is highlighted if the user has an existing Like, or not highlighted if the user does not have an existing Like.
- When logged in, clicking the button toggles if there is an existing Like. This button state needs to appear on the home page and the Event page.
- Upon logout, all buttons need to be not highlighted.
- If the button is on the Event card on the home/search page, have a bordered circle. If the button is on the Event page, do not have a bordered circle.
Cases are addressed as follows:
- Take login status from the Redux store, use if statements to open the modal with a message if there is no user logged in.
- Use React's useEffect hook to check for changes in Like status, such as when logging in.
- Use React's useEffect hook and Redux store to check for changes in Like status, such as when clicking the button.
- Use React's useEffect hook to check for changes in Like status, such as when logging out.
- Pass in a prop for the BookmarkButton React component, which can set the border property.
Code snippet of the BookmarkButton React component:
export default function BookmarkButton({ borderStyle, eventId }) {
// 5) borderStyle prop to control border color
const dispatch = useDispatch();
const [showModal, setShowModal] = useState(false);
const [hasBookmark, setHasBookmark] = useState(false);
const sessionUser = useSelector( (state) => state.session.user );
// 2), 3) and 4) useEffect triggers on changes in logged-in status and bookmark status
useEffect(()=>{
if (!sessionUser) {setHasBookmark(false)}
else {
if (sessionUser?.UserBookmarks[eventId]) {setHasBookmark(true)}
}
},[eventId, sessionUser])
//1) Opens login modal if no one is logged in, and 3) Store Like status in Redux store
function clickBookmarkButton() {
if (sessionUser) {
if (!hasBookmark) {dispatch(sessionActions.fetchAddBookmark(eventId, sessionUser.id))}
else {dispatch(sessionActions.fetchRemoveBookmark(eventId, sessionUser.id))}
setHasBookmark((prevHasBookmark) => !prevHasBookmark);
}
else {
setShowModal(true);
// 1) No user logged in, so open modal.
}
}
return (
<>
<div
className={borderStyle === "grey" ? "bookmark-button border-grey" : "bookmark-button"}
onClick={clickBookmarkButton}
>
<i className={hasBookmark ? "fas fa-heart" : "far fa-heart"}></i>
</div>
{showModal && (
<Modal onClose={() => setShowModal(false)}>
<LoginForm
setShowModal={setShowModal}
loginWarning='Please Log In to save Likes.'
// 1) Message if button is clicked without being logged in
/>
</Modal>
)}
</>
);
}
- Implementing AWS for uploading images, without the need for an external image hosting service.
- Implementing Google maps for depicting event locations.