🎉 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!
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
import { createDomainManager, validateDomainAccess } from '@/lib/domainManagement';
|
||||
|
||||
export async function POST(
|
||||
request: NextRequest,
|
||||
{ params }: { params: Promise<{ id: string }> }
|
||||
) {
|
||||
try {
|
||||
const { id } = await params;
|
||||
const universityId = request.headers.get('x-university-id');
|
||||
|
||||
if (!universityId) {
|
||||
return NextResponse.json(
|
||||
{ error: 'University context required' },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
|
||||
const hasAccess = await validateDomainAccess(request, id);
|
||||
if (!hasAccess) {
|
||||
return NextResponse.json(
|
||||
{ error: 'Access denied' },
|
||||
{ status: 403 }
|
||||
);
|
||||
}
|
||||
|
||||
const domainManager = createDomainManager(universityId);
|
||||
const isValid = await domainManager.validateDomainOwnership(id);
|
||||
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
data: {
|
||||
domainId: id,
|
||||
isValid,
|
||||
message: isValid ? 'Domain validated successfully' : 'Domain validation failed',
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('Error validating domain:', error);
|
||||
return NextResponse.json(
|
||||
{ error: 'Failed to validate domain' },
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user