A modern Next.js application that allows Student Support offices to create AI-powered assistants for helping students with common questions and processes. Staff can upload their existing guides, FAQs, and documentation, and the system automatically creates intelligent assistants that students can chat with 24/7.
- Easy Assistant Creation: Upload documents and create AI assistants without technical knowledge
- Document Monitoring: Automatic syncing when documents are updated
- Quality Testing: Built-in testing system to ensure response quality
- Analytics Dashboard: Track usage, common questions, and performance metrics
- Customizable Appearance: Brand assistants with custom colors and welcome messages
- 24/7 Availability: Get help anytime with intelligent AI assistants
- Natural Conversations: Chat naturally with assistants that understand context
- Source Citations: See which documents answers come from for transparency
- Mobile Friendly: Works seamlessly on all devices
- Framework: Next.js 14 with App Router
- Language: TypeScript
- Styling: Tailwind CSS
- Database: MongoDB
- AI: Amplify AI Assistants
- File Processing: Support for PDF, DOCX, TXT, and Markdown files
- File Monitoring: Real-time document synchronization
Before setting up the application, ensure you have:
- Node.js 18+ installed
- Amplify API key and assistant ID
- Git
-
Clone the repository
git clone <repository-url> cd student-support-assistant
-
Install dependencies
npm install
-
Set up environment variables
cp .env.local.example .env.local
Edit
.env.localand add your configuration:# Database MONGODB_URI=mongodb://localhost:27017/student-support-assistant # AI Configuration OPENAI_API_KEY=your_openai_api_key_here # Email Configuration (optional) SMTP_HOST=smtp.gmail.com SMTP_PORT=587 SMTP_USER=your_email@domain.com SMTP_PASS=your_app_password # Application Settings NEXTAUTH_SECRET=your_nextauth_secret_here NEXTAUTH_URL=http://localhost:3000 # File Upload Settings MAX_FILE_SIZE=50MB UPLOAD_DIR=./uploads
-
Start the development server
npm run dev
-
Visit the application Open http://localhost:3000 in your browser
student-support-assistant/
βββ app/ # Next.js App Router
β βββ api/ # API routes
β βββ chat/ # Student chat interface
β βββ dashboard/ # Staff management interface
β βββ globals.css # Global styles
β βββ layout.tsx # Root layout
β βββ page.tsx # Home page
βββ components/ # React components
βββ lib/ # Utility libraries
β βββ ai-service.ts # AI integration
β βββ document-processor.ts # File processing
β βββ file-monitor.ts # Document monitoring
β βββ mongodb.ts # Database connection
β βββ types.ts # TypeScript definitions
βββ public/ # Static assets
βββ uploads/ # Document upload directory
βββ README.md # This file
The application uses MongoDB to store assistants, documents, conversations, and analytics. Make sure your MongoDB instance is running and accessible.
You'll need an Amplify API key and assistant ID. Add them to your environment variables:
AMPLIFY_API_KEY=your_amplify_api_key_here
AMPLIFY_ASSISTANT_ID=your_amplify_assistant_id_hereTo get your assistant ID:
- Create an assistant at www.vanderbilt.ai
- Collect your assistant's ID from the dashboard
- Add it to your environment variables
The system supports these file formats:
- PDF documents
- Microsoft Word (DOCX)
- Plain text (TXT)
- Markdown (MD)
The file monitoring system watches specified folders for changes and automatically processes new or updated documents.
-
Access the Dashboard
- Navigate to
/dashboard - Click "Create Assistant"
- Navigate to
-
Fill in Basic Information
- Name: Choose a descriptive name (e.g., "Financial Aid Helper")
- Description: Explain what the assistant helps with
- Welcome Message: Write a greeting for students
-
Set Document Folder
- Provide the path to your documents folder
- The system will automatically process all supported files
-
Customize Appearance
- Choose colors to match your brand
- Set response style (professional, friendly, formal)
- Configure response length and citations
-
Test Your Assistant
- Go to the Testing page
- Add common questions students ask
- Run tests to ensure quality responses
-
Share with Students
- Your assistant will be available at
/chat/[assistant-name] - Share the link with students
- Your assistant will be available at
The system automatically monitors your document folder for changes:
- Adding Files: Simply add new documents to the folder
- Updating Files: Save changes to existing documents
- Removing Files: Delete files from the folder
All changes are processed automatically within minutes.
Use the built-in testing system to ensure your assistant provides good responses:
- Create Test Questions: Add common student questions
- Run Tests: Execute tests to see how the assistant responds
- Review Results: Check response quality and citations
- Improve Documentation: Add more documents if responses are incomplete
Track your assistant's performance through the analytics dashboard:
- Usage Statistics: See how many students are using the assistant
- Popular Questions: Identify the most common student questions
- Response Times: Monitor assistant performance
- Document Usage: See which documents are cited most often
- Student Satisfaction: Track feedback ratings
- Never commit API keys or sensitive data to version control
- Use environment variables for all configuration
- Regularly update dependencies
- Monitor file upload directories for security
- Implement proper access controls for staff areas
- Review Analytics: Check weekly for usage patterns and issues
- Update Documents: Keep information current in monitored folders
- Run Tests: Regularly test assistant responses for quality
- Check Logs: Monitor server logs for errors or issues
- Monitor response times and optimize if needed
- Review document collection size and archive old files
- Check database performance and optimize queries
- Scale infrastructure based on usage patterns
When contributing to this project:
- Follow TypeScript best practices
- Write tests for new functionality
- Update documentation for changes
- Use semantic commit messages
- Test thoroughly before submitting
This project is licensed under the MIT License - see the LICENSE file for details.
Assistant not responding
- Check OpenAI API key is valid
- Verify MongoDB connection
- Check server logs for errors
Documents not processing
- Verify file formats are supported
- Check folder permissions
- Look for processing errors in logs
Poor response quality
- Add more relevant documents
- Improve document organization
- Run quality tests and iterate
Slow performance
- Check database query performance
- Monitor API response times
- Consider caching strategies
If you encounter issues:
- Check the troubleshooting section above
- Review server logs for error messages
- Test with simple examples first
- Contact support with specific error details
For production deployment:
-
Environment Setup
- Set production environment variables
- Configure secure database connection
- Set up proper logging
-
Build and Deploy
npm run build npm start
-
Post-Deployment
- Test all functionality
- Set up monitoring
- Configure backups
- Enable SSL/HTTPS
Happy Building! π
Create amazing AI assistants that help students succeed in their academic journey.