Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Guru-Setu-AI

Smart assistant suite for teachers — question paper generator, class summarizer, scheduler & voice assistant.


Table of contents ✅


Project overview

Guru-Setu-AI is a full-stack project aimed at helping teachers build/organize teaching material quickly. It combines:

  • PDF-based question paper generation (RAG + GenAI)
  • Video/YouTube class summarization + optional Google Classroom upload
  • Scheduler with email reminders
  • Voice assistant (Whisper STT → GenAI → TTS)

The backend is a Flask app and the frontend is a Next.js (App Router) SPA.


Architecture & Tech stack 🔧

  • Backend: Python, Flask, Flask-SQLAlchemy, Flask-Mail, APScheduler
  • Frontend: Next.js 16 (React 19), Tailwind CSS, TypeScript
  • LLMs & AI: Google GenAI (Gemini models), sentence-transformers embeddings, Chroma DB (local), Whisper for STT
  • Video & audio: yt_dlp, ffmpeg, gTTS
  • PDF generation: reportlab
  • Storage: local uploads/ and summary/ folders (dev). SQLite used for small persistent storage.

Features ✨

  • Upload PDFs and generate custom question papers using RAG + LLM.
  • Extract audio from video or download YouTube, transcribe, summarize, and export PDF summary.
  • Upload generated summary directly to Google Classroom (optional, requires credentials).
  • Scheduler UI to create reminders; backend sends email reminders via SMTP.
  • Voice assistant endpoint: upload speech, backend transcribes, runs LLM, returns TTS audio.

Quickstart — Development 🚀

Prerequisites

  • Python 3.10+ (recommended)
  • Node 18+ (for Next.js)
  • ffmpeg binary available in PATH
  • (Optional) Google Cloud credentials for Classroom API

Backend setup

  1. Create a virtual environment and install dependencies (create requirements.txt if you prefer):
python -m venv .venv
.venv\Scripts\activate   # Windows
pip install -r backend/requirements.txt  # if you add one
# or install individually
pip install flask flask_sqlalchemy flask_mail flask_cors python-dotenv sentence-transformers pypdf chromadb google-generativeai yt_dlp ffmpeg-python openai-whisper reportlab google-auth google-auth-oauthlib google-api-python-client apscheduler gTTS
  1. Add environment variables in backend/.env (see config section below).
  2. Ensure backend/credentials.json is present if you want Google Classroom integration.
  3. Start the backend:
python backend/app.py

The app will create users.db and schedule.db on first run.

Frontend setup

  1. From frontend/ folder:
cd frontend
npm install   # or pnpm install
npm run dev
  1. Open http://localhost:3000 (default Next dev port). The frontend is currently configured to call backend at http://localhost:5000.

Configuration & Environment Variables ⚙️

Place secrets in backend/.env (do NOT commit to git).

  • GEMINI_API_KEY — Google Generative AI API key
  • MAIL_USERNAME — SMTP username (Gmail used in dev config)
  • MAIL_PASSWORD — SMTP password (or app password)

Files (not committed):

  • backend/credentials.json — Google OAuth client secrets
  • backend/token.json — OAuth token saved after consent (auto-generated)

Note: backend/.gitignore already excludes these files.


APIs / Endpoints 📡

Base: http://localhost:5000

Users

  • GET /users — list users
  • GET /users/<id> — get user
  • POST /user — create user (JSON: { name, password, email })
  • PUT /users/<id> — update name
  • DELETE /users/<id> — delete

Question Generator

  • POST /submit_question (multipart/form-data)
    • Files: pdfs (multiple)
    • Fields: numQuestions, difficulty_1, ..., question_1, etc.
    • Returns: { generated_questions: [{ input: {...}, generated_question }] }

Example cURL (simplified):

curl -X POST "http://localhost:5000/submit_question" \
  -F "pdfs=@mynotes.pdf" \
  -F "numQuestions=1" \
  -F "difficulty_1=medium" \
  -F "marks_1=2" \
  -F "type_1=short" \
  -F "question_1=Explain concept X"

Class Notes & Summary

  • POST /classnotes/sendfile — form: either youtube_url or video_file (multipart). Optional upload_to_classroom=true
  • GET /classnotes/download/<job_id> — returns summary/class_summary.pdf

Scheduler

  • POST /scheduler/add — JSON: { title, time (ISO), email, remind_before }
  • GET /scheduler/<email> — list scheduled tasks for email

Voice Assistant

  • POST /voice_upload — form: audio file -> returns { teacher_text, assistant_text, tts_audio }
  • GET /voice/<file> — serves TTS audio

Data models (brief)

  • User (bind users_db) — id, name, password, email
  • Schedule (bind schedule_db) — id, title, time (DateTime UTC), remind_before (minutes), notified (bool), email

Google Classroom & OAuth notes 📚

  • To use upload to Classroom: place credentials.json (OAuth client secret) in backend/ and run the flow. The server writes token.json after user consent. The OAuth scope is limited to classroom announcements & drive file upload.
  • course_id.txt stores chosen course id after listing courses.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages