InstructAI is a comprehensive AI-powered educational platform that revolutionizes learning through personalized course generation, interactive content delivery, and intelligent progress tracking. The platform combines a modern React/Next.js frontend with a robust Spring Boot backend to deliver adaptive learning experiences.
- Overview
- Key Features
- Architecture
- Project Structure
- Installation & Setup
- Configuration
- API Documentation
- Usage
- Technologies Used
- Deployment
- Testing
- Contributing
- License
- Support
InstructAI is an intelligent educational platform that leverages AI to create personalized learning experiences. The platform automatically generates courses, tracks student progress, and adapts content delivery based on individual learning patterns.
- AI-Powered Course Generation: Automatically creates comprehensive courses using Google Gemini AI
- Interactive Learning: Real-time chat interface with voice recognition and synthesis
- Progress Tracking: Detailed analytics and achievement systems
- Multimedia Content: Integrated video content, quizzes, and interactive exercises
- Personalized Learning Paths: Adaptive content based on user preferences and performance
- Real-time Communication: Socket.IO powered chat and collaboration features
- Dynamic Course Creation: Generate courses on any topic using advanced AI prompts
- Interactive Course Builder: Multi-stage questionnaire for personalized course customization
- Content Generation: Automatic creation of modules, quizzes, and learning resources
- Smart Content Adaptation: AI adjusts content based on learning preferences
- Module-based Learning: Structured content delivery with prerequisites
- Progress Tracking: Real-time progress monitoring with detailed analytics
- Achievement System: Gamified learning with achievements and milestones
- Content Completion: Track articles, videos, and quiz completions
- Video Learning: YouTube integration with timed quizzes
- Interactive Quizzes: Multiple choice, fill-in-the-blank, and subjective questions
- Visual Aids: Dynamic content adjustment based on confusion levels
- Speech Integration: Voice-to-text and text-to-speech capabilities
- Real-time Chat: Socket.IO powered messaging system
- Community Features: Discussion threads and collaborative learning
- User Profiles: Comprehensive user management with preferences
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Frontend │ │ Backend │ │ External │
│ (Next.js) │◄──►│ (Spring Boot) │◄──►│ Services │
│ │ │ │ │ │
│ • React 18 │ │ • REST APIs │ │ • Google Gemini │
│ • Context API │ │ • WebSockets │ │ • YouTube API │
│ • Tailwind CSS │ │ • Spring Data │ │ • PostgreSQL │
│ • Framer Motion │ │ • Spring Cache │ │ • Redis │
└─────────────────┘ └─────────────────┘ └─────────────────┘
- Spring Boot 3.x - Main application framework
- Spring Data JPA - Database access and ORM
- Spring Security - JWT-based authentication
- Spring Cache - Redis-based caching strategy
- Socket.IO - Real-time communication
- PostgreSQL - Primary database
- Redis - Caching and session storage
- Next.js 14 - React framework with SSR support
- React Context - State management for progress tracking
- Tailwind CSS - Utility-first styling
- Framer Motion - Animation and transitions
- Axios - HTTP client for API communication
InstructAI/
├── client/ # Frontend Next.js Application
│ ├── app/ # Next.js 14 App Router
│ ├── components/ # Reusable UI components
│ │ ├── AITutor.js # Main AI tutor interface
│ │ ├── ChatInterface.js # Real-time chat component
│ │ ├── Learn.js # Learning interface
│ │ ├── QuestionDialog.js # Interactive quiz modals
│ │ └── YoutubeGenerator.js # Video integration
│ ├── context/ # React Context providers
│ │ └── ProgressContext.jsx # Progress tracking state
│ ├── hooks/ # Custom React hooks
│ │ ├── useSpeechRecognition.js # Voice input handling
│ │ └── useSpeechSynthesis.js # Text-to-speech
│ ├── lib/ # Utility libraries
│ ├── services/ # API service layers
│ └── public/ # Static assets
│
├── server/ # Backend Spring Boot Application
│ ├── src/main/java/ # Java source code
│ │ └── com/screening/interviews/
│ │ ├── config/ # Configuration classes
│ │ ├── controller/ # REST API controllers
│ │ ├── dto/ # Data Transfer Objects
│ │ ├── model/ # JPA Entity models
│ │ ├── prompts/ # AI prompt templates
│ │ ├── repo/ # Repository interfaces
│ │ ├── security/ # Security configuration
│ │ └── service/ # Business logic services
│ ├── src/main/resources/ # Configuration files
│ │ ├── application.properties
│ │ └── application-prod.properties
│ ├── docker-compose.yml # Local development setup
│ ├── Dockerfile # Container configuration
│ ├── pom.xml # Maven dependencies
│ └── render.yaml # Deployment configuration
│
├── Documentation.md # API and service documentation
├── DEPLOYMENT_GUIDE.md # Deployment instructions
└── README.md # This file
- Node.js (v18 or higher)
- Java (17 or higher)
- Maven (3.6 or higher)
- PostgreSQL (12 or higher)
- Redis (6 or higher)
-
Clone the repository:
git clone https://github.com/your-username/InstructAI.git cd InstructAI -
Database Setup:
# Create PostgreSQL database createdb instructai_db -
Configure Environment Variables:
# Create .env file in server directory cp server/.env.example server/.env -
Install and Run Backend:
cd server ./mvnw spring-boot:run
-
Install Dependencies:
cd client npm install -
Configure Environment:
# Create .env.local file cp .env.example .env.local -
Run Development Server:
npm run dev
# Run complete stack with Docker
cd server
docker-compose up -dSPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/instructai_db
SPRING_DATASOURCE_USERNAME=postgres
SPRING_DATASOURCE_PASSWORD=your_password
SPRING_DATA_REDIS_HOST=localhost
SPRING_DATA_REDIS_PORT=6379
GEMINI_API_KEY=your_gemini_api_key
JWT_SECRET=your_jwt_secretNEXT_PUBLIC_API_BASE_URL=http://localhost:8007
NEXT_PUBLIC_SOCKET_URL=http://localhost:9092server/application.properties- Spring Boot configurationclient/next.config.mjs- Next.js configurationserver/docker-compose.yml- Local development setup
POST /api/courses- Generate new courseGET /api/courses/{id}- Get course detailsPUT /api/courses/{id}- Update courseGET /api/courses/user/{userId}- Get user courses
POST /api/learning-resources/generate- Generate learning contentGET /api/modules/{id}/content- Get module contentPOST /api/modules/{id}/quiz- Generate quiz for module
POST /api/progress/start-module- Start module progressPOST /api/progress/complete-content- Mark content as completedGET /api/progress/user/{userId}- Get user progress summary
POST /api/interactive-courses/stage1- First customization stagePOST /api/interactive-courses/stage2- Second customization stagePOST /api/interactive-courses/stage3- Final customization stagePOST /api/interactive-courses/generate- Generate final course
For detailed API documentation, see Documentation.md.
-
Interactive Course Builder:
- Navigate to course creation
- Answer personalization questions
- AI generates customized course structure
-
Direct Course Generation:
const courseData = { topic: "Machine Learning", difficultyLevel: "Intermediate", preferences: {...} };
// Using ModuleProgress component
import { ModuleProgress } from './context/ProgressContext';
<ModuleProgress
moduleId="M1"
moduleData={moduleData}
onProgressUpdate={handleProgress}
onModuleCompleted={handleCompletion}
>
{/* Your learning content */}
</ModuleProgress>- Chat Interface: Real-time messaging with AI tutors
- Voice Integration: Speech-to-text and text-to-speech
- Video Learning: YouTube integration with timed quizzes
- Progress Sync: Real-time progress updates across devices
- Framework: Next.js 14 with App Router
- UI Library: Custom components with Tailwind CSS
- State Management: React Context API
- Animations: Framer Motion
- HTTP Client: Axios
- Real-time: Socket.IO Client
- Speech: Web Speech API integration
- Framework: Spring Boot 3.x
- Database: PostgreSQL with Spring Data JPA
- Caching: Redis with Spring Cache
- Security: Spring Security with JWT
- AI Integration: Google Gemini API
- Real-time: Socket.IO Java
- Build Tool: Maven
- Containerization: Docker & Docker Compose
- Deployment: Render.com ready
- Monitoring: Spring Actuator with health checks
- Testing: JUnit 5, MockMvc
-
Using Render.com:
# Configure render.yaml # Push to GitHub # Connect to Render.com
-
Docker Deployment:
# Build and deploy with Docker docker build -t instructai-server . docker run -p 8007:8007 instructai-server
-
Manual Deployment:
# Backend ./mvnw clean package java -jar target/instructai-server.jar # Frontend npm run build npm start
For detailed deployment instructions, see DEPLOYMENT_GUIDE.md.
cd server
# Unit tests
./mvnw test
# Integration tests
./mvnw integration-test
# All tests with coverage
./mvnw verify- Unit tests for service layer
- Integration tests for repositories
- Controller tests with MockMvc
- Security and authentication tests
We welcome contributions! Please follow these guidelines:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Make your changes
- Add tests for new functionality
- Commit your changes:
git commit -m "Add amazing feature" - Push to your branch:
git push origin feature/amazing-feature
- Open a Pull Request
- Follow Spring Boot best practices for backend
- Use React/Next.js conventions for frontend
- Write comprehensive tests
- Document API changes
- Use meaningful commit messages
This project is licensed under the MIT License - see the LICENSE file for details.
- API Documentation:
Documentation.md - Deployment Guide:
DEPLOYMENT_GUIDE.md - Server README:
server/README.md
- Email: [email protected]
- GitHub: https://github.com/rebornstar1
- Issues: Create an issue
- Health Check:
GET /actuator/health - Metrics:
GET /actuator/metrics - Info:
GET /actuator/info
- AI Integration: Google Gemini API for intelligent content generation
- Frameworks: Spring Boot and Next.js communities
- UI Components: Tailwind CSS and Framer Motion
- Real-time Communication: Socket.IO team
- Contributors: All contributors who helped build this platform
InstructAI - Revolutionizing education through AI-powered personalized learning experiences.