Skip to content

shravanithouta108/AI_Study_Assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ“ AI Study Assistant

A full-stack AI-powered web application that helps students learn smarter β€” featuring an AI Chat tutor, MCQ Practice generator, and Notes Summarizer.


✨ Features

Feature Description
πŸ’¬ AI Chat Ask any study question and get a structured answer with a direct response and explanation
πŸ” Simplify Answer Rewrites any AI response in simple, easy-to-understand language
πŸ“ MCQ Generator Enter any topic and instantly get 5 multiple choice questions with answers and explanations
πŸ“„ Notes Summarizer Paste your notes and get bullet-point summaries and key takeaways

πŸ› οΈ Tech Stack

Layer Technology
Frontend React.js
Backend Python + Flask
AI Model Groq API (Llama 3.1 β€” free)
Styling Custom CSS (dark theme)

πŸ“ Project Structure

AI Study Assistant/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ app.py              # Flask API with 4 endpoints
β”‚   β”œβ”€β”€ requirements.txt    # Python dependencies
β”‚   └── .env                # API key (not uploaded to GitHub)
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ public/
β”‚   β”‚   └── index.html
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ App.js          # Main app with tab navigation
β”‚   β”‚   β”œβ”€β”€ App.css         # Global styles
β”‚   β”‚   └── components/
β”‚   β”‚       β”œβ”€β”€ Chat.js         # AI Chat component
β”‚   β”‚       β”œβ”€β”€ MCQ.js          # MCQ Practice component
β”‚   β”‚       └── Summarizer.js   # Notes Summarizer component
β”‚   β”œβ”€β”€ package.json
β”‚   └── .env                # API URL (not uploaded to GitHub)
β”œβ”€β”€ .gitignore
└── README.md

βš™οΈ Setup Instructions

Prerequisites

Make sure you have these installed:


1. Clone the Repository

git clone https://github.com/your-username/AI_Study_Assistant.git
cd AI_Study_Assistant

2. Backend Setup

cd backend

Install dependencies:

pip install flask flask-cors groq python-dotenv

Create a .env file inside the backend folder:

GROQ_API_KEY=your_groq_api_key_here

Start the backend server:

python app.py

The backend will run at: http://127.0.0.1:8000

To confirm it is working, open your browser and go to:

http://127.0.0.1:8000

You should see: {"status": "ok", "message": "AI Study Assistant API is running"}


3. Frontend Setup

Open a new terminal and run:

cd frontend

Install dependencies:

npm install

Create a .env file inside the frontend folder:

REACT_APP_API_URL=http://127.0.0.1:8000

Start the frontend:

npm start

The app will open automatically at: http://localhost:3000


πŸ”‘ Environment Variables

File Variable Description
backend/.env GROQ_API_KEY Your free Groq API key from console.groq.com
frontend/.env REACT_APP_API_URL URL of the running backend (default: http://127.0.0.1:8000)

⚠️ Never share your .env files. They are excluded from GitHub via .gitignore.


πŸš€ Running the App (Every Time)

You need two terminals open at the same time:

Terminal 1 β€” Start Backend:

cd backend
python app.py

Terminal 2 β€” Start Frontend:

cd frontend
npm start

Then open http://localhost:3000 in your browser.


🌐 API Endpoints

Method Endpoint Description
GET / Health check
POST /chat Ask a study question
POST /simplify Simplify an AI response
POST /generate-mcq Generate 5 MCQs for a topic
POST /summarize Summarize study notes

Example Request β€” Chat

POST /chat
{
  "question": "What is Newton's Second Law?"
}

Example Response

{
  "answer": "**Direct Answer:**\nNewton's Second Law states that Force = Mass Γ— Acceleration.\n\n**Explanation:**\nThis means the greater the force applied to an object, the greater its acceleration..."
}

πŸ§ͺ How to Test Each Feature

  1. AI Chat β†’ Type What is photosynthesis? β†’ Click Ask
  2. MCQ Practice β†’ Type French Revolution β†’ Click Generate MCQs β†’ Select answers
  3. Notes Summarizer β†’ Paste any paragraph of text β†’ Click Summarize Notes

πŸ“Έ Output

Output 1

Output 2

Output 3

Output 4


πŸ“‚Additional Resources

The Lean Canvas and Project Presentation are combined into one PPT file and have been pushed to this repository for viewing and reference.

πŸ› Common Issues

Problem Fix
Failed to fetch error in app Make sure the backend is running (python app.py)
ERR_CONNECTION_REFUSED Backend is not running β€” start it first
model_decommissioned error Change model in app.py to llama-3.1-8b-instant
npm install fails Run npm install --legacy-peer-deps
Port 3000 already in use Press Y when asked to use another port

πŸ‘€Live Demo

The AI Study Assistant is deployed and accessible online:

Website: https://shravanis-ai-study-assistant.vercel.app/


πŸ“„ License

This project is open source and available under the MIT License.


πŸ™‹β€β™€οΈ Author

Made with ❀️ by Shravani Thouta

If you found this helpful, give it a ⭐ on GitHub!

About

πŸŽ“ AI-powered study tool with Chat Tutor, MCQ Generator & Notes Summarizer | Built with React, Flask, Python & Groq API (Free LLM)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors