Skip to content

Latest commit

Β 

History

30 Commits

Folders and files

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

Repository files navigation

πŸš€ Campus Connect

The Next-Gen Real-Time Student Discovery & Networking Ecosystem

License: MIT React Vite Tailwind CSS Firebase Three.js

Campus Connect is not just another student directory β€” it is a high-performance, real-time, campus-exclusive social ecosystem engineered for university students to discover peers, collaborate on research, participate in campus events, check in via QR tokens, and communicate securely.

Designed with modern glassmorphic aesthetics, WebGL shader lighting, real-time Firestore listeners, dynamic location density mapping, and a strict two-tier verification model.


πŸ“‹ Table of Contents


✨ Key Features

  • πŸ›‘οΈ Campus Gatekeeper & ID Card Verification
    Restricted access strictly bound to verified university registration numbers in valid_students combined with Student ID Card photo verification to prevent unauthorized external sign-ups.

  • ⚑ Real-Time Admin Session Kill Switch
    Integrated Firestore listener instantly revokes active student sessions and logs out users in real time if access status is modified by campus administration.

  • πŸ“± QR-Code Physical Event Check-In Engine
    Club leaders generate time-boxed check-in QR codes (checkins/{activityId}). Volunteers scan the code via live camera scanner to convert tentative sign-ups into verified event attendance.

  • πŸ† Community Volunteer Leaderboard & Duty Reviews
    Real-time leaderboard ranking student volunteers by verified completed operations (completedOps). Includes mission assignment, task review submission, and lead approval workflows.

  • πŸ—ΊοΈ Adaptive Location Density Mapping
    Real-time interactive map (LocationTracking.jsx) with dynamic auto-centering and zoom calculations aligned towards active student density on campus.

  • πŸŽ“ Seniority Filtering (Junior vs Senior)
    Smart student directory filtering by batch, department, and academic seniority (Senior vs Junior levels).

  • 🏫 College-Wise Campus Ecosystem Scoping
    Multi-campus ecosystem isolation enabling students to experience their distinct college culture while enabling discovery.

  • πŸƒ Interactive Discovery Stack
    Swipeable card stack supporting dual discovery modes:

    • Social Mode: Swipe to discover peers filtered by department, batch, and interest tags.
    • Volunteer Mode: Explore and volunteer for campus activities, community events, and drives.
  • πŸ’¬ Real-Time Direct & Ephemeral Group Chat Engine
    Instant 1-on-1 private messaging and temporary group chat rooms with 1-hour automated expiration logic and online presence indicators (isOnline & lastSeen).

  • 🚩 Campus Moderation & Reporting Shield
    Comprehensive safety suite allowing users to block or report toxic behavior, persisting directly into Firestore reports and blocks collections.

  • 🌌 Futuristic Glassmorphic WebGL UI
    Ultra-dark futuristic design featuring OGL / Three.js light ray shaders, responsive drawer navigation, custom cursors, and liquid transitions.


πŸ—οΈ System Architecture & Flowcharts

1. High-Level Architecture

graph TD
    User(["Student / User Browser"]) -->|"HTTP / WebGL"| Frontend["React + Vite Frontend"]
    
    subgraph FrontendApp ["Frontend Application Layer"]
        Frontend --> Router["React Router v6"]
        Router --> Context["Auth & Main Context API"]
        Context --> UIComponents["Pages & Glassmorphic UI Components"]
        UIComponents --> Shaders["WebGL LightRays / Three.js Engine"]
        UIComponents --> QRScanner["HTML5 QR Camera Scanner"]
    end

    subgraph FirebaseInfra ["Firebase Cloud Infrastructure"]
        Context -->|"Auth API"| FBAuth["Firebase Authentication"]
        Context -->|"Real-Time Listeners & CRUD"| Firestore[("Cloud Firestore NoSQL")]
        UIComponents -->|"Asset & ID Card Storage"| FBStorage["Firebase Storage"]
    end

    subgraph SecurityLayer ["Security & Access Layer"]
        Firestore --> SecurityRules["Firestore Rules v2"]
        SecurityRules -->|"Validation"| ValidStudents[("valid_students Collection")]
        SecurityRules -->|"QR Verification"| CheckinsCol[("checkins Collection")]
    end
Loading

2. Gatekeeper Authentication & Kill-Switch Flow

sequenceDiagram
    autonumber
    actor Student as Student Client
    participant AuthUI as Login / Signup UI
    participant Service as AuthService
    participant Firestore as Cloud Firestore
    participant FBAuth as Firebase Auth
    participant Admin as Admin / Listener

    Student->>AuthUI: Enters Email, Password, RegNo & Uploads ID Card
    AuthUI->>Service: registerStudent(email, password, regNo, idCard)
    Service->>Firestore: Check valid_students record for RegNo
    
    alt RegNo Not Found or Linked to Different Email
        Firestore-->>Service: Invalid / Unauthorized
        Service-->>AuthUI: Throw Registration Error
        AuthUI-->>Student: Display Error Notification
    else RegNo Validated
        Service->>FBAuth: createUserWithEmailAndPassword()
        FBAuth-->>Service: Auth Tokens & User Credential
        Service->>Firestore: Update valid_students: is_registered = true
        Service->>Firestore: Create user profile with ID Card & initial status
        Service-->>AuthUI: Auth Success
        AuthUI-->>Student: Redirect to /discover
    end

    note over Student, Firestore: Real-Time Session Kill Switch Listener
    Admin->>Firestore: Set valid_students record is_registered = false
    Firestore-->>Student: Real-time onSnapshot Triggered
    Student->>Student: Display "Session Revoked by Admin!" Banner
    Student->>FBAuth: Trigger automatic logout & Redirect to /login
Loading

3. QR-Code Attendance Verification Flow

sequenceDiagram
    autonumber
    actor Leader as Club Leader
    actor Volunteer as Student Volunteer
    participant Dashboard as ClubLeadDashboard
    participant Discovery as Discovery Page
    participant Firestore as Cloud Firestore

    Leader->>Dashboard: Click "Generate Check-in QR"
    Dashboard->>Firestore: Create checkins/{activityId} (token, expiresAt)
    Dashboard-->>Leader: Render visual QR Code (token URL)
    
    Volunteer->>Discovery: Open "Scan Check-In QR" Modal
    Volunteer->>Discovery: Scan QR Code via Live Camera
    Discovery->>Firestore: Read checkins/{activityId} & validate token

    alt Token Expired or Invalid
        Firestore-->>Discovery: Token Invalid / Expired
        Discovery-->>Volunteer: Show Error: "Check-in expired or invalid"
    else Token Validated
        Firestore->>Firestore: Add Volunteer UID to activities.verified_attendees
        Firestore->>Firestore: Increment User completedOps count (+1)
        Firestore-->>Discovery: Check-in Verified!
        Discovery-->>Volunteer: Display "Attendance Verified (+1 Op)" Badge
    end
Loading

4. Real-Time Messaging & Ephemeral Chat Flow

flowchart LR
    subgraph ClientA ["Student A"]
        A1["Select Peer / Group"] --> A2["Send Message"]
    end

    subgraph FirestoreBackend ["Firestore Backend"]
        B1[("chats Collection")]
        B2[("chats/chatId/messages Subcollection")]
    end

    subgraph ClientB ["Student B"]
        C1["Live onSnapshot Listener"] --> C2["Render Chat Bubble & Presence"]
    end

    subgraph ExpiryWorker ["Expiry Worker"]
        E1["Check expiresAt Timestamp"] -->|"If Current Time > expiresAt"| E2["Filter / Purge Ephemeral Room"]
    end

    A2 -->|"sendMessage service"| B2
    A2 -->|"updateDoc lastMessage"| B1
    B2 -->|"Real-Time Push"| C1
    B1 --> ExpiryWorker
Loading

πŸ—„οΈ Database Schema & Data Models

Campus Connect operates under a two-tier security model in Cloud Firestore:

1. valid_students (Admin Access Control)

{
  "registrationNumber": "241001001218",
  "email": "student@university.edu",
  "is_registered": true,
  "lastLogin": "Timestamp"
}

2. users (Student Profiles)

{
  "uid": "firebase_auth_uid",
  "name": "Anirban Sarkar",
  "regNo": "241001001218",
  "branch": "CSE",
  "batch": "2024-28",
  "seniority": "Senior",
  "college": "Institute of Engineering & Management",
  "bio": "Coder / Innovator / Troubleshooter",
  "interests": ["Coding", "AI-ML", "Physics"],
  "role": "student",
  "photoUrl": "https://...",
  "idCardUrl": "https://...",
  "completedOps": 5,
  "isOnline": true,
  "lastSeen": "Timestamp",
  "location": {
    "lat": 22.5726,
    "lng": 88.4337
  },
  "updatedAt": "Timestamp"
}

3. checkins (QR Code Attendance Tokens)

{
  "token": "a8f9c2d1-e4b5-4a6c-9d8e-1f2a3b4c5d6e",
  "expiresAt": "Timestamp (Event end time or +2 hours)",
  "createdBy": "lead_uid",
  "activityId": "activity_document_id"
}

4. activities (Club & Community Events)

{
  "activityId": "auto_generated_id",
  "event_title": "Campus AI Hackathon",
  "community_name": "Coding Club",
  "description": "Building next-gen AI tools",
  "event_date": "2026-10-15",
  "image_url": "https://...",
  "volunteer_list": ["uidA", "uidB"],
  "verified_attendees": ["uidA"],
  "created_by": "lead_uid"
}

5. chats (Direct & Group Conversations)

{
  "chatId": "uidA_uidB",
  "type": "group | ephemeral_group",
  "groupName": "Hackathon Squad",
  "users": ["uidA", "uidB", "uidC"],
  "createdBy": "uidA",
  "admins": ["uidA"],
  "lastMessage": "Let's meet at 5 PM!",
  "createdAt": "Timestamp",
  "updatedAt": "Timestamp",
  "expiresAt": "Timestamp (1 Hour from creation)"
}

Subcollection: chats/{chatId}/messages

{
  "messageId": "auto_generated_id",
  "senderId": "uidA",
  "text": "Hey everyone!",
  "createdAt": "Timestamp"
}

6. reports & blocks (Safety & Moderation)

// reports/{reportId}
{
  "reporterId": "uidA",
  "reportedUserId": "uidB",
  "reason": "Harassment / Spam",
  "details": "Inappropriate messages in group chat",
  "createdAt": "Timestamp"
}

// blocks/{blockId}
{
  "blockerId": "uidA",
  "blockedUserId": "uidB",
  "createdAt": "Timestamp"
}

πŸ› οΈ Tech Stack

Frontend Core

  • βš›οΈ React 18.3 β€” Functional components, custom hooks, and Context API architecture.
  • ⚑ Vite 7.2 β€” Instant Hot Module Replacement (HMR) and optimized ESbuild pipelines.
  • 🚦 React Router v6 β€” Declarative client-side routing & protected route wrappers.

Styling & UI Design

  • 🎨 Tailwind CSS v4 β€” Utility-first engine with high-performance CSS @theme variables.
  • πŸ’« Framer Motion 12 β€” Smooth layout transitions and interactive card animations.
  • 🎨 Lucide React β€” Crisp icon library.
  • πŸ“· HTML5-QRCode β€” Web-based live camera scanner for QR verification.

Shaders & WebGL Graphics

  • 🧊 Three.js β€” 3D graphics rendering engine.
  • ⚑ OGL (Minimal WebGL) β€” Custom GPU light ray background shader (LightRays.jsx).

Backend (BaaS) & Database

  • πŸ”₯ Firebase Authentication β€” Secure email/password auth.
  • πŸ“¦ Cloud Firestore β€” Real-time NoSQL document store with live snapshot sync.
  • πŸ’Ύ Supabase JS Client β€” Auxiliary database integration option.
  • 🐍 FastAPI / Python Admin SDK β€” Python backend environment for batch verification & administrative scripts.

πŸ” Security & Access Control

Firestore enforcement is governed by firestore.rules (rules version 2):

  • Campus Gatekeeper: valid_students collection readable by clients for auth validation.
  • Profile Ownership: users/{userId} documents are only writable by the authenticated owner (request.auth.uid == userId).
  • QR Attendance Verification: checkins/{activityId} documents readable by authenticated volunteers; activities verified attendee updates allowed for signed-in users.
  • Private Messaging Shield: Chat threads (chats/{chatId}) and nested messages (messages/{messageId}) are accessible only to users explicitly included in the resource.data.users array.
  • Moderation Safety: reports and blocks collections writeable by reporting users.

πŸ“¦ Getting Started & Setup Guide

Prerequisites

  • Node.js: v18.0.0 or higher
  • npm or yarn

1️⃣ Clone the Repository

git clone https://github.com/your-username/campusConnect.git
cd campusConnect

2️⃣ Install Frontend Dependencies

cd frontend
npm install

3️⃣ Configure Environment / Firebase

Verify or update your Firebase configuration parameters in frontend/src/conf/firebase.js:

import { initializeApp } from "firebase/app";
import { getAuth } from "firebase/auth";
import { getFirestore } from "firebase/firestore";
import { getStorage } from "firebase/storage";

const firebaseConfig = {
  apiKey: "YOUR_API_KEY",
  authDomain: "YOUR_PROJECT_ID.firebaseapp.com",
  projectId: "YOUR_PROJECT_ID",
  storageBucket: "YOUR_PROJECT_ID.appspot.com",
  messagingSenderId: "YOUR_SENDER_ID",
  appId: "YOUR_APP_ID"
};

const app = initializeApp(firebaseConfig);
export const auth = getAuth(app);
export const db = getFirestore(app);
export const storage = getStorage(app);

4️⃣ Run Development Server

npm run dev

Open your browser at http://localhost:5173.

5️⃣ (Optional) Python FastAPI Backend Setup

# In the repository root
pip install -r requirements.txt

πŸ“ Project Directory Structure

campusConnect/
β”œβ”€β”€ firestore.rules          # Security rules for Cloud Firestore (v2)
β”œβ”€β”€ db.json                  # Local seed / mock database reference
β”œβ”€β”€ requirements.txt         # Python dependencies for admin tools
β”œβ”€β”€ LICENSE                  # MIT License
└── frontend/
    β”œβ”€β”€ package.json         # Node.js dependencies and scripts
    β”œβ”€β”€ vite.config.js       # Vite build configuration
    β”œβ”€β”€ index.html           # Main HTML document entrypoint
    └── src/
        β”œβ”€β”€ main.jsx         # App entrypoint
        β”œβ”€β”€ App.jsx          # Routes definition & Protected Route wrapper
        β”œβ”€β”€ index.css        # Global CSS, theme variables & WebGL canvas reset
        β”œβ”€β”€ conf/
        β”‚   β”œβ”€β”€ firebase.js  # Firebase SDK initialization
        β”‚   └── supabase.js  # Supabase client setup
        β”œβ”€β”€ context/
        β”‚   └── mainContext.jsx # Auth state, profile listener & Kill-Switch logic
        β”œβ”€β”€ services/
        β”‚   β”œβ”€β”€ Authservice.js    # Login, signup, logout & online status services
        β”‚   β”œβ”€β”€ chatService.js    # Direct, group, ephemeral chat & real-time listeners
        β”‚   └── profileService.js # Profile fetch & update methods
        β”œβ”€β”€ components/
        β”‚   β”œβ”€β”€ Layout.jsx           # Responsive Navbar & Sidebar shell
        β”‚   β”œβ”€β”€ Loading.jsx          # Futuristic loading screen
        β”‚   β”œβ”€β”€ NotificationsPopup.jsx # Real-time alert notifications
        β”‚   β”œβ”€β”€ BrandLogo.jsx        # Animated brand logo component
        β”‚   β”œβ”€β”€ LightPillar.jsx      # Dynamic visual effect backdrop pillar
        β”‚   β”œβ”€β”€ Cards/
        β”‚   β”‚   β”œβ”€β”€ CardStack.jsx    # Swipeable card container logic
        β”‚   β”‚   β”œβ”€β”€ ProfileCard.jsx  # Student profile card rendering
        β”‚   β”‚   └── VolunteerCard.jsx# Activity/Volunteer card rendering
        β”‚   β”œβ”€β”€ auth/
        β”‚   β”‚   β”œβ”€β”€ LoginUI.jsx      # Login interface
        β”‚   β”‚   └── SignUpUI.jsx     # Registration interface with ID Card upload
        β”‚   └── effects/
        β”‚       β”œβ”€β”€ LightRays.jsx    # WebGL GPU Light Rays shader canvas
        β”‚       └── LightRays.css    # Shader layout styling
        └── pages/
            β”œβ”€β”€ LandingPage.jsx      # Hero landing page with multi-college ecosystem picker
            β”œβ”€β”€ Login.jsx            # Auth entry page
            β”œβ”€β”€ Discovery.jsx        # Swipe card discovery & live QR Scanner
            β”œβ”€β”€ Community.jsx        # Campus feed & Community Club Groups tab
            β”œβ”€β”€ Chat.jsx             # Real-time direct & group chat interface
            β”œβ”€β”€ Find.jsx             # Student search with Seniority & Department filters
            β”œβ”€β”€ LocationTracking.jsx # Adaptive campus location map with user clustering
            β”œβ”€β”€ Requests.jsx         # Connection / Friend request management
            β”œβ”€β”€ Profile.jsx          # Student profile view & verified ops stats
            β”œβ”€β”€ EditProfile.jsx      # Profile editor
            β”œβ”€β”€ ClubHub.jsx          # Campus clubs catalog
            β”œβ”€β”€ ClubLeadDashboard.jsx# Leader dashboard with QR Check-In Token Generator
            └── Feedback.jsx         # Campus user feedback submission

πŸ§ͺ Roadmap & Future Vision

  • Campus Gatekeeper Verification
  • Real-Time Admin Kill-Switch
  • Student Profile Management
  • Friend Request Handshake Engine
  • Direct & Ephemeral Group Chat
  • WebGL Light Rays Background Shaders
  • QR-Code Physical Event Check-In System
  • Community Club Groups & Leaderboard
  • Adaptive Location Density Mapping
  • Seniority (Junior / Senior) Filtering
  • ID Card Verification Onboarding
  • πŸ€– AI Matchmaker: ML-driven student pairing based on project goals & interests.
  • πŸ“± Mobile Native: React Native mobile app build for iOS & Android.
  • πŸ”’ End-to-End Encrypted Chat: Client-side payload encryption for private messages.

🀝 Contributing

Contributions make the campus community thrive! To contribute:

  1. Fork the Repository.
  2. Create a Feature Branch: git checkout -b feature/CoolCampusFeature
  3. Commit your Changes: git commit -m 'Add CoolCampusFeature'
  4. Push to the Branch: git push origin feature/CoolCampusFeature
  5. Open a Pull Request.

πŸ“œ License

Distributed under the MIT License. See LICENSE for details.


Built with ❀️ for students, by students. If you find Campus Connect helpful, give it a ⭐ on GitHub!

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages