Skip to content

ck-ahmad/Student_AI_Assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

58 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ“ Student AI Assistant

image

Your Complete Academic Companion Powered by Google Gemini 2.5 Pro

A comprehensive AI-powered web application designed specifically for students, featuring smart notes, file management, health tracking, quiz generation, and intelligent search capabilities.

Python Flask React Gemini License YouTube Video


πŸ‘₯ Development Team

Safia Liaqat & Ume Habiba - Frontend Developer (Under process as Safia will enhance fronet end by React)

  • 🎨 Responsible for: Complete Frontend Architecture & UI/UX Design
  • βš›οΈ Tech Stack: React.js, Modern CSS, Responsive Design
  • πŸ’‘ Key Contributions:
    • Designed beautiful, intuitive user interfaces
    • Built interactive React components for all features
    • Implemented responsive design for mobile/desktop
    • Created smooth animations and user interactions
    • Developed real-time AI response displays
  • πŸ’Ό GitHub: @Um e Habiba
  • πŸ”— LinkedIn: Um e Habiba
  • πŸ’Ό GitHub: @safialiaqat
  • πŸ”— LinkedIn: Safia Liaqat

Ahmad - Backend Developer (Python/Flask)

  • βš™οΈ Responsible for: Complete Backend Architecture & AI Integration
  • 🐍 Tech Stack: Python, Flask, Google Gemini AI, RESTful APIs
  • πŸ’‘ Key Contributions:
    • Built robust Flask REST API backend
    • Integrated Google Gemini 2.5 Pro AI model
    • Developed all AI-powered features (Notes, Quiz, Health, Search)
    • Implemented file upload and cloud storage system
    • Created database architecture and data management
    • Set up authentication and security features
  • πŸ“§ Email: ahmadleo498@gmail.com
  • πŸ’Ό GitHub: @ckahmad
  • πŸ”— LinkedIn: Ahmad

✨ Features

πŸ“ Smart Notes Manager

  • AI-Enhanced Notes: Automatically improve grammar, formatting, and clarity
  • Smart Summarization: Generate concise summaries of all your notes
  • Interactive Q&A: Ask questions about your notes and get AI-powered answers
  • Flashcard Generation: Auto-create study flashcards from your content
  • Voice Notes: Record and transcribe voice notes (optional)
  • Search & Filter: Quickly find specific notes by keywords
  • Real-time Updates: Instant UI feedback with React

πŸ“š Drive Manager

  • File Upload: Upload files to cloud storage (Cloudinary) or local storage
  • External Links: Add Google Drive, Dropbox, or any web links
  • Smart Organization: Organize by semester, degree, and subject
  • Search Functionality: Find files across all your materials
  • AI Study Plans: Generate personalized study schedules
  • Quick Access: Predefined links to common course materials
  • Drag & Drop: Modern file upload interface

πŸ₯ Health Tracker

  • Symptom Analysis: Get AI-powered health information (educational only)
  • Medical Information: Search for reliable health resources
  • Wellness Tips: Get tips for nutrition, exercise, mental health, and more
  • First Aid Guides: Quick access to emergency procedures
  • Medication Info: Learn about common medications
  • Mental Health Support: Resources and coping strategies
  • Interactive Forms: Clean, user-friendly health input

🎯 Quiz Generator

  • Smart Quiz Generation: Create quizzes from your notes or any topic
  • Multiple Question Types: MCQ, True/False, and Short Answer questions
  • Difficulty Levels: Easy, Medium, and Hard options
  • Instant AI Feedback: Get personalized explanations for each answer
  • Performance Tracking: View your quiz history and progress
  • Study Recommendations: Get AI suggestions based on your performance
  • Interactive Quiz UI: Smooth, engaging quiz-taking experience

πŸ” Smart Search Engine

  • AI Search Suggestions: Get optimized search queries
  • Multi-Engine Support: Google, Bing, Scholar, YouTube
  • Local File Search: Find files on your computer
  • To-Do List Manager: Organize tasks with AI prioritization
  • Pomodoro Timer: Built-in study timer
  • Study Music Recommendations: AI-curated focus playlists
  • Real-time Search: Fast, responsive search interface

πŸ—οΈ Architecture

System Design

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Frontend (React)                      β”‚
β”‚              Developed by: Safia Liaqat                  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  β€’ React Components      β€’ State Management             β”‚
β”‚  β€’ Responsive UI         β€’ API Integration              β”‚
β”‚  β€’ Modern CSS            β€’ Real-time Updates            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚
                     β”‚ REST API Calls
                     β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                Backend (Flask + Python)                  β”‚
β”‚                Developed by: Ahmad                       β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  β€’ Flask REST API        β€’ AI Integration               β”‚
β”‚  β€’ Gemini 2.5 pro        β€’ Data Processing              β”‚
β”‚  β€’ File Management       β€’ Authentication               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚                     β”‚
          β–Ό                     β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚ Gemini   β”‚          β”‚Cloudinaryβ”‚
    β”‚ 2.5 pro  β”‚          β”‚  Storage β”‚
    β”‚   API    β”‚          β”‚   API    β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Tech Stack

Frontend (Safia Liaqat)

  • Framework: React.js 18+
  • Styling: Modern CSS3, Flexbox, Grid
  • State Management: React Hooks (useState, useEffect)
  • HTTP Client: Fetch API / Axios
  • UI Features:
    • Responsive Design
    • Smooth Animations
    • Loading States
    • Error Handling
    • Real-time Updates

Backend (Ahmad)

  • Framework: Flask 3.0+
  • Language: Python 3.8+
  • AI Model: Google Gemini 2.5 pro
  • Translation: Deep Translator
  • Storage: Cloudinary (cloud) + Local filesystem
  • API Design: RESTful architecture
  • Authentication: Flask sessions
  • Logging: Comprehensive error tracking

AI & NLP

  • google-generativeai: Gemini 2.5 pro integration
  • deep-translator: Multi-language translation
  • speech-recognition: Voice input support

Cloud Services

  • Cloudinary: Cloud file storage
  • Google AI: Gemini API

πŸš€ Installation

Prerequisites

  • Python 3.8 or higher
  • Node.js 16+ and npm
  • pip (Python package manager)
  • Git
  • Google account (for Gemini API key)

Step 1: Clone the Repository

git clone https://github.com/ck-ahmad/student-ai-assistant.git
cd student-ai-assistant

Step 2: Backend Setup (Ahmad's Part)

Create Virtual Environment

Windows:

python -m venv venv
venv\Scripts\activate

Mac/Linux:

python3 -m venv venv
source venv/bin/activate

Install Backend Dependencies

pip install -r requirements.txt

Step 3: Frontend Setup (Safia's Part)

# Navigate to frontend directory (if separate)
cd frontend

# Install React dependencies
npm install

# Or if using single-page setup
# Frontend is already integrated in templates/

Step 4: Set Up Environment Variables

Create a .env file in the root directory:

cp .env.example .env

Edit .env and add your API keys:

# Required: Google Gemini API Key
GEMINI_API_KEY=your_gemini_api_key_here

# Optional: Cloudinary (for cloud file storage)
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret

# Flask Configuration
FLASK_ENV=development
FLASK_DEBUG=True
SECRET_KEY=your_secret_key_here

Step 5: Run the Application

Start Backend Server (Ahmad's Part)

# Make sure virtual environment is activated & can work without it
python app.py

Backend will run on: http://localhost:5000

Start Frontend (Safia's Part)

# If using separate React dev server
npm start

# Or access directly through Flask
# Frontend is served through Flask templates

The application will be available at: http://localhost:5000


πŸ”‘ Configuration

Getting API Keys

1. Google Gemini API Key (Required - 100% Free)

  1. Visit: https://makersuite.google.com/app/apikey
  2. Sign in with your Google account
  3. Click "Create API Key"
  4. Copy the key and add to .env

Free Tier Limits:

  • βœ… 60 requests per minute
  • βœ… 1,500 requests per day
  • βœ… 1 million tokens per minute
  • βœ… No credit card required!

2. Cloudinary (Optional - Free Tier)

  1. Sign up: https://cloudinary.com/users/register/free
  2. Go to Dashboard
  3. Copy Cloud Name, API Key, and API Secret
  4. Add to .env

Free Tier Includes:

  • βœ… 25 GB storage
  • βœ… 25 GB bandwidth/month
  • βœ… No credit card required

Note: If you skip Cloudinary, the app will use local storage automatically.


πŸ“– Usage

Basic Workflow

1. Create and Manage Notes

1. Navigate to /notes
2. Enter a topic name
3. Write your note
4. Check "Enhance with AI" for automatic improvements
5. Click "Add Note"

Frontend (React): Beautiful form with real-time validation
Backend (Flask): AI processing with Gemini 2.5 Pro

2. Upload Study Materials

1. Navigate to /drive
2. Choose "Upload File" or "Add Link"
3. Select semester, degree, and subject
4. Upload or paste link
5. Add optional description

Frontend (React): Drag-and-drop file upload interface
Backend (Flask): File processing and cloud storage integration

3. Generate and Take Quizzes

1. Navigate to /quiz
2. Enter topic name
3. Choose question count and difficulty
4. Generate quiz
5. Take quiz and get instant feedback

Frontend (React): Interactive quiz UI with smooth transitions
Backend (Flask): AI quiz generation and evaluation


πŸ“ Project Structure

student-ai-assistant/
β”‚
β”œβ”€β”€ Backend (Ahmad's Work)/
β”‚   β”œβ”€β”€ app.py                      # Main Flask application
β”‚   β”œβ”€β”€ notes_ai.py                 # Notes AI with Gemini 1.5 Flash
β”‚   β”œβ”€β”€ drive_manager_ai.py         # File management with AI
β”‚   β”œβ”€β”€ health_tracker_ai.py        # Health information with AI
β”‚   β”œβ”€β”€ quiz_generator_ai.py        # Quiz generation with AI
β”‚   β”œβ”€β”€ search_engine_ai.py         # Smart search with AI
β”‚   └── requirements.txt            # Python dependencies
β”‚
β”œβ”€β”€ Frontend (Safia's Work)/
β”‚   β”œβ”€β”€ templates/                  # HTML templates with React
β”‚   β”‚   β”œβ”€β”€ index.html             # Landing page
β”‚   β”‚   β”œβ”€β”€ notes.html             # Notes interface
β”‚   β”‚   β”œβ”€β”€ drive.html             # Drive manager
β”‚   β”‚   β”œβ”€β”€ health.html            # Health tracker
β”‚   β”‚   β”œβ”€β”€ quiz.html              # Quiz generator
β”‚   β”‚   └── search.html            # Search engine
β”‚   β”‚
β”‚   β”œβ”€β”€ static/                     # Frontend assets
β”‚   β”‚   β”œβ”€β”€ css/                   # Stylesheets
β”‚   β”‚   β”œβ”€β”€ js/                    # React components
β”‚   β”‚   └── images/                # Images and icons
β”‚   β”‚
β”‚   └── components/                 # React components (if separate)
β”‚
β”œβ”€β”€ Data Storage/
β”‚   β”œβ”€β”€ uploads/                    # Temporary file uploads
β”‚   β”œβ”€β”€ drive_files/               # Local file storage
β”‚   β”œβ”€β”€ notes/                     # Notes text files
β”‚   └── *.json                     # Database files
β”‚
β”œβ”€β”€ Configuration/
β”‚   β”œβ”€β”€ .env                       # Environment variables
β”‚   β”œβ”€β”€ .env.example              # Environment template
β”‚   β”œβ”€β”€ .gitignore                # Git ignore file
β”‚   └── requirements.txt          # Python dependencies
β”‚
└── Documentation/
    β”œβ”€β”€ README.md                 # This file
    └── LICENSE                   # MIT License

πŸ”Œ API Documentation (Backend - Ahmad)

Base URL

http://localhost:5000/api

Notes API

Create Note

POST /api/notes/create
Content-Type: application/json

{
    "topic": "Python Programming",
    "note": "Functions are reusable blocks of code",
    "use_ai": true
}

Response:
{
    "success": true,
    "message": "Note added successfully! (AI Enhanced)",
    "enhanced_note": "Improved note text..."
}

View Notes

POST /api/notes/view
Content-Type: application/json

{
    "topic": "Python Programming"
}

Response:
{
    "success": true,
    "notes": [
        {"id": 1, "text": "Note content..."},
        {"id": 2, "text": "Another note..."}
    ]
}

Summarize Notes

POST /api/notes/summarize
Content-Type: application/json

{
    "topic": "Python Programming"
}

Response:
{
    "success": true,
    "summary": "AI-generated summary..."
}

Quiz API

Generate Quiz

POST /api/quiz/generate-from-topic
Content-Type: application/json

{
    "topic": "Machine Learning",
    "num_questions": 10,
    "difficulty": "medium",
    "quiz_type": "mixed"
}

Response:
{
    "success": true,
    "questions": [...]
}

Evaluate Quiz

POST /api/quiz/evaluate
Content-Type: application/json

{
    "topic": "Machine Learning",
    "questions": [...],
    "answers": [...]
}

Response:
{
    "success": true,
    "score": 8,
    "total": 10,
    "percentage": 80.0,
    "results": [...],
    "overall_feedback": "Great job! ..."
}

βš›οΈ Frontend Components (React - Safia)

Component Structure

// Example: Notes Component
import React, { useState, useEffect } from 'react';

const NotesManager = () => {
    const [topic, setTopic] = useState('');
    const [note, setNote] = useState('');
    const [useAI, setUseAI] = useState(true);
    const [notes, setNotes] = useState([]);
    const [loading, setLoading] = useState(false);

    const createNote = async () => {
        setLoading(true);
        const response = await fetch('/api/notes/create', {
            method: 'POST',
            headers: {'Content-Type': 'application/json'},
            body: JSON.stringify({topic, note, use_ai: useAI})
        });
        const data = await response.json();
        setLoading(false);
        // Update UI with response
    };

    return (
        // Beautiful React JSX UI
    );
};

Key Frontend Features

  • Responsive Design: Works on all devices
  • Real-time Validation: Instant form feedback
  • Loading States: Smooth user experience
  • Error Handling: User-friendly error messages
  • Animations: Smooth transitions and effects
  • Accessibility: ARIA labels and keyboard navigation

🐍 Backend Modules (Python - Ahmad)

Module Architecture

# Example: Notes AI Module
class NotesAI:
    def __init__(self, gemini_api_key):
        genai.configure(api_key=gemini_api_key)
        self.model = genai.GenerativeModel('gemini-1.5-flash')
        
    def create_note(self, topic, note_text, use_ai=False):
        if use_ai:
            note_text = self.enhance_note_with_ai(topic, note_text)
        # Save note logic
        return {'success': True, 'message': 'Note created'}
    
    def enhance_note_with_ai(self, topic, note_text):
        # Gemini AI processing
        response = self.model.generate_content(prompt)
        return response.text

Key Backend Features

  • RESTful API Design: Clean, consistent endpoints
  • AI Integration: Gemini 2.5 Pro for responses
  • Error Handling: Comprehensive try-catch blocks
  • Logging: Track all operations and errors
  • Security: Input validation and sanitization
  • Scalability: Modular architecture for easy expansion

🀝 Contributing

We welcome contributions! Here's how our team worked:

Development Workflow

Safia's Workflow (Frontend):

  1. Design UI mockups
  2. Build React components
  3. Integrate with backend APIs
  4. Test user interactions
  5. Optimize performance

Ahmad's Workflow (Backend):

  1. Design API endpoints
  2. Implement AI features
  3. Handle data processing
  4. Test API responses
  5. Deploy backend services

How to Contribute

  1. Fork the repository
  2. Create a new branch (git checkout -b feature/AmazingFeature)
  3. Make your changes (frontend or backend)
  4. Commit your changes (git commit -m 'Add some AmazingFeature')
  5. Push to the branch (git push origin feature/AmazingFeature)
  6. Open a Pull Request

πŸ› Troubleshooting

Backend Issues (Ahmad's Domain)

🧩 "API key not valid"

Solution:
1. Check .env file has the correct key
2. Verify key starts with "AIza..."
3. Ensure there are no spaces or quotes around the key
4. Restart app.py after adding or updating the key

πŸ€– "Gemini Model not found"

Solution:
Switched to model 2.5 pro

🌐 "Translator not working"

Issue: The default translator API failed during runtime.

Solution:
1. Switched to Deep Translator for reliable multilingual support.
2. Installed using:
   pip install deep-translator
3. Updated import references in the translation module.

☁️ "Cloud Pipeline Crashing"

Issue: The pipeline crashed during multiple parallel AI calls.

Solution:
1. Added async handling and error recovery in the Flask backend.
2. Implemented retry logic for unstable API requests.
3. Optimized concurrent request limits to prevent overload.

Frontend Issues (Safia's Domain)

"Cannot connect to backend"

Solution:
1. Ensure backend is running (python app.py)
2. Check Flask is on http://localhost:5000
3. Verify CORS settings if using separate React server

"React components not loading"

Solution:
1. Clear browser cache
2. Check console for JavaScript errors
3. Verify all imports are correct

πŸ“Š Performance

Speed Metrics

image

Combined Performance: Frontend + Backend working seamlessly!


πŸŽ“ Team Contributions Summary

Safia Liaqat - Frontend Excellence

βœ… Complete React UI/UX implementation
βœ… Responsive design for all devices
βœ… Interactive components and animations
βœ… API integration and state management
βœ… User experience optimization

Ahmad - Backend Mastery

βœ… Complete Flask REST API
βœ… Gemini 2.5 Pro AI integration
βœ… All 5 AI-powered modules
βœ… File upload and cloud storage
βœ… Database and security implementation

Together: A powerful, full-stack AI application! πŸš€


πŸ”’ Security

Best Practices Implemented

Backend Security (Ahmad):

  • βœ… Input validation and sanitization
  • βœ… Secure file upload handling
  • βœ… API rate limiting
  • βœ… Environment variable protection
  • βœ… SQL injection prevention

Frontend Security (Safia):

  • βœ… XSS prevention
  • βœ… CSRF token implementation
  • βœ… Secure API calls
  • βœ… Input validation on client side
  • βœ… Secure state management

🌟 Acknowledgments

  • Safia Liaqat: For creating an beautiful, intuitive frontend
  • Ahmad: For building a robust, AI-powered backend
  • Google Gemini AI: For providing free AI API
  • Cloudinary: For free cloud storage
  • React & Flask Communities: For excellent documentation
  • Open Source Contributors: For inspiration and tools

πŸ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ› PROBLEMS & FIXES LOG βœ…

The Problems I faced wile developing this project are in Problems file with how I solved them.


πŸ“ž Contact

Project Maintainers

Safia Liaqat - Frontend Developer

  • πŸ’Ό GitHub: @safialiaqat
  • πŸ”— LinkedIn: Safia Liaqat
  • 🎯 Expertise: React, UI/UX Design, Frontend Architecture

Ahmad - Backend Developer

  • πŸ“§ Email: ahmadleo498@gmail.com
  • πŸ’Ό GitHub: @ahmad
  • πŸ”— LinkedIn: Ahmad
  • 🎯 Expertise: Python, Flask, AI Integration, Backend Architecture

Project Links


🎯 Roadmap

Version 3.0 (Future Enhancements)

Frontend (Safia's Planned Features):

  • Progressive Web App (PWA) support
  • Dark mode theme
  • Advanced animations and transitions
  • Mobile app (React Native)
  • Real-time collaboration UI

Backend (Ahmad's Planned Features):

  • User authentication system
  • Advanced AI features
  • Integration with more APIs
  • Database optimization
  • Microservices architecture

πŸ’– Support the Project

If you find this project helpful, please consider:

  • ⭐ Starring the repository
  • πŸ› Reporting bugs
  • πŸ’‘ Suggesting features
  • πŸ“– Improving documentation
  • 🀝 Contributing code (frontend or backend!)

Made with ❀️ by Safia Liaqat (Frontend - React) & Ahmad (Backend - Flask/AI)

Frontend: βš›οΈ React.js | Backend: 🐍 Flask + πŸ€– Gemini 2.5 Pro

A Perfect Full-Stack Collaboration πŸŽ“

⬆ Back to Top

About

No description, website, or topics provided.

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors