Files
unai/docs/FILE_CLEANUP_PLAN.md
T
Krikorios aa459f4bd6 🎉 Complete AI-Enhanced University Portal - Ready for Production
 Major Features Added:
- AI Chat with conversation memory and university-specific knowledge base
- Multi-tenant university support with white-label capabilities
- Professional admin interface for knowledge base management
- Advanced database schema with Prisma ORM
- Comprehensive documentation and guides
- Modern Next.js 15 + React 19 architecture
- Bilingual support (English/Arabic)
- Role-based access control
- Real-time chat interface with loading states

🔧 Technical Improvements:
- Fixed all linter errors and TypeScript issues
- Cleaned up codebase and removed legacy files
- Added comprehensive .gitignore
- Updated README with detailed setup instructions
- Optimized database schema and migrations
- Enhanced error handling and user experience

📚 Documentation:
- AI Conversation Memory Guide
- AI Enhancement Summary
- Developer Guide
- User Guide
- Complete setup and deployment instructions

🚀 Ready for GitHub deployment and production use!
2025-07-20 08:26:25 +04:00

12 KiB

File Cleanup Plan - White-Label Transformation

📋 Overview

This document outlines the comprehensive file cleanup and reorganization required to transform the UTAS-specific portal into a white-label university platform.

Total Files to Process: 150+ files
Estimated Cleanup Time: 2-3 weeks
Priority: High (Foundation for white-labeling)


🗑️ Files to Remove (UTAS-Specific)

High Priority - Remove Immediately

1. UTAS-Specific Pages

❌ src/app/page-enhanced-utas-oman.tsx
   - UTAS Oman specific homepage
   - Contains hardcoded UTAS branding
   - 660 lines of UTAS-specific content
   
❌ src/app/page-enhanced.tsx
   - UTAS-specific enhanced homepage
   - Contains UTAS branding and content
   - 500+ lines of UTAS-specific code

2. UTAS-Specific Data Files

❌ src/lib/utasKnowledgeBase.ts
   - Hardcoded UTAS knowledge base
   - 979 lines of UTAS-specific data
   - Contains UTAS programs, rankings, achievements
   
❌ src/lib/mockData.ts
   - UTAS-specific mock data
   - Contains UTAS courses, scholarships, news
   - 700+ lines of UTAS-specific content

3. Marketing Materials

❌ AI_Enhanced_UTAS_Portal_Presentation.pptx
   - UTAS-specific marketing presentation
   - Not needed for white-label platform

Medium Priority - Archive

4. Documentation Files (Move to docs/)

📁 docs/archive/
├── CHATBOT_SYSTEM_DOC.md (Move from root)
├── GITHUB-SETUP.md (Move from root)
├── NAVIGATION-TEST.md (Move from root)
└── TEST-USERS.md (Move from root)

🔄 Files to Refactor (Remove UTAS References)

High Priority - Core Components

1. Layout & Navigation

🔄 src/app/layout.tsx
   - Remove UTAS-specific metadata
   - Update title and description
   - Make branding dynamic
   
🔄 src/components/Navigation/MainNavigation.tsx
   - Remove hardcoded UTAS navigation items
   - Make navigation dynamic based on university config
   - Update 421 lines of UTAS-specific content
   
🔄 src/components/Navigation/SimplifiedNavigation.tsx
   - Remove UTAS branding
   - Make navigation items configurable

2. Homepage

🔄 src/app/page.tsx
   - Remove UTAS-specific content (651 lines)
   - Remove hardcoded programs and statistics
   - Remove UTAS-specific hero slides
   - Make content dynamic based on university config

3. Chatbot System

🔄 src/lib/chatbot.ts
   - Remove UTAS-specific system prompts
   - Remove hardcoded UTAS knowledge base references
   - Make chatbot context dynamic
   - Update 297 lines of UTAS-specific code
   
🔄 src/app/api/chat/route.ts
   - Remove UTAS-specific error messages
   - Make responses university-agnostic

4. Language Provider

🔄 src/components/providers/LanguageProvider.tsx
   - Remove UTAS-specific translations
   - Make translations university-agnostic
   - Update 434 lines of UTAS-specific content

Medium Priority - Pages & Components

5. University Pages

🔄 src/app/about/page.tsx
🔄 src/app/courses/page.tsx
🔄 src/app/programs/page.tsx
🔄 src/app/admissions/page.tsx
🔄 src/app/research/page.tsx
🔄 src/app/campus/page.tsx
🔄 src/app/contact/page.tsx
🔄 src/app/rankings/page.tsx
🔄 src/app/scholarships/page.tsx
🔄 src/app/events/page.tsx
🔄 src/app/news/page.tsx
   - Remove UTAS-specific content from all pages
   - Make content dynamic based on university config
   - Update contact information
   - Update programs and courses

6. Program-Specific Pages

🔄 src/app/programs/undergraduate/bachelor-applied-biotechnology/page.tsx
🔄 src/app/programs/undergraduate/bachelor-web-mobile/page.tsx
🔄 src/app/programs/postgraduate/mba-leadership-innovation/page.tsx
🔄 src/app/programs/postgraduate/mtech-mineral-processing/page.tsx
   - Remove UTAS-specific program details
   - Make program content dynamic
   - Update program requirements and fees

7. Research Pages

🔄 src/app/research/marine-antarctic/page.tsx
   - Remove UTAS-specific research content
   - Make research areas configurable

Low Priority - Configuration Files

8. Configuration Files

🔄 package.json
   - Update project name and description
   - Remove UTAS-specific references
   
🔄 README.md
   - Remove UTAS-specific documentation
   - Update for white-label platform
   
🔄 tailwind.config.ts
   - Remove UTAS-specific colors
   - Make color scheme configurable

📁 Files to Create (New Structure)

High Priority - Configuration System

1. Configuration Interfaces

✅ src/config/
├── university.ts
│   - University configuration interface
│   - Branding, contact, features config
│   - 100+ lines of configuration types
│
├── branding.ts
│   - Branding configuration interface
│   - Colors, logos, fonts, contact info
│   - 50+ lines of branding types
│
├── features.ts
│   - Feature flags and configuration
│   - Enable/disable features per university
│   - 30+ lines of feature types
│
└── ai.ts
    - AI configuration interface
    - Chatbot settings and knowledge base
    - 40+ lines of AI configuration types

2. Database Schema

✅ prisma/
├── schema.prisma (Update existing)
│   - Add university tables
│   - Add academic programs table
│   - Add university content table
│   - Add AI knowledge base table
│
├── migrations/ (New directory)
│   - Database migration files
│   - University table migrations
│
└── seeds/ (New directory)
│   - University-specific seed data
│   - Sample university configurations

3. Admin Interface

✅ src/app/admin/
├── layout.tsx
│   - Admin layout component
│   - Admin navigation and sidebar
│
├── page.tsx
│   - Admin dashboard overview
│   - University statistics and metrics
│
├── universities/
│   ├── page.tsx (University list)
│   ├── [id]/page.tsx (University details)
│   ├── create/page.tsx (Create university)
│   └── [id]/edit/page.tsx (Edit university)
│
├── content/
│   ├── page.tsx (Content management)
│   ├── programs/page.tsx (Program management)
│   ├── news/page.tsx (News management)
│   └── knowledge-base/page.tsx (AI knowledge base)
│
├── users/
│   ├── page.tsx (User management)
│   ├── roles/page.tsx (Role management)
│   └── permissions/page.tsx (Permission management)
│
└── analytics/
    ├── page.tsx (Analytics dashboard)
    ├── usage/page.tsx (Usage analytics)
    └── performance/page.tsx (Performance metrics)

Medium Priority - Utilities & Services

4. Utility Functions

✅ src/lib/
├── university.ts
│   - University utility functions
│   - University detection and configuration
│
├── content.ts
│   - Content management utilities
│   - Content validation and processing
│
├── ai-config.ts
│   - AI configuration utilities
│   - Dynamic AI system prompts
│
└── branding.ts
    - Branding utility functions
    - Dynamic color and style generation

5. API Routes

✅ src/app/api/
├── universities/
│   ├── route.ts (University CRUD)
│   ├── [id]/route.ts (University details)
│   └── [id]/config/route.ts (University config)
│
├── content/
│   ├── route.ts (Content CRUD)
│   ├── programs/route.ts (Program management)
│   └── knowledge-base/route.ts (AI knowledge base)
│
├── admin/
│   ├── route.ts (Admin authentication)
│   ├── analytics/route.ts (Analytics data)
│   └── users/route.ts (User management)
│
└── config/
    ├── branding/route.ts (Branding config)
    ├── features/route.ts (Feature config)
    └── ai/route.ts (AI config)

Low Priority - Documentation

6. Documentation Structure

✅ docs/
├── getting-started/
│   ├── quick-start.md
│   ├── university-setup.md
│   └── first-university.md
│
├── user-guides/
│   ├── admin-dashboard.md
│   ├── content-management.md
│   ├── user-management.md
│   └── analytics.md
│
├── features/
│   ├── ai-chatbot.md
│   ├── student-portal.md
│   ├── research-portal.md
│   └── international-students.md
│
├── api/
│   ├── authentication.md
│   ├── endpoints.md
│   └── webhooks.md
│
└── development/
    ├── setup.md
    ├── architecture.md
    ├── database.md
    └── deployment.md

🔧 Refactoring Strategy

Phase 1: Remove UTAS Files (Week 1)

  1. Day 1-2: Remove high-priority UTAS files

    • Delete page-enhanced-utas-oman.tsx
    • Delete page-enhanced.tsx
    • Delete utasKnowledgeBase.ts
    • Delete mockData.ts
    • Delete marketing materials
  2. Day 3-4: Archive documentation

    • Create docs/ directory
    • Move documentation files to docs/archive/
    • Update README.md
  3. Day 5: Update configuration files

    • Update package.json
    • Update README.md
    • Update tailwind.config.ts

Phase 2: Refactor Core Components (Week 2)

  1. Day 1-2: Layout and navigation

    • Refactor layout.tsx
    • Refactor MainNavigation.tsx
    • Refactor SimplifiedNavigation.tsx
  2. Day 3-4: Homepage and chatbot

    • Refactor page.tsx
    • Refactor chatbot.ts
    • Refactor chat API route
  3. Day 5: Language provider

    • Refactor LanguageProvider.tsx
    • Remove UTAS-specific translations

Phase 3: Refactor Pages (Week 3)

  1. Day 1-3: University pages

    • Refactor all university pages
    • Remove UTAS-specific content
    • Make content dynamic
  2. Day 4-5: Program pages

    • Refactor program-specific pages
    • Remove UTAS-specific programs
    • Make program content dynamic

Phase 4: Create New Structure (Week 4)

  1. Day 1-2: Configuration system

    • Create configuration interfaces
    • Create utility functions
    • Create API routes
  2. Day 3-4: Admin interface

    • Create admin layout
    • Create university management
    • Create content management
  3. Day 5: Documentation

    • Create documentation structure
    • Create user guides
    • Create API documentation

📊 File Statistics

Current State

  • Total Files: 150+
  • UTAS-Specific Files: 50+
  • Files to Remove: 15+
  • Files to Refactor: 35+
  • Files to Create: 40+

After Cleanup

  • Total Files: 180+
  • UTAS-Specific Files: 0
  • White-Label Files: 180+
  • Configuration Files: 20+
  • Admin Interface Files: 30+

Code Reduction

  • UTAS-Specific Code: ~5,000 lines removed
  • Hardcoded References: 200+ removed
  • Dynamic Code Added: ~3,000 lines
  • Net Code Change: -2,000 lines

Success Criteria

File Cleanup Success

  • Zero UTAS-specific files remain
  • Zero hardcoded UTAS references
  • All content is dynamic/configurable
  • New configuration system in place
  • Admin interface functional

Code Quality Success

  • No broken imports after cleanup
  • All components render correctly
  • All API routes work properly
  • Database schema updated
  • Tests pass after refactoring

Documentation Success

  • Documentation reorganized
  • New documentation structure created
  • User guides written
  • API documentation complete
  • Development guides ready

🚨 Risk Mitigation

High Risk Items

  1. Breaking Changes: Risk of breaking existing functionality

    • Mitigation: Comprehensive testing after each refactor
    • Mitigation: Incremental refactoring approach
  2. Data Loss: Risk of losing important code during cleanup

    • Mitigation: Git version control with branches
    • Mitigation: Backup of original files before deletion
  3. Import Errors: Risk of broken imports after file removal

    • Mitigation: Systematic import checking
    • Mitigation: Automated import fixing scripts

Medium Risk Items

  1. Performance Impact: Risk of performance degradation

    • Mitigation: Performance testing after refactoring
    • Mitigation: Optimization of new dynamic code
  2. User Experience: Risk of degraded UX during transition

    • Mitigation: Maintain functionality during refactoring
    • Mitigation: Gradual rollout of changes

Last Updated: January 2025
Next Review: After Phase 1 completion
Status: Planning Phase