Skip to content
Campus-ResourceManagerPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Campus Resource Manager - Backend (The Intelligence Layer)

This is the backend server for the Campus Resource Management system, designed to handle hall bookings, faculty information, and user authentication for a university environment. This service handles priority logic, AI-driven forecasting, and automated reallocation.

🚀 Key Features

1. Priority-Based Booking & Conflict Resolution

  • User Authentication: Session-based authentication with MongoDB persistent store.
  • Priority Levels: Bookings categorized as Normal, High, or Critical.
  • Intelligent Overrides: Admin can approve "Critical" events by overriding existing "Normal" bookings.
  • Automated Displacement: Displaced bookings are automatically rejected with a notification, triggering the Reallocation Engine.

2. AI-Powered Demand Forecasting

Located in src/controllers/forecastingController.js:

  • Prophet ML (Facebook): Python script (predict_demand.py) predicts booking trends for the next 7 days based on 90-day history.
  • Statistical Fallback: Day-of-week weighted averaging ensures forecasting works even without Python.
  • Google Gemini AI Integration: (Requires GEMINI_API_KEY)
    • Optimization Recommendations: Qualitative analysis of resource usage.
    • Monopolization Alerts: Detects if a department is over-booking resources.
    • Space Efficiency Score: Matches intended attendees to actual room capacity (0-100 scale).

3. Smart Reallocation Engine

The "Self-Healing" logic found in src/services/reallocationEngine.js:

  • Weighted Scoring Algorithm (40/30/30):
    • 40% Capacity Fit: Minimizes wasted space by finding the closest capacity match.
    • 30% Floor Proximity: Suggests rooms near the original location (block/floor matching).
    • 30% Utilization Fairness: Prioritizes less-used rooms to distribute wear-and-tear.
  • Workflow: One-click reallocation suggestions on the Coordinator's dashboard.

4. Audit & Transparency

  • Audit Logs: Complete history of every creation, approval, and override.
  • Nodemailer Integration: Automated email notifications for status updates.

🛠️ Tech Stack

  • Runtime: Node.js
  • Framework: Express.js
  • Database: MongoDB with Mongoose ODM
  • Task Scheduling: Node-cron (Automated alerts)
  • Session Management: Express-session & Connect-mongo
  • CI/CD: GitHub Actions (backend-ci.yml)

⚙️ How it Works (The Flow)

  1. Request: A Coordinator submits a booking.
  2. Analysis: System checks for time overlaps (Booking.exists()).
  3. Approval: Admin reviews. If it's a priority override, the reallocationController is spawned.
  4. Insight: forecastingController periodicity runs the Prophet script via child_process.spawn.

⚙️ Setup & Installation

  1. Install dependencies:

    npm install
  2. Environment Configuration (.env):

    MONGO_URI=your_mongodb_uri
    PORT=8000
    AI_KEY=your_gemini_api_key (optional)
  3. Run the Server:

    npm run dev

👥 Authors

  • Aravind R K
  • Kanishka D
  • Sandheep G S
  • Radha Krishna
  • Sujith Kumar A

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages