A simple learning management system that helps students ask questions about lessons using AI-powered responses. Built with Laravel, Vue.js, Inertia.js, and Google Gemini AI.
- Admin Panel: Teachers can create, edit, and manage lesson content
- Student Interface: Students can read lessons and ask questions
- AI-Powered Q&A: Intelligent responses to student questions using Google Gemini
- Context-Aware: AI responses are based on the specific lesson content
- Role-Based Access: Separate interfaces for admins and students
- Backend: Laravel 10.x
- Frontend: Vue.js 3 with Inertia.js
- Database: MySQL/SQLite
- AI Service: Google Gemini API
- Styling: Tailwind CSS (via Laravel Breeze/Jetstream)
Before running this application, make sure you have:
- PHP 8.1 or higher
- Composer
- Node.js 16+ and npm
- MySQL or SQLite
- Google Gemini API key
git clone <your-repository-url>
cd edtech-learning-assistant
composer install
npm install
# Copy the example environment file
cp .env.example .env
# Generate application key
php artisan key:generate
Edit your .env
file with the following settings:
# Database Configuration
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=edtech_learning
DB_USERNAME=your_username
DB_PASSWORD=your_password
# Google Gemini API Configuration
GEMINI_API_KEY=your_gemini_api_key_here
GEMINI_API_URL=https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent
# Run migrations
php artisan migrate:fresh
# (Optional) Seed with sample data
php artisan db:seed
npm run build
# Or for development
npm run dev
- Go to Google AI Studio
- Sign in with your Google account
- Click "Create API Key"
- Copy the generated API key
- Add it to your
.env
file asGEMINI_API_KEY
# Start the Laravel development server
composer dev
# Build assets for production
composer dev:ssr
# Configure your web server to point to the public directory
The application will be available at http://localhost:8000
After running the seeder, you can use these accounts:
Admin Accounts:
- Email:
[email protected]
- Password:
password
- Email:
[email protected]
- Password:
password
Student Account:
- You can create a student account by registering through the application.
βββ app/
β βββ Http/Controllers/
β β βββ Auth/ # Authentication controllers
β β βββ LessonController.php
β β βββ QuestionController.php
β βββ Models/
β β βββ User.php
β β βββ Lesson.php
β β βββ Question.php
β βββ Services/
β βββ AIService.php # Gemini API integration
βββ database/
β βββ migrations/
β βββ seeders/
βββ resources/
β βββ js/
β β βββ Pages/
β β β βββ Admin/ # Admin dashboard pages
β β β βββ Student/ # Student interface pages
β β βββ Components/ # Reusable Vue components
β βββ views/
βββ routes/
βββ web.php
- Login to the admin dashboard
- Create Lessons by providing a title and content
- Manage Lessons through the admin interface
- View Student Questions and AI responses
- Login to access available lessons
- Browse Lessons from the lesson list
- Read Lesson Content on individual lesson pages
- Ask Questions using the chat interface
- Receive AI Answers based on the lesson content
- When a student asks a question, the system sends both the lesson content and the question to Google Gemini
- Gemini provides contextual answers based on the specific lesson material
- Responses are stored in the database for future reference
id
,name
,email
,password
role
(admin/student)- Standard Laravel timestamps
id
,title
,content
created_by
(foreign key to users)- Standard Laravel timestamps
id
,question
,ai_response
lesson_id
(foreign key to lessons)user_id
(foreign key to users)- Standard Laravel timestamps
Run the test suite:
# Run all tests
php artisan test
# Run specific test types
php artisan test --filter=Feature
php artisan test --filter=Unit
- Connect your repository
- Set environment variables
- Configure database
- Deploy
- Upload files to your server
- Configure web server (Apache/Nginx)
- Set proper file permissions
- Run production commands:
composer install --optimize-autoloader --no-dev
php artisan config:cache
php artisan route:cache
php artisan view:cache
npm run build
The AI service can be configured in config/services.php
:
'gemini' => [
'api_key' => env('GEMINI_API_KEY'),
'api_url' => env('GEMINI_API_URL'),
'max_tokens' => 1000,
'temperature' => 0.7,
]
Gemini API not working:
- Verify your API key is correct
- Check your internet connection
- Ensure you have API quota remaining
Database connection errors:
- Verify database credentials in
.env
- Ensure database server is running
- Check database permissions
Frontend not loading:
- Run
npm run build
ornpm run dev
- Clear browser cache
- Check for JavaScript console errors
POST /login
- User loginPOST /logout
- User logout
GET /admin/lessons
- List all lessonsPOST /admin/lessons
- Create new lessonPUT /admin/lessons/{id}
- Update lessonDELETE /admin/lessons/{id}
- Delete lesson
GET /lessons
- List available lessonsGET /lessons/{id}
- View specific lessonPOST /lessons/{id}/questions
- Ask question about lesson
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests
- Submit a pull request