Files
unai/README.md
T
2025-07-14 10:14:20 +04:00

176 lines
4.9 KiB
Markdown

# UTAS Oman University Portal
A modern, bilingual (Arabic/English) university portal for the University of Tasmania's campus in Muscat, Sultanate of Oman. Features an AI-powered chatbot using OpenRouter API for intelligent student assistance.
## 🌟 Features
### 🤖 AI-Powered Chatbot
- **Real AI**: Uses OpenRouter API with Meta LLaMA model or Ollama local models
- **Bilingual Support**: Automatically detects and responds in Arabic or English
- **UTAS Oman Context**: Specialized knowledge about campus, programs, and admissions
- **Personalized Responses**: Tailors answers based on user authentication and role
- **No Mock Data**: All responses generated by real AI
### 🎓 Academic Programs
- Comprehensive undergraduate and postgraduate program listings
- UTAS Oman-specific courses aligned with Oman Vision 2040
- Detailed program information, requirements, and career outcomes
- Search and filtering capabilities
### 🌐 Bilingual Interface
- Arabic and English language support
- Cultural appropriateness for Omani students
- RTL (Right-to-Left) text support for Arabic
### 📱 Modern Design
- Responsive design for all devices
- Clean, professional interface
- UTAS Oman branding and colors
- Accessibility features
## 🚀 Getting Started
### Prerequisites
- Node.js 18+
- OpenRouter API key
### Installation
1. **Clone the repository**
```bash
git clone <repository-url>
cd university-portal
```
2. **Install dependencies**
```bash
npm install
```
3. **Set up environment variables**
```bash
cp .env.example .env.local
```
Add your OpenRouter API key to `.env.local`:
```
OPENROUTER_API_KEY=your_openrouter_api_key_here
```
4. **Run the development server**
```bash
npm run dev
```
5. **Open your browser**
Navigate to [http://localhost:3000](http://localhost:3000)
## 🤖 Chatbot Setup
### Configuration
1. Create a `.env.local` file in the project root with the following variables:
```env
# OpenRouter API Key (for LLM access)
OPENROUTER_API_KEY=sk-your-key-here
# Ollama configuration (for local model fallback)
OLLAMA_URL=http://localhost:11434
MODEL_COMMAND_R7B=command-r7b-arabic
```
2. To use the Ollama fallback:
- Install Ollama from [https://ollama.ai/](https://ollama.ai/)
- Pull the Arabic-capable model: `ollama pull command-r7b-arabic`
- Start the Ollama server locally: `ollama serve`
3. The chatbot automatically:
- Tries OpenRouter first if API key is available
- Falls back to Ollama if OpenRouter key is missing
- Detects language (Arabic/English) and responds accordingly
- Personalizes responses based on user authentication status
### Testing the Chatbot
Run the built-in chatbot tests:
```bash
npm run test:chat
```
Or run the integration tests:
```bash
npm run test
```
### Personalization Features
The chatbot provides different responses based on authentication:
- **Anonymous Users**: Public information only (courses, admissions, etc.)
- **Authenticated Students**: Personalized responses with student profile data
- **Faculty/Staff**: More detailed institutional information
- **Administrators**: Full access to university systems information
## 🛠️ Technology Stack
- **Framework**: Next.js 14+ with React 19
- **Styling**: Tailwind CSS
- **TypeScript**: Full type safety
- **AI Integration**: OpenRouter API
- **Database**: Prisma (for future enhancements)
## 🎯 AI Chatbot Features
The AI chatbot is the centerpiece of this portal:
- **Language Detection**: Automatically detects Arabic or English input
- **Contextual Responses**: Uses UTAS Oman knowledge base for relevant information
- **OpenRouter Integration**: Powered by Meta LLaMA 3.1 8B model
- **Conversation Memory**: Maintains conversation history for context
- **Error Handling**: Graceful fallbacks when API is unavailable
### Testing the Chatbot
Try these sample queries:
**English:**
- "Tell me about MBA programs"
- "What are the admission requirements?"
- "How can I apply for scholarships?"
**Arabic:**
- "أخبرني عن برامج الماجستير"
- "ما هي متطلبات القبول؟"
- "كيف يمكنني التقدم للحصول على منح دراسية؟"
## 🏫 About UTAS Oman
This portal represents the University of Tasmania's campus in Muscat, Sultanate of Oman:
- **Location**: Knowledge Oasis Muscat
- **Programs**: Aligned with Oman Vision 2040
- **Quality**: Australian education standards
- **Local Relevance**: Designed for Omani students and industry needs
## 📞 Contact Information
- **Phone**: +968 2414 3555
- **Email**: admissions@utas.edu.om
- **Address**: Knowledge Oasis Muscat, Sultanate of Oman
## 🤝 Contributing
This is a demo project showcasing AI-enhanced university portal capabilities. For improvements or suggestions, please open an issue.
## 📄 License
This project is for demonstration purposes.
---
**Built with ❤️ for UTAS Oman students and the future of education in Oman.**