Skip to content

Open Source AI Based Learning Platform (Quizzes, Flashcards, Learning Paths, Courses, etc)

Notifications You must be signed in to change notification settings

Vashishta-Mithra-Reddy/sift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

45 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ”˜ Sift

Transform Passive Consumption into Active Mastery

An AI-powered active recall engine that turns any content into a precision-engineered learning experience.

Next.js TypeScript Tailwind CSS License

Features โ€ข Architecture โ€ข Getting Started โ€ข Documentation


๐Ÿ“– What is Sift?

Sift is a minimalist active recall engine designed for students, professionals, and lifelong learners who want to truly master what they studyโ€”not just passively consume it. Built on the science of active recall and spaced repetition, Sift transforms your study materials into an engaging, flow-state learning experience.

The Philosophy

"Friction is the Enemy" โ€” The time between "I have content" and "I'm being quizzed" should be less than 10 seconds.

Sift prioritizes:

  • ๐ŸŽฏ Grounded Intelligence: AI generates questions strictly from your contentโ€”no hallucinations
  • โšก Zero Friction: Upload โ†’ Generate โ†’ Learn in seconds
  • ๐Ÿง˜ Zen Mode: Distraction-free, flow-state study sessions
  • ๐Ÿ“ฑ Mobile-First: Progressive Web App that works everywhere
  • ๐ŸŽจ Beautiful Design: Clean, dark-mode-first interface that reduces eye strain

โœจ Features

Core Functionality

๐Ÿ“ค Multi-Format Content Ingestion

  • Upload PDFs, Markdown, or text files
  • Paste text directly or URLs for instant processing
  • Future: Audio transcription and video content support

๐Ÿค– AI-Powered Quiz Generation

  • Automatically generates questions from your content using Google's Gemini AI
  • Multiple question formats:
    • Flashcards for recall practice
    • Multiple Choice for recognition testing
    • Socratic Questions for deep understanding
  • Configurable depth: Shallow (key concepts) vs. Deep (detailed coverage)

๐ŸŽ“ Learning Paths

  • Create structured, long-term learning goals (e.g., "Master React")
  • AI generates progressive curriculum based on your progress
  • Tracks what you've learned to suggest next steps
  • Continuity across multiple study sessions

๐Ÿ“Š Mastery Tracking (Echoes)

  • Track performance per topic across all sources
  • Visual "knowledge heatmap" showing strengths and weaknesses
  • Intelligent prioritization of weak areas in future quizzes
  • Spaced repetition system to prevent knowledge decay

๐Ÿ” Secure Authentication

  • Google OAuth integration via Better-Auth
  • Email/password authentication
  • Session management and protected routes

๐Ÿ’พ The Vault

  • Save all your sources and study materials
  • View history of all completed "Sifts" (study sessions)
  • Track scores and progress over time
  • Archive old materials while keeping your knowledge graph

User Experience

  • Keyboard-Driven Interface: Fast shortcuts for power users
  • Gesture Support: Intuitive swipe controls on mobile
  • Instant Feedback: See source snippets for wrong answers
  • Source Anchoring: Every answer links back to your original material
  • Progressive Web App: Install on any device, works offline
  • Dark Mode First: Reduced eye strain for long study sessions

๐Ÿ—๏ธ Architecture

Tech Stack

Frontend

Backend & Data

AI & Content Processing

Development Tools

  • Turborepo - Monorepo build system
  • Biome - Fast linter and formatter
  • pnpm - Fast, disk-efficient package manager

Project Structure

sift/
โ”œโ”€โ”€ apps/
โ”‚   โ””โ”€โ”€ web/                    # Main Next.js application
โ”‚       โ”œโ”€โ”€ src/
โ”‚       โ”‚   โ”œโ”€โ”€ app/            # Next.js App Router
โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ api/        # API routes
โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ dashboard/  # User dashboard
โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ sift/       # Quiz interface
โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ learn/      # Learning paths
โ”‚       โ”‚   โ”‚   โ””โ”€โ”€ explore/    # Content exploration
โ”‚       โ”‚   โ”œโ”€โ”€ components/     # React components
โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ blocks/     # Landing page sections
โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ media/      # Media components
โ”‚       โ”‚   โ”‚   โ””โ”€โ”€ ui/         # shadcn components
โ”‚       โ”‚   โ”œโ”€โ”€ hooks/          # Custom React hooks
โ”‚       โ”‚   โ””โ”€โ”€ lib/            # Utilities and helpers
โ”‚       โ””โ”€โ”€ public/             # Static assets
โ”‚
โ”œโ”€โ”€ packages/
โ”‚   โ”œโ”€โ”€ auth/                   # Authentication configuration
โ”‚   โ”‚   โ””โ”€โ”€ src/
โ”‚   โ”‚       โ”œโ”€โ”€ index.ts        # Better-Auth setup
โ”‚   โ”‚       โ””โ”€โ”€ types/          # Auth types
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ db/                     # Database layer
โ”‚   โ”‚   โ””โ”€โ”€ src/
โ”‚   โ”‚       โ”œโ”€โ”€ schema/         # Drizzle schema definitions
โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ auth.ts     # User & session tables
โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ sources.ts  # Content sources
โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ sifts.ts    # Quiz sessions
โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ echoes.ts   # Knowledge tracking
โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ flashcards.ts
โ”‚   โ”‚       โ”‚   โ””โ”€โ”€ learning-paths.ts
โ”‚   โ”‚       โ”œโ”€โ”€ queries/        # Database query functions
โ”‚   โ”‚       โ””โ”€โ”€ types/          # Type definitions
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ env/                    # Environment variable validation
โ”‚   โ””โ”€โ”€ config/                 # Shared TypeScript configs
โ”‚
โ”œโ”€โ”€ docs/                       # Documentation
โ”‚   โ”œโ”€โ”€ soul.md                 # Product vision (v1)
โ”‚   โ”œโ”€โ”€ soul_v2.md              # Updated product vision
โ”‚   โ”œโ”€โ”€ learning_system_plan.md # Technical planning
โ”‚   โ””โ”€โ”€ future.md               # Future enhancements
โ”‚
โ”œโ”€โ”€ turbo.json                  # Turborepo configuration
โ”œโ”€โ”€ pnpm-workspace.yaml         # Workspace configuration
โ”œโ”€โ”€ biome.json                  # Linting & formatting rules
โ””โ”€โ”€ package.json                # Root package configuration

Database Schema

Core Tables

sources - User-uploaded content

- id: string (primary key)
- userId: string (foreign key)
- title: string
- type: 'pdf' | 'text' | 'url' | 'audio' | 'markdown' | 'json'
- content: text (extracted content)
- metadata: json (page count, duration, etc.)
- timestamps: createdAt, updatedAt

sifts - Generated quiz sessions

- id: string (primary key)
- userId: string (foreign key)
- sourceId: string (foreign key)
- status: 'in_progress' | 'completed' | 'abandoned'
- config: json (depth, format settings)
- takeaways: json[] (key learnings)
- timestamps: createdAt, updatedAt

questions - Quiz questions

- id: string (primary key)
- siftId: string (foreign key)
- sectionId: string (optional foreign key)
- question: string
- answer: string (correct answer)
- options: json (for MCQs)
- explanation: text (source context)
- tags: string[] (topics covered)

echoes - Knowledge tracking

- id: string (primary key)
- userId: string (foreign key)
- sourceId: string (foreign key)
- topic: string
- masteryLevel: int (0-100)
- lastReviewedAt: timestamp
- Unique constraint: (userId, sourceId, topic)

learning_paths - Long-term learning goals

- id: string (primary key)
- userId: string (foreign key)
- title: string
- goal: string (user's original prompt)
- summary: text (AI progress summary)
- timestamps: createdAt, updatedAt

sift_sessions - Session tracking

- id: string (primary key)
- siftId: string (foreign key)
- userId: string (foreign key)
- status: 'in_progress' | 'completed'
- score: int
- startedAt, completedAt: timestamp

๐Ÿš€ Getting Started

Prerequisites

  • Node.js 20+ (LTS recommended)
  • pnpm 10.28.0+
  • PostgreSQL 14+ database
  • Google Cloud Account (for Gemini AI API)

Installation

  1. Clone the repository

    git clone https://github.com/Vashishta-Mithra-Reddy/sift.git
    cd sift
  2. Install dependencies

    pnpm install
  3. Set up environment variables

    Create apps/web/.env file:

    # Database
    DATABASE_URL="postgresql://user:password@localhost:5432/sift"
    DATABASE_URL_UNPOOLED="postgresql://user:password@localhost:5432/sift"
    
    # Authentication
    BETTER_AUTH_SECRET="your-secret-key-min-32-chars"
    BETTER_AUTH_URL="http://localhost:3001"
    GOOGLE_OAUTH_CLIENT_ID="your-google-oauth-client-id"
    GOOGLE_OAUTH_CLIENT_SECRET="your-google-oauth-secret"
    
    # AI
    GOOGLE_GENERATIVE_AI_API_KEY="your-gemini-api-key"
    
    # Storage (Optional - for file uploads)
    CLOUDFLARE_R2_ACCOUNT_ID="your-r2-account-id"
    CLOUDFLARE_R2_ACCESS_KEY_ID="your-access-key"
    CLOUDFLARE_R2_SECRET_ACCESS_KEY="your-secret-key"
    CLOUDFLARE_R2_BUCKET_NAME="sift-uploads"
    NEXT_PUBLIC_R2_URL="https://your-bucket-url.r2.dev"
  4. Set up the database

    # Push schema to database
    pnpm run db:push
    
    # Or run migrations
    pnpm run db:migrate
  5. Start the development server

    pnpm run dev
  6. Open the application

    Navigate to http://localhost:3001

Quick Setup with Docker (Optional)

# Start PostgreSQL with Docker
docker run -d \
  --name sift-postgres \
  -e POSTGRES_PASSWORD=password \
  -e POSTGRES_DB=sift \
  -p 5432:5432 \
  postgres:16

๐Ÿ“š Documentation

Available Scripts

Command Description
pnpm run dev Start all applications in development mode
pnpm run dev:web Start only the web application
pnpm run build Build all applications for production
pnpm run check-types Type-check all packages
pnpm run check Run Biome linter and formatter
pnpm run db:push Push schema changes to database
pnpm run db:studio Open Drizzle Studio (database GUI)
pnpm run db:generate Generate new migration files
pnpm run db:migrate Run pending migrations

Key API Routes

Endpoint Method Description
/api/ai/generate POST Generate study plan or questions
/api/sift/process POST Process uploaded content
/api/sift/[id]/status GET Get sift status and results
/api/notifications/action POST Handle push notifications
/api/auth/[...all] ALL Better-Auth routes

Environment Variables Reference

Required Variables
  • DATABASE_URL - PostgreSQL connection string (pooled)
  • DATABASE_URL_UNPOOLED - PostgreSQL connection string (direct)
  • BETTER_AUTH_SECRET - Secret key for auth (min 32 chars)
  • BETTER_AUTH_URL - Base URL of your application
  • GOOGLE_GENERATIVE_AI_API_KEY - Gemini API key
OAuth Variables
  • GOOGLE_OAUTH_CLIENT_ID - Google OAuth client ID
  • GOOGLE_OAUTH_CLIENT_SECRET - Google OAuth client secret
Storage Variables (Optional)
  • CLOUDFLARE_R2_ACCOUNT_ID - Cloudflare R2 account ID
  • CLOUDFLARE_R2_ACCESS_KEY_ID - R2 access key
  • CLOUDFLARE_R2_SECRET_ACCESS_KEY - R2 secret key
  • CLOUDFLARE_R2_BUCKET_NAME - R2 bucket name
  • CLOUDFLARE_R2_ENDPOINT - R2 endpoint URL
  • NEXT_PUBLIC_R2_URL - Public R2 URL

๐Ÿ”ง Development

Code Style

This project uses Biome for linting and formatting:

# Check and auto-fix issues
pnpm run check

# The configuration follows these rules:
# - Tabs for indentation
# - Double quotes for strings
# - Organized imports
# - Sorted Tailwind classes

Database Workflow

# Make changes to schema files in packages/db/src/schema/

# Generate migration
pnpm run db:generate

# Apply migration
pnpm run db:migrate

# Or push directly (for development)
pnpm run db:push

# Explore data with GUI
pnpm run db:studio

Turborepo Caching

Turborepo caches build outputs for faster subsequent builds:

  • Build outputs: .next/, dist/
  • Cache location: .turbo/
  • Cache is local by default (can be configured for remote caching)

๐Ÿšข Deployment

Vercel (Recommended)

  1. Connect your GitHub repository to Vercel
  2. Configure environment variables in project settings
  3. Set build command: pnpm run build
  4. Set output directory: apps/web/.next
  5. Deploy ๐Ÿš€

Docker Deployment

# Coming soon - Dockerfile for containerized deployment

Database Hosting

Recommended PostgreSQL hosting providers:


๐Ÿ—บ๏ธ Roadmap

v2.0 - The Foundation โœ… (Current)

  • Authentication system (Google OAuth + Email)
  • Responsive PWA layout
  • Content ingestion (text, files)
  • AI-powered quiz generation
  • Basic mastery tracking (Echoes)
  • Polished quiz interface

v2.1 - The Deep Dive ๐Ÿ”„ (In Progress)

  • Learning Paths implementation
  • Robust PDF/DOCX extraction
  • Detailed performance analytics
  • Spaced repetition scheduling
  • Knowledge heatmap visualization

v2.2 - The Community ๐Ÿ“… (Planned)

  • Public Sift Packs (shareable study materials)
  • Community-contributed content
  • Social learning features
  • Mobile app (React Native)

v2.3 - Advanced Features ๐Ÿ”ฎ (Future)

  • Audio transcription and processing
  • Video content support
  • Collaborative study sessions
  • Advanced analytics and insights
  • Multi-language support

๐Ÿค Contributing

Contributions are welcome! Please follow these guidelines:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes and follow the code style
  4. Run linting: pnpm run check
  5. Test your changes thoroughly
  6. Commit: git commit -m 'Add amazing feature'
  7. Push: git push origin feature/amazing-feature
  8. Open a Pull Request

Development Guidelines

  • Follow the existing code style (Biome enforces this)
  • Write meaningful commit messages
  • Update documentation for significant changes
  • Add comments for complex logic
  • Test on both desktop and mobile viewports

๐Ÿ“„ License

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


๐Ÿ™ Acknowledgments


๐Ÿ“ž Contact & Support


โฌ† back to top

Made with โค๏ธ by Vashishta Mithra Reddy

About

Open Source AI Based Learning Platform (Quizzes, Flashcards, Learning Paths, Courses, etc)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages