Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ“ EduSathi

AI-Powered Study Companion for Everyone

⚠️ This project is under active development β€” features may change, break, or be incomplete.

A full-stack educational platform that uses RAG (Retrieval-Augmented Generation) and LLMs to help students learn from their own study materials β€” with AI tutoring, adaptive quizzes, exam simulations, flashcards, an AI study planner, and progress tracking.


✨ Features

πŸŽ’ Student Portal

Feature Description
AI Chat Tutor Ask questions from your uploaded PDFs β€” answers grounded in your study material
Quiz Arena AI-generated MCQs with adaptive difficulty based on your performance
Exam Room Timed mock exams with countdown timer and instant scoring
Flashcards Auto-generated flashcards from your notes for quick revision
AI Study Planner Set exam dates and let AI map out daily study cards on a calendar
Paper Analysis AI-powered topic extraction from past question papers
Progress Analytics Track quizzes, scores, topic mastery with visual charts
Dashboard Personalized overview with metrics, score trends, and quick actions

πŸ‘¨β€πŸ« Faculty Portal

Feature Description
Student Analytics View all quiz attempts, filter by subject, monitor performance

βš™οΈ Admin Portal

Feature Description
User Management View, search, promote/demote roles, delete accounts
Question Paper Upload Ingest past papers into the RAG knowledge base

πŸ”’ Role-Based Access Control

  • Students β€” Access to all learning tools
  • Faculty β€” Student analytics and performance monitoring
  • Admin β€” Full access including user management and paper uploads

πŸ—οΈ Tech Stack

Layer Technology
Frontend React 18 + TypeScript + Vite + Tailwind CSS
Backend API FastAPI + Uvicorn
LLM Groq API β†’ LLaMA 3.3 70B Versatile
RAG Pipeline LangChain + FAISS vector store + Sentence Transformers
Embeddings all-MiniLM-L6-v2 (384-dim)
Database SQLite (users, quiz attempts, documents, progress)
Auth bcrypt password hashing + Google OAuth
PDF Processing pdfplumber + PyPDF2
Reports ReportLab PDF generation

πŸš€ Quick Start

Prerequisites

1. Clone the Repository

git clone https://github.com/YOUR_USERNAME/edusathi.git
cd edusathi

2. Set Up the Backend

# Create and activate a virtual environment
python -m venv venv

# Windows
venv\Scripts\activate

# macOS / Linux
source venv/bin/activate

# Install Python dependencies
pip install -r requirements.txt

3. Configure Environment Variables

# Copy the example env file
cp .env.example .env    # macOS/Linux
copy .env.example .env  # Windows

Edit .env and add your keys:

GROQ_API_KEY=gsk_your_groq_api_key_here
DB_PATH=./data/users.db
VECTOR_STORE_DIR=./data/vector_stores
EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2
LLM_MODEL=llama-3.3-70b-versatile
SECRET_KEY=change_this_to_a_random_secret
APP_ENV=production
VITE_GOOGLE_CLIENT_ID=your_google_client_id_here

4. Set Up the Frontend

cd frontend
npm install
cd ..

5. Run the App (Development)

You need two terminals running simultaneously:

Terminal 1 β€” Backend API (FastAPI):

uvicorn backend.main:app --reload --port 8000

Terminal 2 β€” Frontend Dev Server (Vite):

cd frontend
npm run dev

Open http://localhost:5173 in your browser.

The Vite dev server automatically proxies /api requests to the FastAPI backend on port 8000.


🏭 Production Build

To build the frontend for production:

cd frontend
npm run build

This creates a frontend/dist/ folder. The FastAPI server automatically serves these static files when the dist directory exists β€” so you only need to run:

uvicorn backend.main:app --host 0.0.0.0 --port 8000

πŸ“ Project Structure

edusathi/
β”œβ”€β”€ .env.example                # Environment variable template
β”œβ”€β”€ .gitignore
β”œβ”€β”€ requirements.txt            # Python dependencies
β”œβ”€β”€ LICENSE
β”œβ”€β”€ README.md
β”‚
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ main.py                 # FastAPI app entry point
β”‚   └── api/
β”‚       β”œβ”€β”€ auth.py             # Login, register, Google OAuth endpoints
β”‚       β”œβ”€β”€ chat.py             # Chat tutor + document upload endpoints
β”‚       β”œβ”€β”€ quiz.py             # Quiz generation + submission endpoints
β”‚       β”œβ”€β”€ flashcards.py       # Flashcard generation endpoints
β”‚       β”œβ”€β”€ analytics.py        # Dashboard stats + report endpoints
β”‚       β”œβ”€β”€ planner.py          # AI study planner endpoints
β”‚       └── admin.py            # Admin user/document management
β”‚
β”œβ”€β”€ modules/                    # Shared business logic (used by backend)
β”‚   β”œβ”€β”€ auth.py                 # DB operations, user management
β”‚   β”œβ”€β”€ llm_client.py           # Groq LLM wrapper (chat, MCQ gen, analysis)
β”‚   β”œβ”€β”€ rag_pipeline.py         # PDF ingestion + FAISS vector retrieval
β”‚   β”œβ”€β”€ quiz_engine.py          # Quiz session management
β”‚   β”œβ”€β”€ flashcard_generator.py  # LLM-powered flashcard creation
β”‚   β”œβ”€β”€ progress_tracker.py     # Score tracking + mastery calculation
β”‚   β”œβ”€β”€ report_generator.py     # PDF report generation
β”‚   └── validation.py           # Input sanitization + security validators
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ package.json
β”‚   β”œβ”€β”€ vite.config.ts          # Vite config with API proxy
β”‚   β”œβ”€β”€ tailwind.config.js
β”‚   β”œβ”€β”€ tsconfig.json
β”‚   └── src/
β”‚       β”œβ”€β”€ main.tsx            # React entry point
β”‚       β”œβ”€β”€ App.tsx             # Full SPA β€” all pages and components
β”‚       └── index.css           # Global styles + design system
β”‚
└── data/
    └── .gitkeep                # Auto-created: users.db, vector_stores/

πŸ”‘ Environment Variables

Variable Required Description
GROQ_API_KEY βœ… Your Groq API key for LLM access
VITE_GOOGLE_CLIENT_ID ❌ Google OAuth client ID for sign-in
DB_PATH ❌ SQLite database path (default: ./data/users.db)
VECTOR_STORE_DIR ❌ FAISS vector store directory (default: ./data/vector_stores)
EMBEDDING_MODEL ❌ Sentence transformer model (default: all-MiniLM-L6-v2)
LLM_MODEL ❌ Groq model name (default: llama-3.3-70b-versatile)
SECRET_KEY ❌ App secret for session security
APP_ENV ❌ development or production

πŸ‘€ Test Accounts

After first run, register new accounts through the app. To test role-based access:

  1. Register a new account (defaults to student role)
  2. To create an admin or faculty account, update the role in the database:
sqlite3 data/users.db
UPDATE users SET role = 'admin' WHERE email = 'your@email.com';
.quit

πŸ› οΈ Troubleshooting

App shows "GROQ_API_KEY not configured"

Make sure your .env file exists in the project root and contains a valid key:

GROQ_API_KEY=gsk_xxxxxxxxxxxxx

Get a free key at console.groq.com/keys

Frontend can't connect to the backend

Make sure the FastAPI server is running on port 8000:

uvicorn backend.main:app --reload --port 8000

The Vite dev server proxies /api requests to localhost:8000 automatically.

ModuleNotFoundError on import

Ensure you activated your virtual environment and installed dependencies:

venv\Scripts\activate   # Windows
pip install -r requirements.txt
PDF upload fails or returns empty results
  • Ensure the PDF has selectable text (not scanned images)
  • Check file size is under 50MB
  • Verify your Groq API key is valid and has remaining quota

🀝 Contributing

EduSathi is under active development and contributions are welcome!

How to Contribute

  1. Fork this repository
  2. Create a feature branch: git checkout -b feature/your-feature-name
  3. Commit your changes: git commit -m "Add: your feature description"
  4. Push to your fork: git push origin feature/your-feature-name
  5. Open a Pull Request with a clear description of what you changed and why

Ideas for Contributions

  • πŸ› Bug fixes and error handling improvements
  • 🎨 UI/UX enhancements and accessibility improvements
  • πŸ“± Mobile responsiveness tweaks
  • πŸ§ͺ Adding tests (unit tests, integration tests)
  • πŸ“ Documentation improvements
  • 🌐 Internationalization / localization support
  • ⚑ Performance optimizations
  • πŸ”§ New features (check Issues for ideas)

Please open an issue first if you plan a large change β€” so we can discuss the approach before you invest time.


πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.


Built with ❀️ for Everyone

About

No description, website, or topics provided.

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages