Skip to content

About

A modern social platform for Wilfrid Laurier University students to connect, share updates, and collaborate academically.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

145 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

WLU Connect

A modern social networking platform designed specifically for Wilfrid Laurier University students to connect, share updates, and collaborate academically.

πŸ“‹ Table of Contents

🎯 Overview

WLU Connect is a university-focused social media platform that enables students to:

  • Share posts and updates with the campus community
  • Discover and register for club events
  • Form and join course-specific study groups
  • Build their academic network through following other students

✨ Features

πŸ” Authentication & Authorization

  • JWT-based authentication with secure access and refresh tokens
  • Protected routes ensuring only authenticated users can post, comment, and interact
  • Password hashing using bcrypt for secure credential storage

πŸ‘€ User Profiles

  • Customizable profiles with bio, program of study, and profile pictures
  • Image upload and cropping with Cloudinary integration
  • Follow/unfollow system to build your campus network
  • User statistics displaying follower count, following count, and total posts
  • Pagination for efficient loading of user posts

πŸ“ Posts & Interactions

  • Rich post creation with text content and image attachments
  • Post categorization with 6 types: General, Career, Academic, Question, Opportunity, Achievement
  • Like system with real-time count updates
  • Commenting system with nested replies and pagination
  • Post deletion for content ownership
  • Character limits to maintain post quality (500 characters)
  • Image preview before posting

πŸ“… Club Events

  • Event discovery with search and faculty filtering
  • Event registration with capacity management
  • Event details including date, time, location, and club organizer
  • Registration tracking showing current capacity and member list

πŸ“š Study Groups

  • Course-based organization using course codes
  • Flexible scheduling supporting both one-time sessions and recurring meetings
  • Location tracking for physical or virtual meeting spaces
  • Member capacity limits to maintain effective group sizes
  • Join/leave functionality with instant updates
  • Search and filter by course code, group name, or creator
  • Group tabs to view all available groups or just your memberships

πŸ›  Tech Stack

Frontend

React TypeScript Vite TailwindCSS

Backend

Node.js Express PostgreSQL

Cloud Services

Cloudinary

Additional Libraries

Frontend

  • react-easy-crop: Professional image cropping for profile pictures
  • date-fns / Native Date: Date formatting and manipulation

Backend

  • jsonwebtoken: JWT token generation and verification
  • bcrypt: Password hashing and comparison
  • pg: PostgreSQL client for Node.js
  • cors: Cross-origin resource sharing
  • dotenv: Environment variable management
  • express-rate-limit: API rate limiting for security

Database Schema

Key Tables:

  • users: User accounts and profiles
  • posts: User-generated content
  • comments: Post comments and replies
  • likes: Post like tracking
  • follows: User follow relationships
  • events: Club events and activities
  • event_registrations: Event attendance tracking
  • study_groups: Academic study groups
  • study_group_members: Study group memberships

Authentication Flow

User Login β†’ Backend validates credentials β†’ JWT issued
            ↓
JWT stored in localStorage
            ↓
All API requests include JWT in Authorization header
            ↓
Backend middleware validates JWT β†’ Route handler executes

Image Upload Flow

User selects image β†’ Image cropped in browser
                    ↓
                Cropped file sent to backend
                    ↓
                Backend receives file
                    ↓
                Upload to Cloudinary
                    ↓
                Cloudinary URL returned
                    ↓
                URL saved in PostgreSQL
                    ↓
                Frontend displays image from Cloudinary CDN

πŸ“ Project Structure

wlu-connect/
β”œβ”€β”€ client/                   # Frontend React application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ assets/          # Static assets (images, icons)
β”‚   β”‚   β”œβ”€β”€ components/      # Reusable UI components
β”‚   β”‚   β”‚   β”œβ”€β”€ Comment.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ CreatePost.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ EventCard.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ NavBar.tsx
β”‚   β”‚   β”‚   └── Post.tsx
β”‚   β”‚   β”œβ”€β”€ context/         # React Context providers
β”‚   β”‚   β”‚   └── AuthContext.tsx
β”‚   β”‚   β”œβ”€β”€ modals/          # Modal components
β”‚   β”‚   β”‚   β”œβ”€β”€ CreateGroupModal.tsx
β”‚   β”‚   β”‚   └── GroupMembersModal.tsx
β”‚   β”‚   β”œβ”€β”€ pages/           # Page components
β”‚   β”‚   β”‚   β”œβ”€β”€ EditProfile.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ EventInfo.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Events.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ FollowList.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ GroupStudy.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Home.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Login.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Profile.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ResendVerification.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Signup.tsx
β”‚   β”‚   β”‚   └── VerifyEmail.tsx
β”‚   β”‚   β”œβ”€β”€ types/           # TypeScript type definitions
β”‚   β”‚   β”‚   β”œβ”€β”€ comment.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ event.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ post.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ profile.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ search.ts
β”‚   β”‚   β”‚   └── user.ts
β”‚   β”‚   β”œβ”€β”€ utils/           # Utility functions
β”‚   β”‚   β”œβ”€β”€ App.tsx          # Main app component
β”‚   β”‚   β”œβ”€β”€ index.css        # Global styles
β”‚   β”‚   β”œβ”€β”€ main.tsx         # Entry point
β”‚   β”‚   └── svg.d.ts         # SVG type declarations
β”‚   β”œβ”€β”€ public/              # Static assets
β”‚   β”œβ”€β”€ .env.development     # Development environment variables
β”‚   β”œβ”€β”€ index.html           # HTML template
β”‚   └── package.json
β”‚
β”œβ”€β”€ server/                  # Backend Express application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ config/          # Configuration files
β”‚   β”‚   β”‚   β”œβ”€β”€ cloudinary.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ database.ts
β”‚   β”‚   β”‚   └── env.ts
β”‚   β”‚   β”œβ”€β”€ middleware/      # Express middleware
β”‚   β”‚   β”‚   β”œβ”€β”€ auth.ts
β”‚   β”‚   β”‚   └── rateLimit.ts
β”‚   β”‚   β”œβ”€β”€ routes/          # API route handlers
β”‚   β”‚   β”‚   β”œβ”€β”€ auth.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ clubs.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ comments.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ events.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ likes.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ posts.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ search.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ studyGroups.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ upload.ts
β”‚   β”‚   β”‚   └── users.ts
β”‚   β”‚   β”œβ”€β”€ types/           # TypeScript type definitions
β”‚   β”‚   β”‚   └── express.d.ts
β”‚   β”‚   β”œβ”€β”€ utils/           # Utility functions
β”‚   β”‚   β”‚   └── email.ts
β”‚   β”‚   └── index.ts         # Server entry point
β”‚   β”œβ”€β”€ requests/            # API request examples/tests
β”‚   β”œβ”€β”€ .env                 # Environment variables
β”‚   β”œβ”€β”€ package.json
β”‚   └── tsconfig.json
β”‚
└── README.md

πŸ“‘ API Documentation

Authentication Endpoints

POST   /auth/signup          Create new user account
POST   /auth/login           Authenticate user
POST   /auth/refresh         Refresh access token

User Endpoints

GET    /users/me/profile                Get current user profile
GET    /users/:username                 Get user by username
GET    /users/:username/complete        Get complete profile data
PUT    /users/:username                 Update user profile
POST   /users/:username/follow          Follow a user
DELETE /users/:username/follow          Unfollow a user
GET    /users/:username/follow/status   Check follow status

Post Endpoints

GET    /posts/all                       Get all posts (paginated)
GET    /posts/:id                       Get single post
POST   /posts                           Create new post
DELETE /posts/:id                       Delete post
GET    /posts/:id/comments              Get post comments
POST   /posts/:id/comments              Add comment

Like Endpoints

POST   /likes/posts/:id/like            Like a post
DELETE /likes/posts/:id/like            Unlike a post
GET    /likes/posts/:id/me              Check if user liked post
GET    /likes/posts/:id/count           Get like count

Event Endpoints

GET    /events/all                      Get all events
GET    /events/:id                      Get event details
POST   /events/:id/register             Register for event
DELETE /events/:id/register             Unregister from event
GET    /events/:id/register/status      Check registration status

Study Group Endpoints

GET    /study-groups                    Get all study groups
GET    /study-groups/:id                Get group details
POST   /study-groups                    Create study group
POST   /study-groups/:id/join           Join study group
DELETE /study-groups/:id/leave          Leave study group
GET    /study-groups/me/memberships     Get user's groups

Upload Endpoints

POST   /upload/image                    Upload image to Cloudinary

πŸ”’ Security Features

  • Password Hashing: Bcrypt with 10 salt rounds
  • JWT Authentication: Secure token-based auth with refresh tokens
  • Rate Limiting: Prevents abuse of upload and authentication endpoints
  • CORS Configuration: Restricts cross-origin requests
  • Input Validation: Prevents SQL injection and XSS attacks
  • File Type Validation: Only allows image uploads (JPEG, PNG, GIF, WebP)
  • File Size Limits: 5MB maximum for uploads
  • Protected Routes: Middleware ensures authentication for sensitive operations

πŸš€ Deployment

Frontend (Vercel)

The React frontend is deployed on Vercel with automatic deployments from the main branch. Vercel handles the build process (npm run build) and serves the static assets through their global CDN.

Configuration:

  • Build command: npm run build
  • Output directory: dist
  • Environment variables configured for API URL pointing to the Railway backend

Backend & Database (Railway)

The Express server and PostgreSQL database are both hosted on Railway, providing a unified backend infrastructure.

Setup:

  • Node.js server deployed from the /server directory
  • PostgreSQL database provisioned through Railway's managed database service
  • Environment variables configured for database connection, JWT secrets, and Cloudinary credentials
  • Automatic deployments triggered on push to main branch

Disclaimer

This project is an independent portfolio demonstration created by Hunter Shierman. It is not affiliated with, endorsed by, or associated with Wilfrid Laurier University. Any reference to "WLU" or "Wilfrid Laurier University" is for descriptive purposes only to indicate the target audience and inspiration for the platform.

About

A modern social platform for Wilfrid Laurier University students to connect, share updates, and collaborate academically.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages