Skip to content

BenjaminTia/SpongeLearn

Repository files navigation

SpongeLearn

Convert textbooks, lecture slides, and study documents into comprehensive multi-page learning notes, flashcards, and quizzes — powered by AI.

No accounts. No sign-up. Local-first.

Quick Start

Prerequisites

  • Node.js 18+
  • PostgreSQL 14+

Setup

cd apps/web
cp ../../.env.example .env   # Edit AI_API_KEY with your key

# Install dependencies
npm install

# Push database schema
npm run db:push

# (Optional) Seed demo data
npm run db:seed

# Start dev server
npm run dev
# → http://localhost:3000

Upload a file

Drag any .pdf, .md, .txt, .docx, .pptx, or .epub file. The app will:

  1. Parse the content
  2. Extract concepts and build a knowledge map
  3. Generate Cornell-style notes with Feynman explanations
  4. Create flashcards, quizzes, and practice problems
  5. Open a full study interface

Architecture

apps/web/              # Next.js 15 + TypeScript + Tailwind
├── src/
│   ├── app/           # App Router pages + API routes
│   ├── components/    # React components (shadcn/ui + Radix)
│   └── lib/           # DB, AI, pipeline, parser
├── prisma/            # Schema + seed
└── public/            # Uploads

apps/worker/           # Python FastAPI (optional, for heavy PDFs)
packages/shared/       # Shared TypeScript types + Zod schemas

Tech Stack

Layer Tech
Frontend Next.js 15, React 19, TypeScript
Styling Tailwind CSS, shadcn/ui
Database PostgreSQL + Prisma
AI DeepSeek, OpenAI, Claude, Gemini (configurable)
File Parsing pdf-parse (PDF), native (text/markdown), Python worker (docx/pptx)

AI Provider

Set these in apps/web/.env:

AI_PROVIDER="deepseek"          # openai, claude, gemini, deepseek
AI_API_KEY="sk-..."             # Your API key
AI_MODEL="deepseek-chat"        # Model name
AI_BASE_URL="https://api.deepseek.com/v1"  # Optional custom endpoint

API Endpoints

Method Path Description
GET /api/documents List all documents
GET /api/documents/[id] Document details
DELETE /api/documents/[id] Delete document
POST /api/documents/[id]/regenerate Regenerate content
GET /api/documents/[id]/outline Document outline
GET /api/documents/[id]/concepts Concept graph
GET /api/documents/[id]/notes All note pages
GET /api/documents/[id]/notes/[id] Specific note
GET /api/documents/[id]/flashcards Flashcards
GET /api/documents/[id]/quiz Quiz
GET/POST /api/documents/[id]/progress Study progress
POST /api/upload Upload file
GET /api/process/[id] Processing status
POST /api/process/[id] Start processing
POST /api/tutor Ask AI tutor
GET/PUT /api/user/settings User preferences

About

Convert textbooks, lecture slides, and study documents into comprehensive multi-page learning notes, flashcards, and quizzes — powered by AI.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors