Skip to content

Navigation Menu

Sign in
Sign up

Latest commit

History

1,031 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

CampusZen

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

  • Verified student accounts with email/password, Google sign-in, OTP flows, and forgot-password recovery.
  • Social feed with posts, comments, reactions, shares, bookmarks, hashtags, and trending discovery.
  • Real-time direct messages and group chats with typing indicators and read states.
  • Resources, events, and clips for campus content beyond the main feed.
  • Notifications through in-app delivery, push subscriptions, and realtime updates.
  • Admin and moderation tooling for content, users, security, reports, verifications, and promo codes.
  • Public utility hub with developer-style tools for text, SEO, color, regex, UUIDs, JWTs, and more.

🧭 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
  • Typing indicators and read receipts
  • Realtime updates through Pusher channels
  • Notification bell and push notification preferences

📚 Events and Resources

  • Event creation and RSVP flows
  • Resource uploads, browsing, saved resources, and personal uploads
  • Resource moderation and admin review

👤 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

AltStyle によって変換されたページ (->オリジナル) /