Skip to content

Latest commit

 

History

1,063 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CampusZen

Banner

Next.js React MongoDB Pusher Tailwind Vercel

CampusZen is a student-focused social platform for Indian colleges. The app combines verified sign-in, campus communities, posts, clips, chats, resources, events, notifications, and admin moderation in one Next.js application.

✨ Highlights — v2.0 Verified Campus Graph

  • Verified student accounts: college email auto-verify (@iitb.ac.in → instant) + ID-card review queue (/admin/verifications), JWT HTTP-only cookies, Google OTP.
  • Verified-boosted feed: FEED_WEIGHTS.verified 8 points + ?verifiedOnly=true filter (app/api/posts/cursor-feed).
  • College communities: verified member counts, verified ratio bar, college-gated discovery (/community/[college] + VerifiedCommunityHeader).
  • Study Rooms (new): college-gated LiveKit rooms (/study-rooms), requiresVerified default, max 50, realtime via Socket.IO (CHAT_BACKEND_URL).
  • Real-time DMs + group chats with typing/read, LiveKit voice, notification bell with push (/api/notifications + emitToUser).
  • Admin queue + user management with ban/verify/pro actions.

🧭 Core Product Areas

🔐 Authentication and Verification

  • Email/password login and signup
  • Google OAuth sign-in
  • OTP verification and password reset flows
  • Student verification via dedicated verification pages and admin review paths
  • Secure session handling with HTTP-only cookies and JWT-based auth helpers

📰 Feed and Content

  • Smart cursor-based feed with ranking heuristics
  • Post creation with rich media support
  • Post detail pages with comments, reactions, sharing, and reporting
  • Hashtag pages and trending endpoints
  • Bookmarks and post saving
  • Clips for short-form content
  • Community pages for college-specific discovery

💬 Chat and Realtime

  • Direct messages + group chats (Socket.IO CHAT_BACKEND_URL, not Pusher)
  • Study Rooms — college-gated LiveKit voice (/study-rooms)
  • Typing indicators and read receipts
  • Realtime updates via lib/realtime.jsemitToUser/emitToGroup
  • Notification bell and push (Web Push + emitRealtime)

📚 Communities & Study

  • College communities with verified counts (VerifiedCommunityHeader)
  • Community join + post count tracking
  • Study Rooms discovery by college/topic

👤 Profile and Account Management

  • User profiles with avatar, banner, follow counts, and activity views
  • Follow and follower management
  • Settings, customization, billing, and account deletion flows
  • Login history and security-related account controls

📈 Analytics and Discovery

  • Search for posts, users, and trending content
  • Leaderboard views
  • Analytics dashboards for platform usage and moderation activity
  • Founder-specific broadcasts and roadmap utilities

🛡️ Admin and Security

  • Admin dashboard for users, verifications, content, resources, DMs, promo codes, logs, and security
  • Blocked content review and reported content review
  • User bans, IP bans, suspicious activity review, and moderation actions
  • Rate limiting and sanitization utilities
  • Push subscription management and web push support
  • Role-based access control helpers

🧰 Public Tools Hub

CampusZen also includes a public tools section with utilities such as:

  • Text tools like case conversion, slug generation, whitespace cleanup, reading time, delimiters, and compression
  • SEO tools like meta tag generation, broken-link checking, social share previews, and alt-text checks
  • Color tools like picker, contrast, gradient, blindness simulation, and relationship checks
  • Developer tools like UUID, ULID, QR, JWT, hash, regex, query conversion, HTML preview, PHP serialization, and more

Gamification

How to Earn XP : Users gain XP for:

  • Creating posts: +20 XP
  • Following users: +10 XP
  • Liking content: +5 XP
  • Commenting: +10 XP
  • Daily login: +50 XP
  • RSVPing to events: +15 XP
  • Uploading resources: +30 XP

🛠️ Tech Stack

Layer Technology
Framework Next.js 16 App Router
UI React 19
Styling Tailwind CSS 4, shadcn/ui, Radix UI
Database MongoDB + Mongoose
Realtime Pusher Channels
Cache and rate limiting Redis / Upstash
File uploads Appwrite Storage
Auth Better Auth, JWT, bcryptjs, jose
Notifications Web Push, Nodemailer
Motion and visuals Framer Motion, GSAP, motion
Analytics Vercel Analytics, Speed Insights

📁 Project Structure

app/
  (auth)/          Authentication flows
  (main)/          Main product surfaces
  (public)/        Public legal and marketing pages
  api/             Route handlers and backend endpoints
components/
  admin/           Admin console UI
  auth/            Authentication UI
  chat/            DM and group chat UI
  feed/            Feed utilities and widgets
  landing/         Homepage sections
  notifications/   Notification UI
  post/            Post composer and post actions
  resources/       Resource cards and uploads
  shared/          Shared primitives and helpers
  tools/           Public tools layouts
hooks/             Reusable client hooks
lib/               Auth, db, realtime, moderation, caching, and utilities
models/            Mongoose models

🚦 Key Routes

  • / public landing page
  • /login, /signup, /verify-student
  • /feed, /community, /chats, /notifications, /search
  • /events, /resources, /clips, /bookmarks, /leaderboard
  • /settings, /billing, /customize, /analytics
  • /admin, /admin/resources
  • /tools and the nested public utility pages

🚀 Setup

✅ Prerequisites

  • Node.js 18 or newer
  • MongoDB Atlas or another MongoDB instance
  • Pusher account
  • Redis / Upstash for cache and rate limiting features

📦 Install

git clone https://github.com/user-synax/campusX.git
cd campusx
npm install

🔧 Environment Variables

MONGODB_URI
JWT_SECRET
JWT_EXPIRES_IN
NEXT_PUBLIC_APP_URL
NEXT_PUBLIC_FOUNDER_USERNAME
NEXT_PUBLIC_APP_LAUNCH_DATE
CLOUDINARY_CLOUD_NAME
CLOUDINARY_API_KEY
CLOUDINARY_API_SECRET
EMAIL_HOST
EMAIL_PORT
GMAIL_USER
GMAIL_APP_PASS
ADMIN_NOTIFY_EMAIL
NEXT_PUBLIC_PUSHER_KEY
NEXT_PUBLIC_PUSHER_CLUSTER
PUSHER_APP_ID
PUSHER_SECRET
LIVEKIT_API_KEY
LIVEKIT_API_SECRET
NEXT_PUBLIC_LIVEKIT_URL
NEXT_PUBLIC_VAPID_PUBLIC_KEY
VAPID_PRIVATE_KEY
VAPID_SUBJECT
NEXT_PUBLIC_YT_API_KEY
NEXT_PUBLIC_TLDRAW_LICENSE
NEXT_PUBLIC_GIPHY_API_KEY
NEXT_PUBLIC_APK_DOWNLOAD_URL
NEXT_PUBLIC_CONTACT_DEVELOPER_URL
NEXT_PUBLIC_ADMIN_EMAIL
GOOGLE_CLIENT_ID
GOOGLE_CLIENT_SECRET
GOOGLE_REDIRECT_URI
OPENROUTER_API_KEY
CRON_SECRET
APPWRITE_ENDPOINT
NEXT_PUBLIC_APPWRITE_ENDPOINT
APPWRITE_PROJECT_ID
NEXT_PUBLIC_APPWRITE_PROJECT_ID
APPWRITE_API_KEY
NEXT_PUBLIC_APPWRITE_CLIPS_BUCKET_ID
APPWRITE_DATABASE_ID
NEXT_PUBLIC_APPWRITE_DATABASE_ID
NEXT_PUBLIC_APPWRITE_USER_MEDIA_BUCKET_ID
NEXT_PUBLIC_APPWRITE_RESOURCES_BUCKET_ID

Depending on the features you enable, you may also need the Redis, Cloudinary, Web Push, Google OAuth, and email-related values used by the corresponding libraries in lib/.

▶️ Run

npm run dev

Open http://localhost:3000.

🧪 Scripts

  • npm run dev - start the development server
  • npm run build - build for production
  • npm run start - start the production server
  • npm run lint - run the linter
  • npm run test - run the Jest test suite
  • npm run seed - seed the database
  • npm run seed:global-group - seed the global chat group

🔒 Security Notes

  • HTTP-only cookies are used for session safety.
  • Input sanitization and route-level guards are used across the API surface.
  • Rate limiting and IP banning are implemented for abusive behavior.
  • Admin routes are protected through role-based access checks.
  • Sensitive integrations are handled server-side.

📜 License

MIT License. See LICENSE for details.

About

An open-source student social network with college communities, anonymous posting, follows, and real-time feeds. Stack: Next.js 15 · MongoDB · shadcn/ui · JWT

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages