Thanks to visit codestin.com
Credit goes to github.com

Skip to content

mizzleinetimi/jacker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jackqr

Offline AI-powered study companion for students. Transform chaotic PDFs into readable content and master your courses with AI-graded flashcards—no internet required.

On-Device Offline First iOS 17+


The Problem

In Nigeria (and across Africa), most university students can't afford textbooks. A single textbook can cost more than a month's allowance. So students share PDFs—scanned lecture notes, photographed textbook pages, materials passed around on WhatsApp groups.

But these PDFs are often terrible:

  • Poorly scanned and badly formatted
  • 200+ pages of dense, unstructured text
  • Nearly impossible to read on a phone
  • No way to search or navigate efficiently

On top of that, internet data is expensive and unreliable. Cloud-based AI tools aren't an option when your data runs out mid-study session.

jackqr solves this by bringing AI-powered study tools completely offline.


Features

📚 Document Processing

  • Import PDFs or images of textbook pages
  • On-device OCR extracts text from even poorly scanned documents
  • Intelligent chunking breaks content into digestible sections
  • AI-powered simplification rewrites complex passages while preserving core concepts

📖 Smart Reading

  • Clean, formatted text that's easy to read on any screen
  • Navigate through content in logical chunks
  • Simplify difficult sections on-demand with a single tap

🎴 Flashcard System with AI Grading

  • Create flashcard decks from your study materials
  • Import existing flashcards via CSV/JSON
  • SM-2 spaced repetition algorithm optimizes review timing
  • On-device AI grades your answers—understands context and semantic meaning, not just exact matches
  • Track progress and focus on what you need to review

🔒 100% Offline

  • Everything runs locally after initial model download
  • No subscriptions, no cloud fees, no data costs
  • Works in areas with poor or no internet connectivity

Technical Stack

Component Technology
Framework SwiftUI
AI Inference MediaPipe Tasks GenAI (Gemma models)
OCR Apple Vision Framework
Persistence SwiftData
PDF Processing PDFKit

On-Device AI Models

Model Size RAM HuggingFace Token Best For
Gemma 3N 2B ~2.9GB 4GB+ ❌ No Recommended - best balance of quality and speed
Gemma 3N 4B ~4GB 6GB+ ❌ No Higher quality, slower inference
Gemma 3 1B ~600MB 3GB+ ✅ Yes Good performance on most devices
Gemma 3 270M ~290MB 2GB+ ✅ Yes Lightweight, for older devices

⭐ = Recommended

Note: Gemma 1B and 270M models are hosted on HuggingFace and require a free access token. Get one at huggingface.co/settings/tokens and enter it in Settings before downloading.


How It Works

Document Flow

  1. Import PDF or capture image of textbook page
  2. Vision framework extracts text via OCR
  3. Text chunker segments content at natural boundaries
  4. AI simplifier rewrites complex passages (optional)
  5. Read through clean, navigable content

Flashcard Grading

The AI grader uses a simple YES/NO/PARTIAL prompt for reliability on small models:

Question: What is the powerhouse of the cell?
Expected: Mitochondria
User Answer: The mitochondria produces ATP energy

AI Response: YES (semantically equivalent)

Fallback to string similarity with semantic bonuses ensures grading works even if the model returns empty responses.


Setup

Requirements

  • iOS 17.0+
  • ~3-4GB storage for AI models
  • 4GB+ RAM recommended (for Gemma 2B)
  • iPhone with A12 chip or newer recommended

Installation

git clone https://github.com/inetimimizzle/jackqr.git
cd jackqr
pod install
open Pic2PDF.xcworkspace

First Run

  1. Build and run the app
  2. Navigate to Settings
  3. For Gemma 1B/270M: Enter your HuggingFace token first (expand "HuggingFace Token" section)
  4. Download your preferred AI model (Gemma 2B recommended - no token needed)
  5. Start importing documents or creating flashcards

Project Structure

Pic2PDF/
├── Models/
│   ├── Document.swift          # Document data model
│   └── Flashcard.swift         # Flashcard & Deck models
├── Services/
│   ├── DocumentManager.swift   # Document persistence
│   ├── TextExtractor.swift     # OCR service
│   ├── TextChunker.swift       # Content segmentation
│   ├── TextSimplifier.swift    # AI simplification
│   ├── FlashcardManager.swift  # Flashcard persistence
│   └── FlashcardGrader.swift   # AI grading service
├── Views/
│   ├── LibraryView.swift       # Document library
│   ├── ReaderView.swift        # Document reader
│   ├── FlashcardsView.swift    # Flashcard decks
│   ├── DeckDetailView.swift    # Deck management
│   └── ReviewSessionView.swift # Study session UI
├── OnDeviceLLMService.swift    # Core LLM inference
├── ModelDownloadManager.swift  # Model management
└── ContentView.swift           # Main navigation

Flashcard Import Format

CSV

question,answer
What is photosynthesis?,The process by which plants convert sunlight into energy
What is the capital of Nigeria?,Abuja

JSON

[
  {"question": "What is photosynthesis?", "answer": "The process by which plants convert sunlight into energy"},
  {"question": "What is the capital of Nigeria?", "answer": "Abuja"}
]

Privacy

jackqr is privacy-first by design:

  • Zero data collection
  • 100% on-device processing
  • No cloud servers or analytics
  • No accounts required
  • Works completely offline

See PRIVACY.md for full details.


License

MIT License


Acknowledgments

  • Google MediaPipe Team - On-device AI inference framework
  • Google Gemma Team - Open-source language models
  • Apple - Vision framework for OCR

Built for students who make the most of what they have. 📚

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published