A research-grade spaced repetition system that uses Bayesian memory modeling for optimal review scheduling.
- Bayesian Memory Modeling: Per-card Beta posterior modeling with personalized decay rates
- Desirable Difficulty Targeting: Maintains ~80% recall rate for optimal learning
- Rich Content Support: Text and images on both sides of cards
- Cross-platform Desktop App: Built with Tauri for Mac, Windows, and Linux
- Optimized DMG Distribution: Production builds are optimized for size (~200MB vs original 777MB)
- Node.js (v16+) - Download
- Python (3.9+) - Download
- Rust and Cargo - Install via rustup
- Tauri CLI - Install with:
npm install -g @tauri-apps/cli
-
Clone the repository:
git clone <repository-url> cd bayesFlashcards
-
Install root dependencies:
npm install
-
Setup and run the backend:
cd backend pip install -r requirements.txt python app.pyThe backend will start on http://localhost:5002
-
Setup and run the frontend (in a new terminal):
cd frontend npm install npm startThe frontend will start on http://localhost:3000
-
Open your browser to http://localhost:3000
For development testing of the desktop app:
npm run tauri devThis will start both the backend and frontend automatically and launch the desktop app.
Use the automated build script that handles all steps:
chmod +x build-release.sh
./build-release.shThis script will:
- Build the React frontend
- Bundle the Python backend with optimized dependencies
- Build the Tauri desktop app
- Create platform-specific installers (DMG for macOS, MSI for Windows, etc.)
- Copy all release files to the
release/directory
If you prefer to build manually:
-
Build the frontend:
cd frontend npm install npm run build cd ..
-
Bundle the Python backend:
node scripts/bundle-python-optimized.js
-
Build the Tauri desktop app:
npm install npm run tauri build
After building, you'll find the distributables in:
- macOS:
src-tauri/target/release/bundle/macos/*.dmg - Windows:
src-tauri/target/release/bundle/msi/*.msi - Linux:
src-tauri/target/release/bundle/deb/*.debandsrc-tauri/target/release/bundle/appimage/*.AppImage - Release copies:
release/directory (created by build script)
bayesFlashcards/
├── backend/ # Python Flask API
│ ├── app.py # Main Flask application
│ ├── models.py # Database models
│ ├── bayesian/ # Bayesian modeling algorithms
│ ├── routes/ # API endpoints
│ └── requirements.txt # Python dependencies
├── frontend/ # React web application
│ ├── src/ # React source code
│ ├── public/ # Static assets
│ └── build/ # Built frontend (generated)
├── src-tauri/ # Tauri desktop app configuration
│ ├── src/ # Rust source code
│ ├── tauri.conf.json # Tauri configuration
│ ├── python-dist/ # Bundled Python backend (generated)
│ └── python-portable/ # Python runtime (generated)
├── scripts/ # Build and utility scripts
└── build-release.sh # Automated build script
GET /api/health- Health checkGET /api/decks- Get all flashcard decksGET /api/decks/{id}/cards- Get cards in a deckPOST /api/sessions- Start a study sessionPUT /api/sessions/{id}/response- Submit card response
The system uses Beta-Binomial modeling to track each card's difficulty and the user's memory strength:
- Card Difficulty: Modeled as
Beta(α_d, β_d) - Memory Strength: Modeled as
Beta(α_m, β_m) - Recall Probability: Combines difficulty and memory with decay over time
- Optimal Scheduling: Targets ~80% recall probability for desirable difficulty
-
"Network Error" in desktop app: The Python backend may be slow to start. Wait 30-60 seconds and refresh.
-
DMG size too large: Use the optimized build script which removes unnecessary dependencies and creates symlinks.
-
Python import errors: Ensure all dependencies are installed with
pip install -r requirements.txt -
Build fails: Make sure all prerequisites are installed and up to date.
The backend requires these Python packages:
- Flask, Flask-CORS, Flask-SQLAlchemy, Flask-Migrate
- numpy, scipy, matplotlib (for Bayesian calculations)
- psutil (for system monitoring)
- Backend logs: Check console output when running
python app.py - Frontend logs: Check browser developer console
- Desktop app logs: Check terminal output when running
npm run tauri dev
This project is licensed under the MIT License.