Skip to content

Avijit0001/RuetFAQunofficial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

RUET Intelligent FAQ Assistant

An AI-powered chatbot for answering questions about Rajshahi University of Engineering & Technology (RUET) in real-time using Google Gemini LLM.

RUET Logo Python FastAPI License

📋 Table of Contents

🎯 Overview

The RUET Intelligent FAQ Assistant is a comprehensive web application designed to provide instant, accurate answers about Rajshahi University of Engineering & Technology. The system uses Google's Gemini AI to understand natural language queries and provide contextual responses about:

  • 🎓 Academic programs and departments
  • 📝 Admission procedures and requirements
  • 🏛️ Campus facilities and services
  • 📍 Location and transportation information
  • 🔬 Research and innovation initiatives
  • 📞 Contact information and important links

✨ Features

Frontend Features

  • Modern Academic UI: Professional, formal design with RUET branding
  • Real-time Chat Interface: Smooth, responsive chat experience
  • Quick Questions: Pre-defined questions for common queries
  • Conversation History: Download chat transcripts
  • Responsive Design: Works seamlessly on desktop, tablet, and mobile
  • Accessibility: WCAG compliant with proper semantic HTML
  • Dark Mode Ready: Easy to extend with dark theme support

Backend Features

  • AI-Powered Responses: Google Gemini integration for intelligent answers
  • Context-Aware: Maintains conversation history for better responses
  • RESTful API: Clean, well-documented API endpoints
  • CORS Support: Configured for cross-origin requests
  • Error Handling: Comprehensive error handling and logging
  • Scalable Architecture: Built with FastAPI for high performance

🛠️ Technology Stack

Frontend

  • HTML5: Semantic markup with SEO optimization
  • CSS3: Modern styling with CSS variables and animations
  • JavaScript (ES6+): Vanilla JS for interactivity
  • Font Awesome: Icon library
  • Google Fonts: Inter & Playfair Display

Backend

  • Python 3.8+: Core programming language
  • FastAPI: Modern web framework for building APIs
  • Google Gemini AI: Large Language Model for Q&A
  • Uvicorn: ASGI server
  • Pydantic: Data validation
  • HTTPX: Async HTTP client
  • BeautifulSoup4: Web scraping (for future enhancements)

📁 Project Structure

ruetweb/
├── front/                      # Frontend application
│   ├── index.html             # Main HTML file
│   ├── style.css              # Stylesheet
│   └── script.js              # JavaScript logic
│
├── back/                       # Backend application
│   ├── main.py                # FastAPI application
│   ├── requirements.txt       # Python dependencies
│   ├── .gitignore            # Git ignore file
│   └── README.md             # This file
│
└── README.md                  # Project documentation

🚀 Installation

Prerequisites

  • Python 3.8 or higher
  • pip (Python package manager)
  • A modern web browser (Chrome, Firefox, Safari, Edge)
  • Google Gemini API Key (Get one here)

Step 1: Clone or Navigate to Project

cd c:\ruetweb

Step 2: Backend Setup

# Navigate to backend directory
cd back

# Install Python dependencies
pip install -r requirements.txt

Step 3: Configure API Key

Open back/main.py and replace the placeholder API key:

GEMINI_API_KEY = "your-actual-gemini-api-key-here"

Important: Replace "api-key-here" with your actual Google Gemini API key.

Step 4: Run Backend Server

# From the back directory
python main.py

The backend server will start at http://localhost:8000

Step 5: Run Frontend

Open front/index.html in your web browser, or use a local server:

# Option 1: Using Python's built-in server
cd front
python -m http.server 3000

# Option 2: Using Node.js http-server (if installed)
cd front
npx http-server -p 3000

Then open http://localhost:3000 in your browser.

⚙️ Configuration

Backend Configuration

Edit back/main.py to customize:

# API Configuration
GEMINI_API_KEY = "your-api-key"  # Your Gemini API key

# CORS Configuration
allow_origins=["*"]  # In production, specify your frontend URL

Frontend Configuration

Edit front/script.js to customize:

// API Configuration
const API_BASE_URL = 'http://localhost:8000';  // Backend URL
const MAX_MESSAGE_LENGTH = 500;  // Maximum message length

📖 Usage

Starting the Application

  1. Start the backend server:

    cd back
    python main.py
  2. Open the frontend:

    • Open front/index.html in your browser, or
    • Use a local server as described in installation
  3. Start chatting:

    • Type your question in the input field
    • Click "Send" or press Enter
    • Use quick questions for common queries

Example Questions

  • "What is RUET and when was it established?"
  • "What are the admission requirements?"
  • "Tell me about the Computer Science department"
  • "How can I reach RUET from Dhaka?"
  • "What facilities are available on campus?"
  • "What is the vision and mission of RUET?"

📚 API Documentation

Base URL

http://localhost:8000

Endpoints

1. Health Check

GET /api/health

Response:

{
  "status": "healthy",
  "service": "RUET FAQ Assistant"
}

2. Chat Endpoint

POST /api/chat

Request Body:

{
  "message": "What is RUET?",
  "conversation_history": [
    {
      "role": "user",
      "content": "Previous message",
      "timestamp": "2026-01-04T14:00:00Z"
    }
  ]
}

Response:

{
  "response": "RUET is the 2nd oldest prestigious public Engineering University...",
  "sources": [
    "https://www.ruet.ac.bd/",
    "https://admission.ruet.ac.bd"
  ]
}

3. Feedback Endpoint

POST /api/feedback

Request Body:

{
  "rating": 5,
  "comment": "Very helpful!",
  "conversation_id": "optional-id"
}

Interactive API Documentation

Once the backend is running, visit:

  • Swagger UI: http://localhost:8000/docs
  • ReDoc: http://localhost:8000/redoc

🖼️ Screenshots

Desktop View

The application features a three-column layout:

  • Left sidebar: Quick questions
  • Center: Chat interface
  • Right sidebar: Important links and information

Mobile View

Responsive design that adapts to smaller screens with a single-column layout.

🎨 Customization

Changing Colors

Edit front/style.css CSS variables:

:root {
    --primary-navy: #1a2332;
    --primary-blue: #2c5282;
    --accent-blue: #3182ce;
    /* Add your custom colors */
}

Adding More Quick Questions

Edit front/index.html:

<button class="quick-question-btn" data-question="Your question here">
    <i class="fas fa-question-circle"></i>
    <span>Button Label</span>
</button>

Extending RUET Context

Edit back/main.py to add more information to RUET_CONTEXT.

📝 Future Enhancements

  • Real-time web scraping for latest RUET updates
  • Multi-language support (Bengali + English)
  • Voice input/output capabilities
  • User authentication and personalized responses
  • Analytics dashboard for common queries
  • Integration with RUET's official API (if available)
  • Progressive Web App (PWA) support
  • Dark mode toggle
  • Chat export in multiple formats (PDF, JSON)

🙏 Acknowledgments

  • Rajshahi University of Engineering & Technology (RUET)
  • Google Gemini AI Team
  • FastAPI Framework
  • The open-source community

Powered by Avijit0001 🤖

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors