Skip to content

xusandrew/Club-Connect

Repository files navigation

Club Connect

Live website: https://club-connect-tan.vercel.app/

Project Description

Ever get confused about which club events are happening and when? Well look no further, we are creating a social media platform to centralize all clubs within the University of Waterloo. The users would be any students interested in the clubs at the University. On ClubConnect, students will find events they want to attend, get more information on clubs, and check for upcoming club events.

Postings will be made by club executives and will be viewed by the general public. Club executives sign up/log in, granting them administrator access to create, edit, or change their postings. These users will be the administrators of the database.

The dataset will consist of mocked data of clubs that we generate using AI or Python scripts. We no longer have plans to reach out to school clubs for their actual content.

There will be 2 pages. An explore page, and an infinite scroll page. Any user can access both these pages regardless if they have an account or not. This is similar to UW Flow where anyone can view course and prof reviews.

The explore page will be where users can search for clubs. When the users select a club, they will be shown the Club Page. The Club Page has details about the club, including its category. Examples of categories include, but are not limited to: sports, art, and relaxing.

The infinite scroll page will be the main page /homepage of the website. This is where users can scroll infinitely like on Instagram. Posts will be displayed in chronological order of the posted-time. Most recent posts will be at the top. Additionally, site users can RSVP to club events by utilizing their email addresses. When users RSVP, they will be asked for their email address. The email addresses are used to track stats to show to clubs and also to send reminders to those who have RSVPed that they have registered for an upcoming event.

Features Implemented

Club registration and login

Screenshot 2024-07-13 at 2 14 34 PM Screenshot 2024-07-13 at 2 14 40 PM
  • Registration and login pages can be found in frontend/src/app/{register | login}/page.tsx
  • These pages call server actions defined in frontend/src/auth/index.ts which make requests to the database

Create, Edit and Delete Postings

image image - Create posting page can be found at frontend/src/app/create-event/page.tsx - Edit posting page can be found at frontend/src/app/edit-event/page.tsx

Infinite scroll feed

image
  • The infinite scroll features are implemented in frontend/src/components/events/{PopularEventsList | EventsList}.tsx

Sorting events by category

Screenshot 2024-07-13 at 2 13 29 PM
  • The events page can be found in frontend/src/app/events/[category]/page.tsx
  • The filter bar is located on the events page and is implemented in frontend/src/components/ui/FilterBar.tsx
  • The filter bar uses url params to specify which category to filter by, and and EventsList component defined in frontend/src/components/events/EventsList.tsx to display the events with the specified category
  • The EventsList component fetches events from the api route defined in frontend/src/app/api/events/[route].ts
  • The api route fetches events calls getEventsInWeek from frontend/src/lib/data.ts to fetch events from the database

Sorting by most popular

Screenshot 2024-07-13 at 2 13 44 PM
  • The events page can be found in frontend/src/app/events/[category]/page.tsx
  • The filter bar is located on the events page and is implemented in frontend/src/components/ui/FilterBar.tsx
  • The filter bar has a button that can sort events by most popular, and modifies the url parms to specify the sorting method
  • If sorting by most popular, the PopularEventsList component is used to display the events, found in frontend/src/components/events/PopularEventsList.tsx
  • The PopularEventsList component fetches events from the api route defined in frontend/src/app/api/events/popularity/[route].ts
  • The api route fetches events calls fetchPopularEvents defined in frontend/src/lib/data.ts to fetch events from the database

Searching clubs by name

Screenshot 2024-07-13 at 4 07 25 PM - Search a club by name - frontend/src/app/explore/[category]/page.tsx

Calendar page

Screenshot 2024-07-13 at 2 14 28 PM - All upcoming events in a pretty format - frontend/src/app/calendar/page.tsx

Club page

image - Displays information about a club and lists only its events - frontend/src/app/club/[cid]/page.tsx

Reminder / Notification Email for emails that have RSVPed

image image image - Sends a email to user when they RSVP, and reminder emails every day at 6am for events the next day - RSVP modal in frontend/src/components/events/Rsvp.tsx - RSVP reminder emails are triggered in frontend/src/app/api/rsvp-reminder/route.ts

Newsletter

image image image - Users can press the "sign up for newsletter" button on homepage, and get emails weekly regarding the events for that week - Modal implemented in frontend/src/components/events/NewsletterModal.tsx - Auto emails are triggered in frontend/src/app/api/newsletter/route.ts

Notify if there is an overlap between events between any other club on create/edit

image - Implemented in frontend/src/app/overlap-event/page.tsx

For admins, emails that have attended all events of their club

image
  • Implemented in frontend/src/components/ClubPage/UserRsvpedAllEventsList.tsx

Dark/Light mode

  • You have already seen dark mode, heres light mode
image - Implemented in frontend/src/components/ThemeProvider.tsx

Instagram embed into club page

image - Implemented in frontend/src/components/ui/InstaEmbed.tsx

Setup

  • Clone this repository
  • Run the Postgres database: docker compose up -d
  • cd into "frontend", this folder contains the entire app but it is named frontend because git has an aneurysm whenever I try to rename it to something else
  • Install dependencies: npm i
  • Generate the prisma client: npx prisma generate
  • Sync up postgres database with our schema (i.e, run migrations): npx prisma migrate dev
  • Load data into the database. For sample data, run: npx tsx ./prisma/seed.ts or for production data, run: npx tsx ./prisma/seed_production.ts
  • Run development server: npm run dev
  • Preview app at: http://localhost:3000

Development

  • You do not need to generate the prisma client every time you want to run the app. You only need to do this when you make changes to the prisma schema.
  • You can also keep the postgres database running in the background, you only need to run docker compose up -d once. You can stop the database with docker compose down
  • Important: Pls download the prettier vscode extension to keep our code nice and tidy

Prisma

  • To have a visual representation of the database through Prisma: npx prisma studio
  • Read this link if you want to learn about migrations: https://www.prisma.io/docs/orm/prisma-migrate/understanding-prisma-migrate/mental-model
  • Important: If you make changes to the prisma schema, you need to run npx prisma migrate dev --name <migration-name> to create a new migration. This will create a new migration file in the prisma/migrations folder. You can then run npx prisma migrate dev to apply the migration to the database.
  • If you are getting Unique constraint failed on the fields error when seeding the database, you can run npx prisma migrate reset delete all the data in the database (Be careful with this command, it will delete all the data in the database) so that you can repopulate

React-Email

  • To have a visual representation of the emails being edited:
    • cd /frontend/react-email-starter
    • npm i
    • npm run dev
    • To edit and test emails, add your tsx files in /frontend/react-email-starter/emails to test visual effects and see changes in real-tome

Milestone 1

  • 2 simple features implemented are: fetching events from our database + filtering events from our database

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5

Languages