Skip to content

Repository files navigation

StudySync AI 📚

A Personalized AI Learning & Productivity Companion

Python · Flask · SQLite · Google Gemini AI


🎯 What is StudySync AI?

StudySync AI is a full-stack, Python-first AI-powered educational platform designed for students who want to study smarter. It combines an AI tutor, smart study planner, quiz generator, real-time progress tracker, and exam readiness predictor — all in a single beautifully themed web application.

Built for: Internship portfolios, GitHub showcases, LinkedIn, and job applications.


✨ Features

Feature Description
🤖 AI Tutor Personalized explanations for any subject/topic with 4 difficulty modes
📅 Study Planner AI-generated step-by-step study schedules
📝 Sticky Notes Pinnable color-coded notes for formulas, reminders, and concepts
🔗 Resource Manager Save PDFs, articles, Google Drive links, and YouTube videos
🎯 Quiz Generator Auto-generated MCQs + short-answer questions with scoring
📊 Analytics Dashboard Score trends, accuracy, strong/weak topic analysis
🏆 Exam Readiness AI-predicted readiness percentage with confidence levels
📈 Live Progress Real-time tracking of chapters, streaks, sessions, and goals
🎨 Personalised Themes Auto-assigned Pink (Female) or Blue (Male) dashboard
🔒 Auth System Secure registration/login with password hashing
💾 Persistent Storage All data saved in SQLite — survives logout and return

🗂️ Project Structure

StudySyncAI/
│
├── app.py               ← Flask app + all routes
├── ai_engine.py         ← AI logic (Gemini + fallback)
├── models.py            ← SQLite data-access layer
├── database.py          ← DB init + connection
├── study_planner.py     ← Study plan generation
├── quiz_generator.py    ← Quiz creation + scoring
├── progress_tracker.py  ← Streak + progress tracking
├── analytics.py         ← Performance analytics
├── url_extractor.py     ← Extract text from URLs
├── utils.py             ← Shared helpers
│
├── templates/
│   ├── base.html        ← Base layout
│   ├── index.html       ← Landing page
│   ├── auth.html        ← Login / Register
│   ├── gender.html      ← Theme personalisation
│   ├── setup.html       ← Study session setup
│   ├── dashboard.html   ← Main dashboard (all features)
│   ├── quiz.html        ← Quiz interface
│   ├── quiz_result.html ← Quiz results
│   ├── analytics.html   ← Analytics dashboard
│   ├── readiness.html   ← Exam readiness dashboard
│   ├── history.html     ← Study history
│   └── error.html       ← Error pages
│
├── static/
│   ├── css/
│   │   ├── main.css        ← Base styles
│   │   ├── theme-blue.css  ← Male/default blue theme
│   │   └── theme-pink.css  ← Female pink pastel theme
│   └── js/
│       └── main.js         ← Minimal JS utilities
│
├── instance/
│   └── studysync.db     ← SQLite database (auto-created)
│
├── requirements.txt
├── Procfile             ← Gunicorn for Render/Heroku
├── runtime.txt          ← Python 3.11
└── README.md

🛠️ Tech Stack

Layer Technology
Backend Python 3.11 + Flask 3.0
Database SQLite (via Python's built-in sqlite3)
AI Engine Google Gemini 1.5 Flash (with offline fallback)
Frontend HTML5 + CSS3 (minimal, no framework)
Interactivity Vanilla JS (minimal — only for UI micro-interactions)
Auth Session-based + SHA-256 password hashing
Deployment Render (Gunicorn WSGI)

Python is the dominant technology — all business logic, AI processing, database operations, routing, and data transformation lives in Python modules.


🚀 Local Setup

1. Clone the repository

git clone https://github.com/yourusername/StudySyncAI.git
cd StudySyncAI

2. Create virtual environment

python -m venv venv

# Activate on Windows:
venv\Scripts\activate

# Activate on Mac/Linux:
source venv/bin/activate

3. Install dependencies

pip install -r requirements.txt

4. Set up environment variables

# Copy example env file
cp .env.example .env

# Edit .env and add your keys:
# GEMINI_API_KEY=your_google_gemini_api_key_here
# SECRET_KEY=any_random_secret_string

Note: The app works fully without a GEMINI_API_KEY — it uses an intelligent built-in fallback engine. Add the key to enable live Gemini AI responses.

5. Run the application

python app.py

Open your browser at http://localhost:5000


🌐 Deploy on Render (Free)

Step 1: Push to GitHub

git init
git add .
git commit -m "Initial commit: StudySync AI"
git remote add origin https://github.com/yourusername/StudySyncAI.git
git push -u origin main

Step 2: Create a Render account

Go to render.com and sign up with GitHub.

Step 3: Create a new Web Service

  1. Click New → Web Service
  2. Connect your GitHub repository
  3. Configure the service:
Setting Value
Environment Python 3
Build Command pip install -r requirements.txt
Start Command gunicorn app:app --bind 0.0.0.0:$PORT --workers 2 --timeout 120
Instance Type Free

Step 4: Set Environment Variables

In the Render dashboard → Environment → Add the following:

Key Value
SECRET_KEY Any random secret string (e.g. studysync-prod-secret-2024)
GEMINI_API_KEY Your Google Gemini API key (optional)

Step 5: Deploy

Click Create Web Service. Render will automatically build and deploy your app.

Your app will be live at: https://your-app-name.onrender.com

Free tier note: On Render's free plan, the app spins down after 15 minutes of inactivity. The first request after that takes ~30 seconds to wake up. This is normal.


🔑 Getting a Free Gemini API Key

  1. Go to Google AI Studio
  2. Sign in with your Google account
  3. Click Create API Key
  4. Copy the key and add it as GEMINI_API_KEY in your .env or Render environment

The free tier is very generous — more than enough for a student portfolio project.


📸 Application Walkthrough

1. Landing Page

Clean modern landing page with hero section, features grid, and how-it-works steps.

2. Register / Login

Secure registration and login with SHA-256 password hashing and SQLite persistence.

3. Gender Selection → Theme

After first login, users choose their gender. The app automatically applies:

  • Female → Soft pink pastel theme with rounded UI
  • Male → Professional blue navy theme

4. Study Setup

Enter subject (from dropdown or custom), topic, difficulty level, study goal, and optional material (URL or pasted text).

5. Dashboard

The main screen with 10 live sections:

  • AI Tutor explanation (regeneratable)
  • AI Study Plan
  • Key Concepts
  • Related Topics
  • Live Progress Dashboard
  • Goal Tracker
  • Sticky Notes
  • Study Links
  • YouTube Learning Links
  • Quiz History

6. Quiz → Results → Analytics

Take an auto-generated quiz, see detailed results with AI feedback, then view your full performance analytics dashboard.

7. Exam Readiness

View your AI-predicted exam readiness percentage with confidence level, likelihood of passing, and breakdown by component.


🧠 AI Engine Details

The ai_engine.py module:

  1. Checks for GEMINI_API_KEY at startup
  2. If available → sends structured prompts to Gemini 1.5 Flash
  3. If not available (or API fails) → uses the built-in deterministic fallback engine

The fallback engine generates contextually relevant explanations, study plans, quizzes, and feedback without any external API — ensuring the app is always fully functional.

All AI content is difficulty-aware (Beginner / Intermediate / Advanced / Exam Mode) and goal-aware (Understand / Revise / Exam Prep etc).


🗃️ Database Schema

users              → id, username, email, password, gender
study_sessions     → subject, topic, difficulty, goal, material, AI content
notes              → title, content, color, pinned
study_links        → title, url, type, subject
youtube_links      → title, url, description, subject
goal_tasks         → task, completed
quiz_history       → questions, answers, score, time
progress           → sessions, streak, study_minutes, weekly_data
analytics_snapshots → accuracy, strong/weak topics

📊 Progress Tracking Logic

  • Streak: increments on consecutive study days, resets if a day is missed
  • Topic mastered: incremented when a chapter is marked complete
  • Weekly minutes: tracked per ISO week for consistency charts
  • Readiness score: weighted combination of quiz avg (40%), task completion (25%), streak (15%), revision (10%), sessions (10%)

👩‍💻 Portfolio Notes

This project demonstrates:

  • ✅ Python-first full-stack web development
  • ✅ Flask routing, sessions, and template rendering
  • ✅ SQLite database design and CRUD operations
  • ✅ Integration of a real AI/LLM API (Google Gemini)
  • ✅ Graceful fallback when API is unavailable
  • ✅ URL text extraction with standard library + BeautifulSoup
  • ✅ Live dashboard with JSON API and auto-refresh
  • ✅ Multi-session persistent study history
  • ✅ Personalised theming system
  • ✅ Production deployment to Render with Gunicorn

📄 License

MIT License — free to use, modify, and distribute.


Built with ❤️ using Python, Flask, and Google Gemini AI

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages