Skip to content

KanavCode/smart-campus-utility-hub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

132 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ“ Smart Campus Utility Hub

A unified platform for intelligent campus management β€” Streamline academic operations with AI-powered timetable generation, smart elective selection, and seamless event coordination.

License: MIT Node.js React TypeScript PostgreSQL Express.js Tailwind CSS PRs Welcome NSoC 2026 GitHub Issues GitHub Stars


πŸ“‹ Table of Contents


🎯 Problem Statement

University campuses face significant operational challenges with fragmented systems β€” timetable scheduling, elective allocation, and event management are handled through separate, often manual processes. This leads to:

  • Scheduling conflicts when rooms, teachers, or time slots are double-booked
  • Unfair elective allocation not based on objective criteria like CGPA
  • Poor event visibility with no central place for students to discover activities
  • High administrative overhead from managing everything in spreadsheets

Smart Campus Utility Hub solves these problems by providing a unified, web-based platform that automates intelligent timetable generation, CGPA-based elective allocation, and centralised event management β€” accessible to students, faculty, and admins from a single interface.


🌟 Overview

Smart Campus Utility Hub is a comprehensive, full-stack campus management platform designed to revolutionize how educational institutions handle scheduling, electives, and events. Built with modern web technologies, it provides a seamless experience for students, faculty, and administrators.

Key Highlights

  • πŸ€– AI-Powered Scheduling - Intelligent timetable generation with automatic conflict detection
  • 🎯 Smart Allocation - CGPA-based elective selection with fair distribution algorithms
  • πŸŽ‰ Event Management - Unified platform for campus events and club activities
  • πŸ”’ Secure & Scalable - JWT authentication with enterprise-grade security
  • 🎨 Modern UI/UX - Beautiful, responsive design with smooth animations

Platform Statistics

  • 5,000+ Students Connected
  • 100+ Campus Events Managed
  • 50+ Active Clubs

✨ Features

πŸ“… Timetable Management

  • Automated Generation - Backtracking algorithm for optimal scheduling
  • Conflict Detection - Real-time validation of scheduling conflicts
  • Room Allocation - Intelligent resource optimization
  • Export Options - Download timetables in multiple formats
  • Multi-View Support - Day, week, and month views

πŸ“š Elective Selection System

  • CGPA-Based Allocation - Fair distribution based on academic performance
  • Preference Ranking - Students can prioritize their choices
  • Real-Time Availability - Live seat count updates
  • Subject Management - Comprehensive subject catalog with:
    • Artificial Intelligence
    • Data Warehousing & Data Mining
    • Big Data Analytics
    • Cloud Computing
    • Machine Learning
    • Network Security
    • And more...

πŸŽͺ Campus Events & Clubs

  • Event Discovery - Browse and search campus events
  • RSVP Management - Easy registration and tracking
  • Club Activities - Manage club memberships and activities
  • Event Creation - Simple event posting interface
  • Notifications - Real-time updates for upcoming events

πŸ” Authentication & Security

  • JWT Authentication - Secure token-based authentication
  • Role-Based Access - Student, Faculty, and Admin roles
  • Password Encryption - bcrypt hashing for user credentials
  • Rate Limiting - Protection against brute-force attacks
  • CORS & Helmet - Enhanced security headers

πŸ› οΈ Tech Stack

Frontend

Technology Version Purpose
React 19+ UI Framework
TypeScript 5.x Type Safety
Vite 7.x Build Tool
Tailwind CSS 3.x/4.x Styling
Framer Motion 12.x Animations
React Router 7.x Routing
TanStack Query 5.x Data Fetching
Axios 1.12+ HTTP Client
Zustand 5.x State Management
Radix UI Latest Accessible Components
Lucide React 0.4+ Icons
Lottie React 2.4+ Animations

Backend

Technology Version Purpose
Node.js 18+ Runtime
Express.js 5.x Web Framework
PostgreSQL 13+ Database
JWT 9.x Authentication
bcryptjs 3.x Password Hashing
Joi 17.x Validation
Winston 3.x Logging
Helmet 7.x Security
CORS 2.x Cross-Origin Resource Sharing

DevOps & Tools

  • Bun - Fast JavaScript runtime (frontend alternative)
  • Jest - Testing framework
  • Supertest - API testing
  • Nodemon - Development server
  • ESLint - Code linting

πŸ“ Project Structure

smart-campus-utility-hub/
β”‚
β”œβ”€β”€ .github/                          # GitHub configuration
β”‚   β”œβ”€β”€ workflows/
β”‚   β”‚   └── lint.yml                  # CI: lint + type-check + tests
β”‚   β”œβ”€β”€ ISSUE_TEMPLATE/               # Issue templates (bug, feature, good-first-issue)
β”‚   └── PULL_REQUEST_TEMPLATE.md
β”‚
β”œβ”€β”€ smart-campus-backend/             # Node.js / Express API
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ app.js                    # Express application entry point
β”‚   β”‚   β”œβ”€β”€ config/
β”‚   β”‚   β”‚   └── db.js                 # PostgreSQL connection pool
β”‚   β”‚   β”œβ”€β”€ middleware/
β”‚   β”‚   β”‚   β”œβ”€β”€ auth.middleware.js    # JWT authentication
β”‚   β”‚   β”‚   β”œβ”€β”€ errorHandler.js       # Global error handling
β”‚   β”‚   β”‚   └── validation.js         # Request validation helpers
β”‚   β”‚   └── components/
β”‚   β”‚       β”œβ”€β”€ users/                # User registration & authentication
β”‚   β”‚       β”œβ”€β”€ timetable/            # Timetable generation (backtracking)
β”‚   β”‚       β”œβ”€β”€ electives/            # CGPA-based elective selection
β”‚   β”‚       └── campus-events/        # Events & club management
β”‚   β”œβ”€β”€ sql/
β”‚   β”‚   β”œβ”€β”€ schema.sql                # Full database schema
β”‚   β”‚   └── migrate.js                # Migration runner
β”‚   β”œβ”€β”€ __tests__/                    # Jest test suites
β”‚   β”œβ”€β”€ .env.example                  # Environment variable template
β”‚   └── package.json
β”‚
β”œβ”€β”€ smart-campus-frontend/            # React + TypeScript frontend (Vite)
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ ui/                   # shadcn/ui base components
β”‚   β”‚   β”‚   β”œβ”€β”€ landing/              # Landing page sections
β”‚   β”‚   β”‚   └── animations/           # Lottie / Framer Motion components
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”‚   β”œβ”€β”€ Landing.tsx           # Public landing page
β”‚   β”‚   β”‚   β”œβ”€β”€ Auth.tsx              # Login / Registration
β”‚   β”‚   β”‚   β”œβ”€β”€ student/              # Student dashboard & features
β”‚   β”‚   β”‚   └── admin/                # Admin panel
β”‚   β”‚   β”œβ”€β”€ services/                 # API service layer (Axios)
β”‚   β”‚   β”œβ”€β”€ contexts/                 # React context providers
β”‚   β”‚   β”œβ”€β”€ hooks/                    # Custom React hooks
β”‚   β”‚   └── lib/
β”‚   β”‚       └── axios.ts              # Configured Axios instance
β”‚   β”œβ”€β”€ .env.example                  # Environment variable template
β”‚   └── package.json
β”‚
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ ISSUES.md                     # 20 pre-written NSoC GitHub issues
β”‚   └── LABELS.md                     # GitHub label strategy
β”‚
β”œβ”€β”€ scripts/
β”‚   └── setup.sh                      # One-command local setup script
β”‚
β”œβ”€β”€ docker-compose.yml                # Docker multi-service stack
β”œβ”€β”€ CONTRIBUTING.md                   # Contribution guide
β”œβ”€β”€ ROADMAP.md                        # Project roadmap (Phase 1/2/3)
└── README.md

πŸš€ Quick Start

Prerequisites

Installation

  1. Clone the repository
git clone https://github.com/KanavCode/smart-campus-utility-hub.git
cd smart-campus-utility-hub
  1. Backend Setup
# Navigate to backend
cd smart-campus-backend

# Install dependencies
npm install

# Create .env file from the example
cp .env.example .env
# Edit .env with your DB credentials and JWT_SECRET

# Run database migrations
npm run db:migrate

# Start development server
npm run dev

The backend will run on http://localhost:5000

  1. Frontend Setup
# Navigate to frontend
cd ../smart-campus-frontend

# Install dependencies
npm install

# Create .env file from the example
cp .env.example .env
# VITE_API_BASE_URL=http://localhost:5000/api

# Start development server
npm run dev

The frontend will run on http://localhost:5173

Database Configuration

Create a PostgreSQL database and run the schema:

psql -U your_username -d your_database -f smart-campus-backend/sql/schema.sql

Or use the migration script:

cd smart-campus-backend
npm run db:migrate

⚑ One-Command Setup

The quickest way to get everything running locally:

# Automated setup (Node.js + PostgreSQL required)
chmod +x scripts/setup.sh
./scripts/setup.sh

Or with Docker (no local PostgreSQL needed):

# Copy and configure environment
cp smart-campus-backend/.env.example smart-campus-backend/.env
cp smart-campus-frontend/.env.example smart-campus-frontend/.env

# Start all services
docker compose up --build

This starts PostgreSQL, the backend API, and the frontend dev server automatically.


πŸ“– Documentation

Backend API Documentation

Comprehensive API documentation is available in the backend directory:

πŸ“„ smart-campus-backend/API_DOCUMENTATION.md
πŸ“„ smart-campus-backend/README.md

Frontend Documentation

πŸ“„ smart-campus-frontend/INTEGRATION_GUIDE.md
πŸ“„ smart-campus-frontend/README.md

API Endpoints

Authentication

  • POST /api/auth/register - User registration
  • POST /api/auth/login - User login

Timetable

  • GET /api/timetable - Get timetable
  • POST /api/timetable/generate - Generate timetable
  • GET /api/timetable/conflicts - Check conflicts

Electives

  • GET /api/electives - Get available electives
  • POST /api/electives/select - Submit preferences
  • POST /api/electives/allocate - Admin allocation

Events

  • GET /api/events - Get all events
  • POST /api/events - Create event
  • GET /api/events/:id - Get event details
  • POST /api/events/:id/rsvp - RSVP to event

For detailed request/response examples, see Backend API Documentation.


🎨 Screenshots

Landing Page

Modern, animated landing page with feature highlights and testimonials.

Student Dashboard

Comprehensive dashboard with timetable, electives, and events management.

Admin Panel

Powerful admin interface for managing users, subjects, timetables, and events.

Timetable View

Interactive timetable with drag-and-drop functionality and conflict detection.

Elective Selection

Intuitive elective selection interface with preference ranking.


πŸ§ͺ Testing

Backend Tests

cd smart-campus-backend

# Run all tests
npm test

# Run tests in watch mode
npm run test:watch

# Generate coverage report
npm run test:coverage

Frontend Tests

cd smart-campus-frontend

# TypeScript type check
npx tsc --noEmit

# Lint
npm run lint

πŸ—ΊοΈ Roadmap

See ROADMAP.md for the full project roadmap across three phases:

  • Phase 1 (Q2 2026) β€” Stability & open-source readiness
  • Phase 2 (Q3 2026) β€” New features (iCal export, waitlists, OAuth)
  • Phase 3 (Q4 2026+) β€” Scaling, Redis caching, CI/CD pipeline

πŸ—οΈ Architecture

Backend Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Client    β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
       β”‚
       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Express.js β”‚ ◄── Middleware (Auth, CORS, Helmet)
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
       β”‚
       β”œβ”€β”€β”€ /api/auth ──► User Authentication
       β”œβ”€β”€β”€ /api/timetable ──► Timetable Generation
       β”œβ”€β”€β”€ /api/electives ──► Elective Selection
       └─── /api/events ──► Event Management
              β”‚
              β–Ό
       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚  PostgreSQL  β”‚
       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Frontend Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Router    β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
       β”‚
       β”œβ”€β”€β”€ Landing ──► Public landing page
       β”œβ”€β”€β”€ Auth ──► Login/Register
       β”œβ”€β”€β”€ Student Dashboard ──► Student features
       └─── Admin Dashboard ──► Admin features
              β”‚
              β”œβ”€β”€β”€ TanStack Query ──► Data fetching
              β”œβ”€β”€β”€ Zustand ──► State management
              └─── Axios ──► API communication

🀝 Contributing

We welcome contributions from the community! Whether it's bug fixes, feature additions, or documentation improvements. This project participates in NSoC 2026.

πŸ‘‰ Read the full contribution guide: CONTRIBUTING.md

How to Contribute

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feat/your-feature-name
  3. Commit with Conventional Commits
    git commit -m "feat(timetable): add iCal export endpoint"
  4. Push and open a Pull Request
    git push origin feat/your-feature-name

Good First Issues

Looking for a place to start? Check out issues labelled good first issue or browse the pre-written issues in docs/ISSUES.md.


πŸ› Troubleshooting

Common Issues

Database Connection Error

# Check PostgreSQL is running
psql -U postgres -c "SELECT version();"

# Verify .env DATABASE_URL is correct
# Format: postgresql://user:password@localhost:5432/database

Frontend API Connection Failed

# Ensure backend is running on correct port
# Verify VITE_API_URL in .env matches backend port
# Check CORS configuration in backend

Port Already in Use

# Find and kill process using port 5000
lsof -ti:5000 | xargs kill -9

# Or change port in .env file

For more troubleshooting, see Backend Troubleshooting Guide.


πŸ“ž Support

Team

Smart Campus Team

  • Mann
  • Kanav
  • Kavya
  • Kirtan

Contact



πŸ™ Acknowledgments



Made with ❀️ by the Smart Campus Team

⭐ Star this repository if you find it helpful!

Report Bug Β· Request Feature Β· Documentation Β· Contributing

About

This is a 5th Sem Project made by : Kanav, Mann, Kavya, Kirtan

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors