This repository is licensed under a proprietary license. See LICENSE.
TurnIn is a revolutionary Django-based system that automates student assignments using AI agents and Browser Use technology. It provides a seamless, intelligent solution for completing academic work through advanced browser automation.
- ๐ค AI-Powered Assignment Completion: Automatically completes assignments using advanced AI models (GPT-4, Claude, etc.)
- ๐ Browser Use Integration: Real-time browser automation using the Browser Use library
- ๐บ Live Browser Monitoring: Watch the AI agent complete assignments in real-time
- ๐ง Multiple AI Models: Support for OpenAI, Anthropic, Google, and DeepSeek models
- โก WebSocket Support: Real-time updates and live monitoring
- ๐ฅ User Management: Secure user authentication and credential management
- ๐ Admin Interface: Complete admin dashboard for monitoring and management
- ๐ฌ Natural Conversation: Students chat with the AI assistant about their assignment
- ๐ Smart Requirements Gathering: The assistant naturally asks follow-up questions to understand:
- Assignment type (essay, presentation, research, etc.)
- Platform to use (Google Docs, Slides, Canvas, etc.)
- Topic and specific requirements
- Login credentials (username/password)
- ๐ Automatic Trigger: When enough information is gathered, automation starts seamlessly
- ๐ Browser Automation: Browser Use agent logs in and completes the assignment
- ๐ฑ Real-time Monitoring: Watch the AI work through live browser streaming
- โ Completion: Assignment is saved/submitted automatically
User: "I need help with my history assignment"
Assistant: "I'd love to help! What type of assignment is it and what's the topic?"
User: "It's a 10-slide presentation about the Irish Potato Famine for Google Slides"
Assistant: "Perfect! I'll need your Google account to create the slides. What are your login credentials?"
User: "username: student@iusd.org, password: mypassword123"
Assistant: "๐ Perfect! I have everything I need. Starting the automation now - you can watch the progress in real-time!"
[Automation begins automatically]
# Activate virtual environment (already created)
source venv/bin/activate
# Install dependencies (already done)
pip install -r requirements.txt
# Install Playwright browsers (already done)
playwright install chromiumIMPORTANT: Create a .env file in the project root with your API keys:
# AI Provider API Keys (REQUIRED for automation)
# At minimum, you need OPENAI_API_KEY for the system to work
OPENAI_API_KEY=sk-your-actual-openai-key-here
# Optional: Other AI providers
ANTHROPIC_API_KEY=your-anthropic-api-key-here
GOOGLE_API_KEY=your-google-api-key-here
DEEPSEEK_API_KEY=your-deepseek-api-key-here
# Optional: Browser Use Cloud (for remote automation)
BROWSER_USE_CLOUD_API_KEY=your-browser-use-cloud-key-here
# Django Configuration
SECRET_KEY=django-insecure-change-this-key-in-production
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1
# Browser Use Configuration
BROWSER_USE_HEADLESS=False
BROWSER_USE_TIMEOUT=300
BROWSER_USE_SCREENSHOT_QUALITY=90
# IUSD Configuration
IUSD_LOGIN_URL=https://iusd.k12.ca.us/login
ALLOWED_DOMAINS=iusd.k12.ca.us,google.com,classroom.google.com# Migrations already created and applied
python manage.py makemigrations
python manage.py migrate
# Superuser already created (admin/admin123)
python manage.py createsuperuserpython manage.py runserverVisit http://localhost:8000 to access the application!
To send real emails, add SMTP settings to your .env (dotenv is loaded by turnin/settings.py). Example:
EMAIL_BACKEND=django.core.mail.backends.smtp.EmailBackend
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USE_TLS=True
EMAIL_USE_SSL=False
EMAIL_HOST_USER=your_email@yourdomain.com
EMAIL_HOST_PASSWORD=your_app_password_or_smtp_key
DEFAULT_FROM_EMAIL="Turnin <no-reply@yourdomain.com>"
SERVER_EMAIL="Turnin Server <server@yourdomain.com>"Notes:
- Use only one of
EMAIL_USE_TLSorEMAIL_USE_SSL. - For Gmail/Workspace, use an App Password (with 2FA) or SMTP relay โ normal account password wonโt work.
- In DEBUG, the default backend is the console backend (prints emails to terminal). Override
EMAIL_BACKENDto SMTP to actually send.
Test delivery:
python manage.py sendtestemail you@example.comIf you receive the message, SMTP is working.
- ๐ Access the Website: Open
http://localhost:8000in your browser - ๐ฌ Chat Interface: Use the chat interface to describe your assignment
- ๐ Start Automation: Click "Start Automation" when prompted
- ๐ Fill Task Form: Enter your assignment details and IUSD credentials
- ๐ Live Browser: Watch the AI agent work in the live browser window
- ๐ Monitor Progress: Track task completion in real-time
- ๐ง Admin Panel: Access
http://localhost:8000/admin(username: admin, password: admin123) - ๐ Monitor Tasks: View all automation tasks and their statuses
- ๐ฅ Manage Users: Handle user accounts and profiles
- ๐ View Logs: Check system logs for debugging and monitoring
- โ๏ธ System Settings: Configure system-wide settings and preferences
The system consists of several key components:
- ๐ข Django Backend: Main application server and REST API
- ๐ค Browser Use Service: Handles browser automation and AI agent management
- โก WebSocket Consumers: Real-time updates for live monitoring
- ๐ Task Management: Async task processing and queue management
- ๐ Admin Interface: Management dashboard for monitoring and control
- ๐ค UserProfile: Extended user information and preferences
- ๐ BrowserSession: Browser automation session tracking
- ๐ AutomationTask: Individual task records and metadata
- ๐ฃ TaskStep: Detailed step-by-step execution logs
- ๐ TaskResult: Final results and outcomes
- ๐ SystemLog: System-wide logging and debugging
POST /api/tasks/create/: Create new automation taskGET /api/tasks/: List user's tasksGET /api/tasks/{id}/: Get task status and detailsPOST /api/tasks/{id}/cancel/: Cancel running taskGET /api/tasks/{id}/result/: Get task results
POST /api/credentials/: Save user credentialsGET /api/logs/: Get system logs (admin only)
ws/task/{task_id}/: Real-time task updatesws/browser/{session_id}/: Browser session monitoring
- ๐ Secure Authentication: User credentials are stored securely
- ๐ API Key Management: All API keys stored in environment variables
- ๐ WebSocket Security: Authenticated WebSocket connections
- ๐ฎ Admin Protection: Admin access restricted to superusers
- ๐ก๏ธ API Security: All endpoints require proper authentication
turnin/
โโโ turnin/ # Django project settings
โ โโโ settings.py # Updated with Browser Use config
โ โโโ urls.py # URL routing
โ โโโ asgi.py # WebSocket support
โโโ turnin_app/ # Main application
โ โโโ models.py # Database models
โ โโโ views.py # API endpoints
โ โโโ browser_service.py # Browser Use integration
โ โโโ consumers.py # WebSocket consumers
โ โโโ routing.py # WebSocket routing
โ โโโ admin.py # Admin interface
โ โโโ templates/ # Frontend templates
โโโ requirements.txt # Python dependencies
โโโ .env # Environment variables
โโโ README.md # This file
The system is now fully configured and ready to use:
- โ Dependencies: All packages installed
- โ Database: Models created and migrated
- โ Admin User: Created (admin/admin123)
- โ Browser Support: Playwright browsers installed
- โ Configuration: Environment variables set up
- โ
Server: Running on
http://localhost:8000
- ๐ Add API Keys: Update the
.envfile with your actual AI provider API keys - ๐งช Test the System: Create a test assignment and watch the AI agent work
- ๐ฅ Create Users: Set up user accounts for students
- ๐ Monitor Performance: Use the admin interface to track system performance
- ๐ง Customize: Modify the system to fit your specific needs
- API Keys Required: You need valid API keys for AI providers (OpenAI, Anthropic, etc.)
- Browser Support: System works best with Chrome/Chromium browsers
- IUSD Integration: Designed for IUSD school district (customizable)
- Educational Use: Ensure compliance with academic integrity policies
For support and questions:
- ๐ Check the admin interface for system logs
- โก Review WebSocket connections for real-time issues
- ๐ Monitor task execution through the live browser feature
- ๐ง Contact the development team for technical support
This system is for educational purposes. Users are responsible for ensuring compliance with their institution's academic integrity policies.
Made with โค๏ธ for automating student assignments using AI and Browser Use technology.