AI Study Buddy is a comprehensive, gamified learning platform... AI Study Buddy is a comprehensive, gamified learning platform built with Streamlit. It leverages Groq (Llama 3) for high-speed AI generation and Supabase for authentication and backend database management.
This application acts as a personal tutor, allowing users to generate quizzes, summaries, flashcards, mind maps, and study roadmaps while tracking progress through XP and streaks.
๐ Features ๐ง AI Learning Tools Explain Topic: Get explanations tailored to different levels (5-Year Old, High School, University).
Quiz Generator: AI-generated interactive quizzes with instant feedback.
Summarize Notes: Upload PDFs or paste text to get structured bullet-point summaries.
Mind Maps: Generate visual mind maps for complex topics (downloadable as PNG).
Flashcards: AI-generated flashcards for quick revision.
Chat with Documents (RAG): Upload a PDF and chat specifically about its content.
Exam Mode: The AI sets a question, grades your written answer, and provides feedback.
๐ฎ Gamification & Tracking XP System & Leaderboard: Earn XP for every study activity and compete globally.
Streaks: Daily tracking to keep you motivated.
Badges: Earn achievements like "Bronze Scholar" or "Week Warrior."
Smart Focus Timer: Pomodoro-style timer with Focus/Break cycles that auto-awards XP.
Weekly Progress: Visual charts of your study time.
๐ Utility Study Roadmap: Generate a day-by-day plan to learn any skill.
PWA Ready: optimized for mobile usage (Installable as a web app).
๐ ๏ธ Tech Stack Frontend: Streamlit
AI Inference: Groq API (using Llama 3 models)
Backend & Auth: Supabase
PDF Processing: PyPDF2
Visualization: Graphviz
โ๏ธ Installation & Setup
- Prerequisites Python 3.8+
A Supabase account (for Auth and Database).
A Groq API Key (for the LLM).
Graphviz installed on your system (required for the Mind Map feature).
Windows: Download Installer
Mac: brew install graphviz
Linux: sudo apt-get install graphviz
- Clone the Repository Bash
git clone https://github.com/yourusername/ai-study-buddy.git cd ai-study-buddy 3. Install Dependencies Create a requirements.txt file (if not present) with the following and install it:
Plaintext
streamlit supabase groq PyPDF2 graphviz Bash
pip install -r requirements.txt 4. Configuration (Secrets) Create a .streamlit folder in the root directory and add a secrets.toml file:
Bash
mkdir .streamlit touch .streamlit/secrets.toml Open .streamlit/secrets.toml and add your keys:
Ini, TOML
SUPABASE_URL = "your_supabase_project_url" SUPABASE_ANON_KEY = "your_supabase_anon_key" GROQ_API_KEY = "your_groq_api_key" ๐๏ธ Database Setup (Supabase) You need to create two tables in your Supabase project for the app to work. Run the following SQL in your Supabase SQL Editor:
- Create user_stats Table Stores XP, streaks, and levels.
SQL
create table user_stats ( id bigint generated by default as identity primary key, user_id uuid references auth.users not null, xp int default 0, streak int default 0, level text default 'Beginner', last_study_date text );
-- Enable Row Level Security (RLS) is recommended, -- but for a quick start you can disable it or set policies. 2. Create study_logs Table Tracks daily study minutes for the graphs.
SQL
create table study_logs ( id bigint generated by default as identity primary key, user_id uuid references auth.users not null, minutes int default 0, activity_type text, date text ); ๐โโ๏ธ Running the App Run the application using the Streamlit CLI:
Bash
streamlit run app.py Note: Replace app.py with the actual name of your Python file if it is different.
๐ฑ Mobile Support (PWA) The app includes meta tags to function like a native app on mobile devices.
Open the app URL on your mobile browser (Safari/Chrome).
Tap Share (iOS) or Menu (Android).
Select "Add to Home Screen".
It will launch in full-screen mode without the browser bar.
๐ค Contributing Contributions are welcome!
Fork the project.
Create your 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.