Skip to content

Sridattasai18/StudyFlow

Repository files navigation

📚 StudyFlow

An AI-powered study assistant — your personal NotebookLM clone built with Next.js and FastAPI.

StudyFlow lets you create research notebooks, ingest sources (PDFs, URLs, YouTube transcripts), and chat with your material using Google Gemini. It also generates study guides, flashcards, and mind maps from your notes via an AI Studio panel.


✨ Features

  • 📓 Notebooks — Organize study material into separate notebooks
  • 📥 Source Ingestion — Add PDFs, web pages, and YouTube videos as sources
  • 💬 AI Chat — Ask questions about your sources using RAG (Retrieval-Augmented Generation)
  • 🗒️ Notes — Take inline notes linked to notebooks
  • 🎓 Study Studio — Generate study guides, flashcards, and mind maps powered by Gemini
  • 🔍 Semantic Search — Local embeddings via sentence-transformers for fast, private search
  • 🗄️ Persistent Storage — PostgreSQL + ChromaDB vector store

🛠️ Tech Stack

Layer Technology
Frontend Next.js 14, TypeScript, Tailwind CSS, Tiptap, ReactFlow
Backend FastAPI, Python 3.11+, Uvicorn
Database PostgreSQL (via SQLAlchemy + asyncpg + Alembic)
Vector Store ChromaDB
Embeddings sentence-transformers (local, no API cost)
LLM Google Gemini (via google-generativeai)
PDF Parsing PyMuPDF
Web Scraping BeautifulSoup4 + httpx
YouTube youtube-transcript-api

🚀 Getting Started

Prerequisites

  • Node.js 18+ and npm
  • Python 3.11+
  • PostgreSQL (running locally or via Docker)
  • A Google Gemini API key — get one at ai.google.dev

1. Clone the Repository

git clone https://github.com/Sridattasai18/StudyFlow.git
cd StudyFlow

2. Backend Setup

cd backend

# Create and activate virtual environment
python -m venv venv
venv\Scripts\activate        # Windows
# source venv/bin/activate   # macOS/Linux

# Install dependencies
pip install -r requirements.txt

# Configure environment variables
copy .env.example .env       # Windows
# cp .env.example .env       # macOS/Linux

Edit backend/.env and fill in your values:

GEMINI_API_KEY=your_gemini_api_key_here
DATABASE_URL=postgresql+asyncpg://postgres:yourpassword@localhost:5432/studyflow
CHROMA_PERSIST_PATH=./chroma_store
UPLOAD_DIR=./storage/uploads
CORS_ORIGINS=http://localhost:3000

Run database migrations:

alembic upgrade head

Start the backend server:

uvicorn main:app --reload --port 8000

Backend will be live at http://localhost:8000. API docs at http://localhost:8000/docs.


3. Frontend Setup

# From the project root
npm install

# Configure environment variables
copy .env.local.example .env.local   # if provided

Create .env.local in the project root:

NEXT_PUBLIC_API_URL=http://localhost:8000

Start the development server:

npm run dev

Frontend will be live at http://localhost:3000.


📁 Project Structure

studyflow/
├── backend/
│   ├── api/               # FastAPI route handlers (notebooks, sources, chat, studio, notes)
│   ├── db/                # SQLAlchemy models & database engine
│   ├── services/          # Core logic: embeddings, RAG, LLM, ingestion, chunker
│   ├── alembic/           # Database migrations
│   ├── storage/           # Uploaded file storage
│   ├── chroma_store/      # ChromaDB vector data (auto-generated)
│   ├── main.py            # FastAPI app entry point
│   ├── config.py          # Settings via pydantic-settings
│   └── requirements.txt
│
├── src/
│   ├── app/               # Next.js app router pages
│   ├── components/        # UI components (chat, notes, sources, studio, layout)
│   ├── context/           # React context providers
│   ├── lib/               # API client utilities
│   └── types/             # TypeScript types
│
├── package.json
├── tailwind.config.ts
└── next.config.mjs

🔑 Environment Variables Reference

Backend (backend/.env)

Variable Description Required
GEMINI_API_KEY Google Gemini API key ✅ Yes
DATABASE_URL PostgreSQL connection string ✅ Yes
CHROMA_PERSIST_PATH Path for ChromaDB persistence ✅ Yes
UPLOAD_DIR Directory for uploaded files ✅ Yes
CORS_ORIGINS Allowed origins (comma-separated) ✅ Yes

Frontend (.env.local)

Variable Description Required
NEXT_PUBLIC_API_URL Backend API base URL ✅ Yes

📜 License

This project is licensed under the MIT License — see LICENSE for details.


👤 Author

Kaligotla Sri Datta Sai Vithal
GitHub: @Sridattasai18

About

A note space for research, study and learn Inspired by google NotebookLM.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors