An intelligent Django-based mentorship platform that connects students with mentors, featuring AI-powered answer generation and multi-language translation capabilities.
- AI Answer Generation: Mentors can generate detailed, comprehensive answers using a pre-trained Qwen language model
- Smart Translation: Real-time translation of questions and answers in multiple languages (English, Chinese, Japanese, Hindi)
- AI Answer Enhancement: Mentors can improve their responses using AI assistance
- Question Management: Post questions with categories (Programming, Career, Project Help, General Learning)
- Real-time Updates: View mentor responses as they arrive
- Multi-language Support: Translate questions and answers to preferred languages
- Progress Tracking: Monitor question status (Pending, Answered, Closed)
- Question Overview: View all student questions with filtering options
- AI-Assisted Responses: Generate or enhance answers using AI
- Translation Tools: Communicate effectively across language barriers
- Student Analytics: Track mentoring activities and statistics
- Django Framework: Modern web framework with robust security
- User Authentication: Role-based access (Student/Mentor)
- Database Persistence: SQLite database for storing questions, answers, and user data
- Responsive Design: Bootstrap for mobile-friendly interface
- AJAX Operations: Seamless user experience without page reloads
mentor/
├── web/ # Django project root
│ ├── manage.py # Django management script
│ ├── requirements.txt # Python dependencies
│ ├── db.sqlite3 # SQLite database
│ ├── projectname/ # Django project settings
│ │ ├── __init__.py
│ │ ├── settings.py # Django configuration
│ │ ├── urls.py # URL routing
│ │ ├── wsgi.py # WSGI configuration
│ │ └── asgi.py # ASGI configuration
│ ├── auth/ # Authentication app
│ │ ├── models.py # Database models (User, Question, Answer)
│ │ ├── views.py # View controllers and AI integration
│ │ ├── admin.py # Django admin configuration
│ │ ├── apps.py # App configuration
│ │ ├── templates/ # HTML templates
│ │ │ ├── Login.html # Login page
│ │ │ ├── Register.html # Registration page
│ │ │ ├── Student.html # Student dashboard
│ │ │ └── Mentor.html # Mentor dashboard
│ │ ├── templatetags/ # Custom template filters
│ │ │ └── mentor_filters.py
│ │ └── migrations/ # Database migrations
│ └── home/ # Home app
│ ├── models.py
│ ├── views.py
│ ├── admin.py
│ ├── Templates/ # Home app templates
│ │ ├── Base.html # Base template
│ │ ├── Home.html # Landing page
│ │ └── About.html # About page
│ └── migrations/
├── saved_qwen_model/ # Pre-trained AI model (config files only)
│ ├── config.json # Model configuration
│ ├── tokenizer.json # Tokenizer configuration
│ ├── vocab.json # Vocabulary
│ └── ... # Other model config files
├── translate.ipynb # Translation development notebook
├── Untitled.ipynb # Additional notebooks
├── output_audio.mp3 # Audio file
└── README.md # Project documentation
├── translate.ipynb # Translation development notebook ├── anaconda_projects/ # Anaconda project files └── README.md # Project documentation
## 🚀 Installation & Setup
### Prerequisites
- Python 3.8+
- Django 5.2
- PyTorch
- Transformers library
### 1. Clone the Repository
```bash
git clone https://github.com/Praharsh7270/Mentor.git
cd Mentor
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatecd web
pip install -r requirements.txtImportant Note: The large AI model file (model.safetensors) is not included in the repository due to GitHub's file size limitations. You will need to:
- Download the Qwen model separately from Hugging Face or another source
- Place the
model.safetensorsfile in thesaved_qwen_model/directory - Ensure all model configuration files are present
Alternatively, you can modify the code to use a different model or implement a different AI solution.
python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser # Create admin accountpython manage.py runserverVisit http://127.0.0.1:8000 to access the platform.
- Register/Login as a student
- Post Questions:
- Write clear question titles and descriptions
- Select appropriate categories
- Use translation features if needed
- View Answers:
- Monitor your dashboard for mentor responses
- Translate answers to your preferred language
- Track question status
- Register/Login as a mentor
- Browse Questions:
- View all student questions
- Filter by status and category
- Use translation tools to understand questions in different languages
- Provide Answers:
- Write comprehensive responses
- Use "Answer with AI" for AI-generated responses
- Use "AI Assist" to enhance your existing answers
- Submit answers with real-time updates
The platform integrates a pre-trained Qwen model for:
- Generating detailed mentor responses
- Enhancing existing answers
- Providing context-aware suggestions
- Multi-language support: English, Chinese (中文), Japanese (日本語), Hindi (हिंदी)
- Real-time translation of questions and answers
- Context preservation during translation
- UserProfile: Extends Django User with role-based access
- Question: Student questions with categories and status tracking
- Answer: Mentor responses linked to questions
- One-to-Many: User → Questions
- One-to-Many: User → Answers
- One-to-Many: Question → Answers
- Django: Web framework
- SQLite: Database
- PyTorch: AI model framework (if using local model)
- Transformers: Hugging Face library
- Bootstrap: CSS framework
- JavaScript ES6: Dynamic interactions
- AJAX: Asynchronous operations
- Qwen Model: Language model for answer generation (model file not included)
- Custom Translation API: Multi-language support
Create a .env file in the web directory:
SECRET_KEY=your_secret_key_here
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1The Qwen model configuration files are in saved_qwen_model/. The large model file (model.safetensors) needs to be downloaded separately due to size constraints.
- Set
DEBUG=Falsein settings - Configure proper database (PostgreSQL recommended)
- Set up static file serving
- Configure ALLOWED_HOSTS
- Use environment variables for sensitive data
# Dockerfile example
FROM python:3.9
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Praharsh7270
- GitHub: @Praharsh7270
- Project Link: https://github.com/Praharsh7270/Mentor
- Hugging Face for the Transformers library
- Qwen model developers
- Django community
- Bootstrap team for the UI framework
If you encounter any issues or have questions:
- Check the Issues section
- Create a new issue with detailed information
- Contact the maintainer
- Large Model File: The
model.safetensorsfile (3.1GB) is not included in this repository due to GitHub's file size limitations - Model Setup: You'll need to download the Qwen model separately or configure an alternative AI solution
- Dependencies: Ensure all Python dependencies are installed as specified in
requirements.txt
⭐ Star this repository if you find it helpful! ⭐