IIIT Dharwad DA264 Project Β· Full-Stack DBMS with Data Warehouse, ETL Pipeline & Real-Time Analytics
Overview β’ Features β’ Architecture β’ Dashboard β’ Database β’ Quick Start β’ Highlights
Smart Campus is a production-grade Business Intelligence system that transforms raw campus operational data into real-time, actionable insights. The platform combines:
- 12 BCNF-normalized OLTP tables capturing live transactions (energy readings, bookings, maintenance, access logs)
- Star Schema OLAP warehouse (515+ fact rows, 97.7% data quality) optimized for analytics
- Python ETL pipeline with incremental loading, IQR outlier detection, and surrogate key mapping
- Real-time React dashboard (9 modules, 28-second auto-refresh) with interactive OLAP operations
- Complete DBMS mastery demonstration: normalization proofs, transaction management (ACID/2PL), query optimization, data quality enforcement
Live Data: The system monitors 6 campus buildings, 16 rooms, 27 energy meters, 200+ bookings, 109 users with full operational dashboards.
Campuses generate massive amounts of operational dataβenergy readings, room bookings, maintenance requests, access logsβbut lack a unified system to:
- π« Track real-time resource utilization across campus
- π« Detect anomalies (energy spikes, SLA breaches, security risks)
- π« Analyze historical trends using clean, warehoused data
- π« Support data-driven campus management
β Single source of truth for all campus operations β Real-time dashboards showing energy consumption, room utilization, maintenance status, security events β Historical analytics via star schema data warehouse with OLAP drilldown β Data quality enforcement with IQR-based anomaly detection (97.7% clean) β Production-grade architecture demonstrating enterprise DBMS patterns
8 Live KPI Cards (auto-refreshing every 28 seconds):
- Total Energy: 87.3 MWh (+4.2% vs last month)
- Campus Users: 109 registered (76 students, 15 faculty, 15 staff, 3 admins)
- Rooms Tracked: 16 monitored spaces across campus
- Total Bookings: 200 approved bookings (+32 this week)
- Open Maintenance Tickets: 18 unresolved issues
- Access Events: 208 total logged entries
- Active Equipment: 65 devices online
- Active Meters: 27 energy sensors live
Campus Health Score (82/100) composite metric:
- Energy Efficiency: 78 (proximity to consumption baselines)
- Maintenance: 69 (SLA compliance: 20% β see maintenance dashboard)
- Space Utilization: 85 (booking density vs room capacity)
Energy + Booking Weekly Trend: Dual-axis chart showing correlation between energy demand and room usage across 10 weeks (bars = energy in MWh, line = bookings count).
Dashboard: Room-Level Drilldown

Four KPI cards:
- Total kWh: 1,351 kWh (current period)
- Est. Cost: βΉ11.5K (at βΉ8.5/unit, Indian standard)
- COβ Footprint: 1,108 kg (using 0.82 kg COβ/kWh factor)
- Avg Voltage: 228.4 V (across all 27 active meters)
Room-Level Energy Breakdown (tagged "DRILL-DOWN"): Ranked by consumption with peak multiplier analysis (SQL LAG window function):
- Seminar Hall: 311 kWh (100% baseline, peak 1.72Γ)
- L301 Computer Lab: 248 kWh (80% baseline, peak 1.71Γ)
- L201 Computer Lab: 197 kWh (63% baseline)
- C202 Classroom: 183 kWh (55% baseline)
Department Energy Roll-Up (tagged "OLAP ROLL-UP"): Using GROUP BY ROLLUP aggregation:
- Computer Science & Engineering: 524 kWh
- Electronics & Comm: 281 kWh
- Data Science & AI: 200 kWh
Room Γ Hour Energy Heatmap (tagged "IQ MATRIX"): Color grid (8 AMβ6 PM, darker red = higher kWh) showing peak usage hours by room location, sourced from OLAP SLICE query.
Building Energy Analysis & Anomalies

Building Energy Roll-Up (from warehouse):
- E Block (Academic): 4,820 kWh (highest, 55%)
- PI Block (Admin+Research): 1,230 kWh (14%)
- B Block (Boys Hostel): 980 kWh (11%)
- G Block (Girls Hostel): 860 kWh (10%)
- H Block (Gym+Canteen): 540 kWh (6%)
- M Block (Sports): 320 kWh (4%) Peak ratio: 58% peak hours (9 AMβ12 PM class startup, 3 PM afternoon peak)
Meter Type Distribution (donut):
- Electricity: 11 meters (primary)
- Solar: 7 meters (renewable)
- Water: 4 meters (utility)
- Gas: 5 meters (cooking)
24-Hour Energy Profile (line chart): Double-peak pattern:
- Morning peak (~9 AM): Class startup, computer labs boot
- Afternoon peak (~3 PM): Afternoon sessions, lab usage
Anomaly Detection & Equipment Status

Solar vs Grid Energy β Monthly (6-month bar chart):
- Grid (blue): Primary source, ~350β450 kWh/month
- Solar (orange): Renewable, ~100β150 kWh/month (23% coverage)
- 6-Month Solar Generation: 811 kWh total
COβ Footprint Trend (area chart):
- Total COβ: 2,238 kg (6-month period)
- vs Last Year: -12% improvement (sustainability effort tracking)
Anomaly Detection β LAG Window Analysis (table):
Using SQL LAG() to compare each reading against previous reading for same meter:
- M-4 (03:00): 8.7 kWh β 9.2 kWh (+3.6 delta) β π΄ SPIKE DETECTED
- M-14 (12:00): 9.5 kWh β 9.5 kWh (+5.6 delta) β π΄ SPIKE DETECTED
- M-9 (16:00): 9.5 kWh β 9.5 kWh (+4.2 delta) β π΄ SPIKE DETECTED
- Other readings: Normal status (grey)
Equipment Status & Asset Registry (donut + bar):
- Active: 65 devices (green)
- Inactive: 27 devices (grey)
- Under Repair: 18 devices (red) Equipment types breakdown by count.
6 Campus Buildings (each card shows floors, rooms, build year, utilization bar):
- PI Block (Admin+Research): 3 floors, 4 rooms, 2019, 68% util
- E Block (Academic): 5 floors, 16 rooms, 2020, 91% util β HIGHEST π΄
- M Block (Sports): 2 floors, 42% util
- B Block (Boys Hostel): 4 floors, 78% util
- G Block (Girls Hostel): 4 floors, 74% util
- H Block (Gym+Canteen): 2 floors, 55% util
Room Type Distribution:
- 6 Computer Labs
- 6 Classrooms
- 3 ECE Labs
- 3 Seminar Halls Total: 16 monitored rooms
Room Capacity Overview (bars):
- Total Seats: 1,860 across campus
- Average: 116 seats/room
- Largest Room: 240 seats (Seminar Hall)
Equipment Analytics & IoT Network

Equipment Analytics (ASSET REGISTRY): Horizontal bar by count + installed power capacity breakdown:
- Air Conditioners: 42.0 kW
- GPU Servers: 24.0 kW
- Solar Inverters: 75.0 kW
- Projectors: 5.0 kW
- Desktop PCs: 6.3 kW
- Other: Additional infrastructure Total Installed Capacity: 165 kW
Smart Sensors Network (4 KPI cards):
- 27 Energy Meters (Electricity, Solar, Water, Gas monitoring)
- 16 Access Readers (RFID + Biometric + PIN multi-factor auth)
- 12 HVAC Sensors (Temperature + Humidity control)
- 24 IP Cameras (24Γ7 surveillance, all green online status)
Status KPI Cards (from BOOKING table GROUP BY status):
- Approved: 7 bookings β
- Pending: 1 booking β³
- Cancelled: 1 booking β
- Rejected: 1 booking β
- Completed: 2 bookings βοΈ
Monthly Booking Trend (6-month grouped bar chart): Approval patterns across 6 months:
- Green (Approved) dominates
- Amber (Pending) small bars
- Red (Rejected) minimal
- Grey (Cancelled) rare Shows consistent ~75% approval rate.
Room Booking Status PIVOT Table (tagged "SLICE & DICE"): SQL PIVOT cross-tabulation (rooms Γ status):
- Seminar Hall: 12 total, 57% util
- C101: 8 total, 62% util (highest)
- L301: 10 total, 49% util
- C202: 7 total, 44% util
- L201: 9 total, 64% util
- L101: 5 total, 36% util
Booking Split (donut): 75% approval rate
Peak Booking Hours (bar chart): Shows demand by hour across day (peak during 10 AMβ1 PM lecture hours).
Booking Registry (ALL RECORDS table, 200+ rows): Every booking with:
- Date: Apr 7β11 visible
- Time: 08:00β09:00, 09:00β10:00, etc.
- Room: C101, C201, L201, Seminar Hall, C202, L101, Mini, C104
- Department: CSE, ECE, DSAI
- Booked By: Dr Rao, Dr Sharma, Dr Mehta, Arjun Kumar, Priya Singh, Rahul Pathi, Gopal Gupta, Neha Verma
- Purpose: DBMS Lecture, Signals Class, ML Lab, Project Review, DSA Lecture, ECE Lab Practice, Seminar Presentation, Group Study, Workshop, Morning Briefing, Data Science Lab, Hackathon Prep
- Status Badge: Color-coded (Green=Approved, Amber=Pending, Red=Rejected, Grey=Cancelled, Blue=Completed)
Maintenance Dashboard & SLA Analytics

Status KPI Cards:
- Open: 3 unresolved tickets
- In Progress: 5 being worked on
- Resolved: 2 fixed
- Total: 10 tickets
Mean Time To Resolve (MTTR) β SLA Performance (bars per priority):
Computed using AVG(DATEDIFF(hour, raised_at, resolved_at)) per priority tier:
- Critical: 8.4h avg
β οΈ (target 4h, 4.4h over) - High: 18.2h avg
β οΈ (target 10h, 8.2h over) - Medium: 36.8h avg
β οΈ (target 24h, 12.8h over) - Low: 72.1h avg
β οΈ (target 48h, 24.1h over)
Ticket Aging Analysis (bar chart):
- 0β7 days (green): Few tickets
- 8β14 days (amber): Some aging
- 15β30 days (orange): Moderate aging
- >30 days (red): Critical aging, largest bar
Maintenance Ticket Queue & Priority

Maintenance Ticket Queue (LIVE QUEUE tag): Open/in-progress tickets as color-coded cards:
- GPU Server overheating in L301 (Critical, In Progress) π΄
- Lights flickering in classroom (Critical, Open) π΄
- Water leakage near server rack in L303 (Critical, In Progress) π΄
Priority Distribution (bar chart):
- Critical: 3 tickets π΄
- High: 4 tickets π
- Medium: 2 tickets π‘
- Low: 1 ticket π’
SLA Compliance (gauge): 20% (only 2 of 10 tickets resolved within SLA window)
Hotspot Rooms (list): Preventive maintenance priority:
- Seminar Hall: 2 tickets
- L101: 2 tickets
- L301: 1 ticket
- C202: 1 ticket
- L303: 1 ticket
KPI Cards:
- Total Entries: 8 logged access attempts
- Unique Users: 7 distinct individuals
- Avg Duration: 103 minutes average stay
- After-Hours: 1 flagged entry
β οΈ
Security Risk Score (radial gauge, 87/100): Real-time assessment rewarding multi-factor auth, penalizing after-hours entries, flagging high-frequency sensitive room access.
Auth Methods Split (donut):
- RFID: 3 entries
- Biometric: 1 entry
- PIN: 3 entries
- Manual: 1 entry
Most Accessed Rooms (list):
- L201: 4 entries (highest)
- C301: 1 entry
- L101: 1 entry
- C201: 1 entry
- C102: 1 entry
After-Hours Alerts:
- Ravi Desai late-night L201 entry flagged π¨
Access Log Entries (ANTI-SUIT TRACKING table): Each row: user, room, auth method, entry time, duration (minutes)
- Keya Reddy, L201, RFID, 12:31, 155 min
- Ankur Shah, L201, Biometric, 12:45, 173 min
- Priyanka K., L201, PIN, 16:43, 84 min
- Anand Reddy, C301, RFID, 10:31, 71 min
- Madhav Nair, L101, Manual, 13:31, 84 min
- Ashok Shah, C201, PIN, 12:45, 88 min
- Ravi Desai, C102, RFID, 22:21, 88 min π¨
- Panya Desai, L201, PIN, 10:43, 172 min
Peak Access Times (bar chart): 12h noon highlighted orange (high-risk simultaneous-access hour, multiple users entering at once). Other hours blue (normal).
Role Distribution KPIs:
- Students: 76 (70%) π¨βπ
- Faculty: 15 (14%) π¨βπ«
- Staff: 15 (14%) π·
- Admins: 3 (3%) π¨βπΌ Total: 109 users
Department-wise Activity (grouped bar chart, OLAP DRILL-DOWN): Comparing bookings, logins, access events across 3 departments via JOIN:
- CSE: ~45 bookings, ~60 logins, ~75 access events
- ECE: ~35 bookings, ~50 logins, ~60 access events
- DSAI: ~30 bookings, ~40 logins, ~50 access events
User Engagement Quadrant (scatter plot): x-axis = bookings, y-axis = access events
- Faculty cluster (top-right): High booking, high access
- Students (spread): Wide variance in engagement
- Staff (left): Typically low-booking, high-access
User Role Distribution (donut): Proportional arcs for all 4 roles.
Most Active Users Leaderboard (ACTIVITY RANKING): Composite score = 0.4Γbookings + 0.3Γaccess + 0.3Γenergy_rank
- Dr Rao (Faculty, CSE): 12 bookings, 8 access, score 94 π₯
- Dr Sharma (ECE): 10 bookings, 7 access, score 88 π₯
- Dr Mehta (DSAI): 9 bookings, 6 access, score 84 π₯
- Gopal Gupta (Student, DSAI): 5 bookings, 4 access, score 62
- Keya Reddy (Student, CSE): 4 bookings, 9 access, score 71
- Ankur Shah (Student, CSE): 4 bookings, 9 access, score 71
- Arjun Kumar (Student, CSE): 4 bookings, 3 access, score 58
- Ashok Shah (Staff): 3 bookings, 10 access, score 65
Data Warehouse KPI Cards:
- Fact Rows: 515 rows loaded into star schema
- Dim Rows: 47 dimension records (date, room, meter aggregations)
- ETL Runs: 9 successful since Jan 2025
- Data Quality: 97.7% (rows passing IQR filter)
ETL Pipeline β OLTP β Data Warehouse (5-step flow):
- OLTP Source β Extract new ENERGY_READING rows via watermark
- Watermark Check β Avoids duplicates (tracks max date)
- IQR Cleaning β Q1β1.5ΓIQR to Q3+1.5ΓIQR (removes sensor errors)
- Transform β Surrogate key mapping (room/meter β dim keys)
- Warehouse Load β Bulk append to fact_energy_consumption
ETL Run History (AUDIT LOG):
- ETL-009: 148 extracted, 141 loaded, 14.2s, β Success
- ETL-008: 132 extracted, 128 loaded, 12.8s, β Success
- ETL-007: 156 extracted, 149 loaded, 15.1s, β Success
- ETL-006: 121 extracted, 118 loaded, 11.8s, β Success
- ETL-005: 0 extracted, 0 loaded, 2.1s, β "No New Data" (watermark matched)
- ETL-004: 163 extracted, 0 loaded, 18.9s, β "Failed" (IQR rejected all rows as outliers)
- ETL-003: 144 extracted, 138 loaded, 13.9s, β Success
Star Schema Diagram (DATA WAREHOUSE DESIGN):
-
Central Fact Table:
fact_energy_consumption(515 rows)- Measures: kwh_consumed, peak_flag, avg_voltage
- Foreign keys to 4 dimensions
-
Dimension Tables:
dim_date: 365 rows (full 2025 calendar)dim_room: 16 rows (all monitored spaces)dim_meter: 27 rows (all energy sensors)- Snowflake extension:
dim_building,dim_department(hierarchical normalization)
OLAP Operations Explorer (5 interactive tabs):
Tab 1: Roll-Up
SELECT YEAR(full_date), QUARTER(full_date), MONTH(full_date), SUM(kwh_consumed)
FROM fact_energy_consumption
GROUP BY GROUPING SETS (YEAR(full_date), ...)Results:
- 2025-Mar: 524.8 kWh
- 2025 Total: 1,006.2 kWh
- Grand Total: 1,006.2 kWh
Tab 2: Drill-Down Campus β Building β Floor β Room level analytics
Tab 3: Slice Filter year = 2025, show all rooms and meters
Tab 4: Dice Multi-dimensional filter (Q1 2025 + Computer Labs + Electricity meters simultaneously)
Tab 5: Pivot Buildings as columns, months as rows, kWh as values
Real-time data entry console with 28-second auto-refresh countdown and green "Live" indicator.
4 Real-Time Forms (each executes direct SQL INSERT via FastAPI):
Form 1: Log Energy Reading
- Meter dropdown (from ENERGY_METER)
- kWh Consumed (numeric, e.g., 4.75)
- Voltage (V) (pre-filled 230VβIndian standard)
- Peak Hour (Yes/No toggle β peak_flag BIT)
- Button: "Insert Reading β SQL Server"
Form 2: Create Room Booking
- User dropdown
- Room dropdown
- Start Time (datetime picker)
- End Time (datetime picker)
- Purpose (free text)
- Conflict detection via stored procedure
usp_AddBooking - Button: "Submit Booking β SQL Server"
Form 3: Raise Maintenance Ticket
- Room dropdown (FK, NOT NULL β weak entity constraint)
- Reported By dropdown (USERS)
- Priority (Critical/High/Medium/Low)
- Description (free text)
- Button: "Create Ticket β SQL Server"
Form 4: Log Access Event
- User dropdown
- Room dropdown
- Auth Method (RFID/Biometric/PIN/Manual)
- Auto-detected after-hours flag if entry_time > 22:00
- Button: "Log Access β SQL Server"
Bonus: Trigger ETL Pipeline
- Green "Run ETL Now" button
- Executes Python script: watermark β extract β clean β transform β load
- Updates Data Warehouse tab with new run
| Metric | OLTP (SmartCampusDB) | OLAP (Warehouse) |
|---|---|---|
| Query Type | Short INSERT/UPDATE/SELECT | Complex aggregations |
| Schema | Normalized 3NF/BCNF | Star / Snowflake (denorm) |
| Data Volume | Current days/weeks | Historical months/years |
| Concurrent Users | Many (100s) | Few analysts |
| Update Frequency | Continuous real-time | Nightly ETL batch |
| Response Time | Milliseconds | Seconds to minutes |
| Optimization | Write-optimized | Read-optimized (indexes) |
| Example Query | INSERT INTO BOOKING ... |
GROUP BY GROUPING SETS ... |
Snowflake Extension β Normalized Dimensions:
dim_roomreferencesdim_building(1:M)dim_buildingreferencesdim_department(1:M)- Drill-down hierarchy: Campus β Dept β Building β Floor β Room
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SMART CAMPUS ANALYTICS SYSTEM β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β REACT VITE FRONTEND (Port 3000) β β
β β 9 Dashboard Pages (Overview, Energy, Infrastructure, β β
β β Bookings, Maintenance, Access, Analytics, DW, Ops) β β
β β Real-time KPI cards β’ Interactive charts β’ Forms β β
β β 28-second auto-refresh via JWT-authenticated API β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β JWT Auth (HS256) β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β FASTAPI BACKEND (Port 8000) β β
β β REST Endpoints β’ CRUD operations on 12 OLTP tables β β
β β OLAP warehouse queries (Star + Snowflake) β β
β β Role-based access control (Admin/Viewer) β β
β β ETL pipeline trigger endpoint β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β SQL Server Driver (pyodbc) β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β SQL SERVER 2022 (OLTP + OLAP) β β
β β β β
β β ββββββββββββββββββββββββ ββββββββββββββββββββββββββββ β β
β β β OLTP Database β β OLAP Data Warehouse β β β
β β β (12 BCNF Tables) β β (Star + Snowflake) β β β
β β β β β β β β
β β β Live Transactions: β β Dimension Tables (47): β β β
β β β β’ DEPARTMENT β β β’ dim_date (365 rows) β β β
β β β β’ BUILDING, FLOOR β β β’ dim_room (16 rows) β β β
β β β β’ ROOM (16) β β β’ dim_meter (27 rows) β β β
β β β β’ ENERGY_METER β β β’ dim_building β β β
β β β β’ ENERGY_READING β β β’ dim_department β β β
β β β β’ USERS (109) β β β β β
β β β β’ BOOKING (200+) β β Fact Table: β β β
β β β β’ MAINTENANCE β β β’ fact_energy_consump. β β β
β β β β’ ACCESS_LOG β β (515 rows, 97.7% QA) β β β
β β β β’ AUDIT_TRAIL β β β β β
β β β β β OLAP Operations: β β β
β β β Constraints: β β β’ Roll-up, Drill-down β β β
β β β β’ 26 Foreign Keys β β β’ Slice, Dice, Pivot β β β
β β β β’ 5 CHECK β β β’ GROUP BY ROLLUP β β β
β β β β’ Indexes: β β β β β
β β β (meter_id, ts) β β 5 Composite Indexes β β β
β β β (room_id, time) β β Clustered on PKs β β β
β β β β’ 3 Triggers β β β β β
β β β β’ 2 Stored Procs β β β β β
β β β β β β β β
β β β ACID Properties: β β β β β
β β β β’ Isolation Lvls β β β β β
β β β β’ 2PL Locking β β β β β
β β β β’ Deadlock Handling β β β β β
β β ββββββββββββββββββββββββ ββββββββββββββββββββββββββββ β β
β β β β
β β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β
β β β Python ETL Pipeline (Incremental Load) β β β
β β β β’ Watermark-based extraction (avoids duplicates) β β β
β β β β’ IQR outlier detection & cleaning β β β
β β β β’ Surrogate key mapping (room/meter β dims) β β β
β β β β’ Bulk append to star schema β β β
β β β β’ Audit trail: 9 successful runs (Jan 2025) β β β
β β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Component | Technology | Purpose |
|---|---|---|
| Frontend | React 18 + Vite + Tailwind CSS | Real-time dashboard (9 pages, 28-sec refresh) |
| Backend | FastAPI (Python) | REST API (port 8000), JWT auth, CRUD endpoints |
| Database | SQL Server 2022 | OLTP (12 tables, BCNF) + OLAP (Star/Snowflake) |
| ETL | Python + Pandas + SQLAlchemy | Incremental load, IQR cleaning, surrogate mapping |
| Auth | JWT HS256 | Role-based access control (Admin/Viewer) |
| Visualization | Recharts, Chart.js | KPI cards, area/bar/heatmap/donut charts |
| Version Control | Git + GitHub | Repository, CI/CD ready |
| KPI | Value | Source |
|---|---|---|
| Total Energy | 87.3 MWh | SUM(kwh_consumed) from ENERGY_READING |
| Campus Users | 109 | COUNT(*) from USERS |
| Active Rooms | 16 | COUNT(DISTINCT room_id) from ROOM |
| Total Bookings | 200+ | COUNT(*) from BOOKING |
| Open Tickets | 18 | COUNT(*) where status='Open' |
| Access Events | 208 | COUNT(*) from ACCESS_LOG |
| Active Equipment | 65 | Equipment status = 'Active' |
| Active Meters | 27 | Energy sensors online |
| Campus Health Score | 82/100 | Weighted: 40% Energy, 30% Maintenance, 30% Utilization |
| Booking Approval Rate | 75% | Approved / Total |
| SLA Compliance | 20% | Resolved within window / Total |
| Data Quality | 97.7% | Rows passing IQR filter / Total |
| ETL Success Rate | 89% | 8 of 9 runs successful |
- Entity classification (strong, weak, subtype, associative)
- All cardinality types (1:1, 1:N, M:N)
- Identifying vs non-identifying relationships
- Functional dependencies documented
- BCNF compliance proof across all 12 OLTP tables
- DDL (CREATE TABLE with constraints, ALTER TABLE)
- DML (INSERT, UPDATE, DELETE via stored procedures)
- Complex SELECT with JOINs, window functions (LAG), aggregations
- Stored procedures for business logic (
usp_AddBooking,usp_UpdateBookingStatus) - Triggers for audit trail and anomaly prevention
- Indexes for query optimization
- ACID properties demonstrated with live SQL Server demos
- Isolation levels: READ COMMITTED blocking scenario
- Deadlock construction and victim selection
- Two-Phase Locking (2PL) with HOLDLOCK/UPDLOCK hints
- Transaction log and durability verification
- Star Schema design (1 fact + 4 dimensions)
- Snowflake extension (normalized building & department sub-dims)
- OLAP operations (Roll-up, Drill-down, Slice, Dice, Pivot)
- Incremental ETL pipeline with watermark
- Data quality enforcement (IQR outlier detection)
- Surrogate key mapping and bulk load
- SQL Server 2022 (or Express Edition β FREE)
- Python 3.10+
- Node.js 18+
- Git
git clone https://github.com/Rakhal06/DBMS_SMART_CAMPUS_ANALYTICS_SYSTEM.git
cd DBMS_SMART_CAMPUS_ANALYTICS_SYSTEM# Open SQL Server Management Studio (SSMS)
CREATE DATABASE SmartCampusDB;
USE SmartCampusDB;
GO
# Execute database schema scripts
-- Run: database/DBMS.sql (12 OLTP tables)
-- Run: database/OLAP_warehouse.sql (6 warehouse tables)
-- Run: database/seed_data.sql (1000+ sample rows)cd backend
python -m venv venv
source venv/bin/activate # macOS/Linux: or venv\Scripts\activate on Windows
pip install -r requirements.txt
# Configure .env
SQLSERVER_SERVER=localhost\SQLEXPRESS
SQLSERVER_DATABASE=SmartCampusDB
SQLSERVER_USER=sa
SQLSERVER_PASSWORD=YourPassword
JWT_SECRET_KEY=your_secret_key
python main.py
# Backend on http://localhost:8000cd ../frontend
npm install
npm run dev
# Frontend on http://localhost:5173- Demo Credentials:
- Username:
rakhal| Password:password123 - Or:
student1|password123
- Username:
1. Production-Ready Database Design
- 12 normalized OLTP tables (BCNF compliance)
- Zero anomalies (insertion, update, deletion)
- Scalable to thousands of records
2. Advanced SQL Expertise
- Window functions (LAG for anomaly detection)
- PIVOT cross-tabulation
- Composite indexes for performance
- Stored procedures with transaction control
3. Full-Stack Architecture
- Separation of concerns (Frontend / Backend / Database)
- REST API with JWT authentication
- Role-based access control
- CORS-enabled cross-origin requests
4. Data Warehouse Mastery
- Star + Snowflake schema design
- Incremental ETL with data quality
- OLAP operations on real data
- 515+ fact rows, 97.7% data quality
5. Real-Time Dashboarding
- 9 comprehensive dashboard pages
- 28-second auto-refresh
- Interactive charts (Recharts, Chart.js)
- KPI cards with color-coded status
- Live data entry with conflict detection
6. System Design & Problem-Solving
- End-to-end data flow (OLTP β ETL β OLAP β Dashboard)
- Anomaly detection using IQR statistical method
- SLA tracking and compliance analysis
- Security scoring with multi-factor auth
DBMS_SMART_CAMPUS_ANALYTICS_SYSTEM/
βββ README.md # This file
βββ LICENSE # MIT License
β
βββ assets/
β βββ images/ # 18 dashboard screenshots
β βββ hero-banner.png
β βββ overview-dashboard.png
β βββ energy-analysis-dashboard.png
β βββ energy-analysis-building-breakdown.png
β βββ energy-anomaly-detection.png
β βββ infrastructure-campus-buildings.png
β βββ equipment-iot-network-summary.png
β βββ room-bookings-dashboard.png
β βββ room-booking-registry.png
β βββ maintenance-dashboard-overview.png
β βββ maintenance-ticket-queue-priority.png
β βββ access-security-dashboard.png
β βββ user-analytics-dashboard.png
β βββ etl-pipeline-monitor.png
β βββ star-schema-olap-explorer.png
β βββ oltp-olap-comparison.png
β βββ live-operations-center.png
β
βββ database/
β βββ DBMS.sql # 12 OLTP tables (BCNF)
β βββ OLAP_warehouse.sql # 6 warehouse tables
β βββ seed_data.sql # 1000+ sample rows
β βββ transactions_demo.sql # ACID, deadlock, 2PL demos
β βββ OLAP_queries.sql # Roll-up, Drill-down, etc.
β βββ indexes_performance.sql # Composite indexes
β βββ etl_pipeline.py # Python ETL script
β
βββ backend/
β βββ main.py # FastAPI entry point
β βββ requirements.txt # Python dependencies
β βββ database.py # SQL Server connection
β βββ models.py # Pydantic schemas
β βββ auth.py # JWT authentication
β βββ routes/
β βββ energy.py
β βββ bookings.py
β βββ maintenance.py
β βββ access.py
β βββ analytics.py
β βββ auth.py
β
βββ frontend/
β βββ package.json
β βββ vite.config.js
β βββ index.html
β βββ src/
β βββ App.jsx
β βββ api.js
β βββ pages/
β β βββ Overview.jsx
β β βββ EnergyAnalysis.jsx
β β βββ Infrastructure.jsx
β β βββ RoomBookings.jsx
β β βββ Maintenance.jsx
β β βββ AccessSecurity.jsx
β β βββ UserAnalytics.jsx
β β βββ DataWarehouse.jsx
β β βββ LiveOperations.jsx
β βββ components/
β β βββ KPICard.jsx
β β βββ Chart.jsx
β β βββ Table.jsx
β βββ index.css
β
βββ docs/
βββ ARCHITECTURE.md
βββ DATABASE_DESIGN.md
βββ INSTALLATION_GUIDE.md
- GitHub: https://github.com/Rakhal06/DBMS_SMART_CAMPUS_ANALYTICS_SYSTEM
- LinkedIn: www.linkedin.com/in/b-rakhal-krishna-71b10b368
- Email: b.rakhalkrishna06@gmail.com
For questions about the project:
- π§ Email: rakhal.krishna@iiitdh.ac.in
- πΌ LinkedIn: www.linkedin.com/in/b-rakhal-krishna-71b10b368
This project is licensed under the MIT License β see LICENSE file for details.
- Microsoft SQL Server: Database platform
- FastAPI & React: Open-source frameworks
- Python Community: pandas, SQLAlchemy, pyodbc libraries
Made with β€οΈ for Database Excellence
β If you found this project helpful, please consider starring the repository!
View on GitHub β’ Report Issue β’ Contact Me
Last Updated: January 2025 | Version: 1.0.0 | Status: Production Ready β










