Skip to content

Full-stack campus intelligence platform built with FastAPI, React, and PostgreSQL. Integrates multi-source campus data for real-time entity resolution, anomaly detection, and predictive analytics using machine learning.

Notifications You must be signed in to change notification settings

Ruvaifa/campusflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

79 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ›ก๏ธ CampusFlow - Campus Entity Resolver

Next-Generation Security & Intelligence Platform for Smart Campuses

TypeScript React FastAPI Python Ask DeepWiki License

Built for IIT Guwahati Hackathon 2025, 2nd Runner Up!

๐Ÿš€ Live Demo โ€ข ๐Ÿ“– Documentation โ€ข ๐ŸŽฏ Features โ€ข โšก Quick Start


๐ŸŒŸ Overview

CampusFlow is an advanced, AI-powered campus security and entity resolution platform that unifies fragmented identity data across multiple systems (card swipes, WiFi logs, CCTV, lab bookings) into a comprehensive, real-time intelligence dashboard.

๐ŸŽฏ The Problem We Solve

Modern campuses generate massive amounts of fragmented identity data:

  • ๐Ÿข Card swipe systems track physical access
  • ๐Ÿ“ก WiFi logs capture device connectivity
  • ๐Ÿ“น CCTV systems monitor visual presence
  • ๐Ÿ”ฌ Lab booking systems record facility usage

CampusFlow seamlessly integrates these disparate data sources to provide:

  • โœ… Real-time entity resolution with 99.17% accuracy
  • โœ… Predictive space analytics powered by ML
  • โœ… Anomaly detection for security threats
  • โœ… Privacy-preserving operations with role-based access

๐ŸŽฏ Key Features

๐Ÿง  SpaceFlowโ„ข - Predictive Campus Intelligence

Our flagship feature that won us the hackathon

Accuracy RMSE Rยฒ
  • ๐Ÿ—บ๏ธ Interactive Campus Map with real-time occupancy visualization
  • ๐Ÿ“Š ML-Powered Forecasting (Neural Net + XGBoost + LightGBM ensemble)
  • โš ๏ธ Smart Alert System with severity scoring and explainability
  • ๐ŸŽฏ Next-Hour Predictions for every campus zone
  • ๐Ÿ“ˆ Evidence-Based Recommendations with impact scoring

ML Model Architecture:

Hybrid Ensemble (99.17% Top-1 Accuracy)
โ”œโ”€ Neural Network (40%) - Deep patterns
โ”œโ”€ XGBoost (30%) - Feature importance
โ””โ”€ LightGBM (30%) - Gradient boosting

๐Ÿ”— Advanced Entity Resolution (92%+ Accuracy)

  • Multi-Source Fusion: Combines data from 5+ different systems
  • Fuzzy Matching: Handles typos, abbreviations, and name variations
  • Cross-Source Linking: 85-95% confidence across disparate identifiers
  • Real-Time Updates: Sub-second query response times

๐Ÿ“Š Comprehensive Analytics Dashboard

  • ๐Ÿ“ˆ Real-Time Stats: 7,000+ entities tracked
  • ๐Ÿ• Activity Timelines: Complete historical tracking
  • ๐Ÿ” Deep Provenance: Source attribution for every data point
  • ๐Ÿค– Anomaly Detection: ML-powered threat identification
  • ๐Ÿ“ Location Prediction: Probabilistic location forecasting

๐ŸŽจ Enterprise-Grade UI/UX

  • ๐ŸŒ“ Dark/Light Theme: Fully responsive design
  • ๐Ÿ“ฑ Mobile-First: Works flawlessly on all devices
  • โšก Lightning Fast: Optimized performance with React 18
  • ๐ŸŽญ Smooth Animations: Powered by Framer Motion
  • โ™ฟ Accessible: WCAG 2.1 compliant

๐Ÿ—๏ธ Architecture

graph TB
    A[Frontend - React + TypeScript] --> B[API Layer - FastAPI]
    B --> C[Database - Supabase PostgreSQL]
    B --> D[ML Engine - PyTorch + XGBoost]
    D --> E[SpaceFlow Predictor]
    D --> F[Anomaly Detector]
    C --> G[Entity Resolver]
    G --> H[Cross-Source Linker]
Loading

๐Ÿ› ๏ธ Technology Stack

Frontend

  • โš›๏ธ React 18.3 - Modern UI framework
  • ๐Ÿ“˜ TypeScript 5.5 - Type-safe development
  • ๐ŸŽจ Tailwind CSS - Utility-first styling
  • ๐ŸŽญ Framer Motion - Smooth animations
  • ๐Ÿ“Š Recharts - Beautiful data visualization
  • ๐Ÿงฉ Shadcn/UI - Premium component library

Backend

  • ๐Ÿš€ FastAPI - High-performance Python framework
  • ๐Ÿ˜ PostgreSQL - Robust relational database
  • ๐Ÿ”ฅ Supabase - Real-time database & auth
  • ๐Ÿง  PyTorch - Neural network training
  • ๐Ÿ“Š XGBoost + LightGBM - Gradient boosting
  • ๐Ÿ” FuzzyWuzzy - Fuzzy string matching

ML/AI

  • ๐Ÿค– Hybrid Ensemble Model (99.17% accuracy)
  • ๐Ÿ“ˆ SHAP - Model explainability
  • ๐ŸŽฒ Uncertainty Quantification - Confidence intervals
  • ๐Ÿ”ฎ Time-Series Forecasting - Next-hour predictions

โšก Quick Start

Prerequisites

  • Node.js 18+ and npm 9+
  • Python 3.11+
  • Supabase account (free tier works!)

๐Ÿš€ Installation

1๏ธโƒฃ Clone & Install Frontend

# Clone the repository
git clone https://github.com/Shafwansafi06/campus-entity-resolver1.git
cd campus-entity-resolver

# Install dependencies
npm install

# Start development server
npm run dev

Frontend will be available at http://localhost:5173

2๏ธโƒฃ Setup Backend

# Navigate to backend
cd backend

# Create virtual environment (recommended)
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Create credentials file
cp creds.env.example creds.env  # or create manually

Edit backend/creds.env:

SUPABASE_URL=https://your-project.supabase.co
SUPABASE_KEY=your-anon-key-here
# Start the backend server
python main.py

Backend API will be available at http://localhost:8000

3๏ธโƒฃ Access the Application

  1. Open http://localhost:5173 in your browser
  2. Login with demo credentials (or sign up)
  3. Explore the dashboard and SpaceFlow features!

๐Ÿ“Š Performance Metrics

ML Model Performance

Metric Value Industry Standard
Top-1 Accuracy 99.17% 95%+
RMSE 1.15 <2.0
MAE 0.79 <1.0
Rยฒ Score 0.878 >0.85
Inference Time <50ms <100ms

System Performance

Metric Value
Entities Tracked 7,000+
Activity Records 50,000+
API Response Time <100ms
Real-Time Updates Yes
Concurrent Users 100+

๐ŸŽฎ Demo Features

Try These Workflows:

  1. ๐Ÿ“Š Dashboard Overview

    • View real-time campus statistics
    • Monitor security alerts
    • Track active entities
  2. ๐Ÿ—บ๏ธ SpaceFlow Intelligence

    • Explore interactive campus map
    • View predictive occupancy forecasts
    • Receive smart alerts with explainability
  3. ๐Ÿ” Entity Deep Dive

    • Search for any entity
    • View complete activity timeline
    • Analyze cross-source linkages
  4. ๐Ÿ›ก๏ธ Security Monitoring

    • Monitor inactive entities
    • Detect anomalies
    • Track access violations

๐Ÿ“ Project Structure

campus-entity-resolver/
โ”œโ”€โ”€ src/                      # Frontend source code
โ”‚   โ”œโ”€โ”€ components/          # Reusable UI components
โ”‚   โ”œโ”€โ”€ pages/              # Application pages
โ”‚   โ”‚   โ”œโ”€โ”€ Dashboard.tsx   # Main dashboard
โ”‚   โ”‚   โ”œโ”€โ”€ SpaceFlow.tsx   # Predictive intelligence
โ”‚   โ”‚   โ”œโ”€โ”€ Entities.tsx    # Entity management
โ”‚   โ”‚   โ””โ”€โ”€ Alerts.tsx      # Security alerts
โ”‚   โ”œโ”€โ”€ contexts/           # React contexts
โ”‚   โ””โ”€โ”€ hooks/              # Custom React hooks
โ”œโ”€โ”€ backend/                 # Python FastAPI backend
โ”‚   โ”œโ”€โ”€ main.py            # API server
โ”‚   โ”œโ”€โ”€ ml_predictor.py    # ML inference engine
โ”‚   โ”œโ”€โ”€ database.py        # Supabase integration
โ”‚   โ””โ”€โ”€ models/            # Trained ML models
โ””โ”€โ”€ public/                 # Static assets

๐Ÿš€ Deployment

Frontend (Vercel/Netlify)

# Build production bundle
npm run build

# Preview production build
npm run preview

Backend (Railway/Render)

# The backend is ready for containerization
docker build -t campusflow-backend .
docker run -p 8000:8000 campusflow-backend

๐Ÿค Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ‘ฅ Team

Built with โค๏ธ by the CampusFlow Team for IIT Guwahati Hackathon 2025


๐Ÿ™ Acknowledgments

  • IIT Guwahati for hosting the hackathon
  • Supabase for database infrastructure
  • The open-source community for amazing tools

โญ Star us on GitHub โ€” it helps!

GitHub stars

Made with Love for IIT Guwahati Hackathon 2025


About

Full-stack campus intelligence platform built with FastAPI, React, and PostgreSQL. Integrates multi-source campus data for real-time entity resolution, anomaly detection, and predictive analytics using machine learning.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •