<div align="center">

# 🎓 TutorialVault

### *Your tutorials. Your progress. Your machine. Nothing else.*

[![License: CC0](https://img.shields.io/badge/license-CC0_1.0-blue.svg)](https://creativecommons.org/publicdomain/zero/1.0/)
[![Platform: Windows](https://img.shields.io/badge/platform-Windows-0078D4.svg?logo=windows)](https://www.microsoft.com/windows)
[![Built with Tauri](https://img.shields.io/badge/built_with-Tauri_v2-FFC131.svg?logo=tauri)](https://v2.tauri.app/)
[![Rust](https://img.shields.io/badge/backend-Rust-B7410E.svg?logo=rust)](https://www.rust-lang.org/)
[![TypeScript](https://img.shields.io/badge/frontend-TypeScript-3178C6.svg?logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
[![No Telemetry](https://img.shields.io/badge/telemetry-none-2ea44f.svg)](#-philosophy)
[![Portable](https://img.shields.io/badge/install-portable-8B5CF6.svg)](#-portability)

A desktop application for organizing, watching, and tracking progress through video tutorial courses. Built because learning should be frictionless, untracked, and entirely under your control.

**No accounts. No telemetry. No cloud. No subscriptions.**
**Everything lives on your machine, next to the executable, owned by you.**

</div>

---

## What It Does

TutorialVault turns any folder of video files into a structured course with automatic progress tracking, subtitle support, per-video notes, and detailed media information. Point it at a folder, and it handles the rest.

It was built for people who collect tutorial courses and want a better way to work through them than a file explorer and a media player. Your progress, your notes, your preferences - all saved automatically, all portable, all yours.

---

## 🌱 Philosophy

Knowledge has no natural owner. Someone figures something out, shares it, and suddenly everyone who encounters it is a little more capable than before. That's how it's supposed to work. The history of human progress is a history of people teaching each other, freely, because a skill shared is a skill multiplied - not divided.

Somewhere along the way, learning got enclosed. Platforms decided that access to knowledge should require accounts, tracking, monthly fees, and behavioral analytics. They turned education into a product and learners into metrics. Your watch history became someone else's data. Your pace became an engagement number. The relationship between you and what you're learning got intermediated by companies whose interests have nothing to do with yours.

TutorialVault rejects all of that.

There's no tracking here. No analytics. No accounts. No servers collecting your habits. The app doesn't know who you are, doesn't care, and couldn't report on you even if someone asked. Your learning is private by architecture, not by policy - there is simply nowhere for the data to go except the folder sitting next to the executable on your own machine.

It's self-contained on purpose. It doesn't phone home. It doesn't sync to a cloud. It doesn't require an internet connection after the initial setup. It carries everything it needs with it. Copy it to a USB drive and it works anywhere, for anyone, without permission from anyone. The tool belongs to whoever holds it.

This isn't an accident or a limitation - it's the point. Tools should serve the people using them, not extract value from them. Software doesn't need to monetize your attention or harvest your behavior to be useful. It just needs to do what you need it to do and then get out of the way.

Education is too important to gate behind paywalls and surveillance. If you have the material and you want to learn from it, that should be enough. No intermediary needed. No permission required. The knowledge is already there - all you need is a decent tool to engage with it.

This is that tool.

---

## Features

### 📂 Library Management

**Open any folder as a course.** TutorialVault recursively scans a folder and all its subdirectories for video files, organizing them into a navigable playlist. Supported formats include MP4, MKV, WebM, AVI, MOV, MPEG, M2TS, and OGV.

**Recent folders.** A dropdown menu keeps track of folders you've opened before. Click any entry to jump back to it instantly. Remove entries you no longer need.

**Automatic restore.** The app remembers the last folder you had open and automatically loads it on startup, resuming exactly where you left off. No setup, no re-navigation.

**Smart file identity.** Files are identified by their content, not their path. Rename or reorganize files within the folder and your progress follows them.

**Subfolder awareness.** When your course has subdirectories (chapters, sections, modules), TutorialVault detects the structure and displays a visual tree in the playlist, making it easy to see where you are in a large course.

---

### ▶️ Video Playback

**Full-featured player.** Play, pause, seek, adjust volume, change playback speed, and go fullscreen. All the controls you'd expect, with a clean minimal interface that stays out of your way.

**Playback speed.** Presets from 0.50x to 2.00x, with a visual speedometer that changes color based on your current rate. Speed is saved per folder, so your lecture courses stay at 1.5x while your drawing tutorials stay at 1x. Cycle through speeds with keyboard shortcuts.

**Volume control.** A slider with a live percentage tooltip. Click the volume icon to mute/unmute instantly. Volume is saved per folder as well.

**Picture-in-Picture.** Pop the video out into a floating window so you can follow along while working in another application. The PiP button appears automatically when your browser supports it.

**Fullscreen.** Double-click the video or press F to toggle fullscreen. The player remembers your position and controls remain accessible.

**Seek feedback.** When skipping forward or backward, a brief overlay shows the accumulated seek amount (+5s, -10s, etc.) so you always know how far you've jumped.

**Error handling.** If a video format isn't supported by the player, an error overlay appears with a clear message and a "Try next" button to skip to the next video without interrupting your session.

**Keyboard shortcuts:**

| Key | Action |
|-----|--------|
| Space | Play / Pause |
| Left Arrow | Skip back 5 seconds |
| Right Arrow | Skip forward 5 seconds |
| Up Arrow | Volume up 5% |
| Down Arrow | Volume down 5% |
| F | Toggle fullscreen |
| M | Mute / Unmute |
| [ | Decrease playback speed |
| ] | Increase playback speed |
| ? | Show keyboard shortcut help |

Press **?** at any time to open a help dialog listing all available shortcuts.

---

### 📊 Progress Tracking

**Automatic position saving.** Your playback position is saved continuously as you watch. Close the app, come back tomorrow, and you're right where you stopped.

**High-water mark tracking.** TutorialVault remembers the furthest point you've reached in each video, independent of where you happen to be scrubbing to.

**Automatic completion detection.** When you watch to within 2 seconds of the end, a video is marked as done. Once done, it stays done - no accidental un-finishing.

**Overall progress.** A progress bar shows your completion percentage for the entire folder, calculated from actual watched time relative to total duration. Not just "videos finished out of total" - actual time-weighted progress.

**Resume from where you left off.** Clicking any video in the playlist, or navigating with previous/next, resumes from your last position. Finished videos start from the beginning.

**Progress reset.** If you want to go through a course again from scratch, a reset button clears all watch progress while preserving your notes, subtitles, volume, and speed settings. Uses a two-click confirmation to prevent accidental resets -- the first click arms the button (it turns red with a warning icon), and the second click within 3 seconds actually resets. If you change your mind, just wait or click elsewhere.

**Mini progress bars.** Each item in the playlist shows a thin progress bar at the bottom of its row, visualizing how far you've watched. Completed videos get a green bar; in-progress videos show the accent color proportional to watched time.

---

### 🗒️ Playlist

**Visual playlist.** Every video in the folder is listed with its title, watched time, total duration, and status tags. The currently playing video is marked "Now," and completed videos are marked "Done."

**Tree view.** Courses with subdirectories get a visual tree with SVG connectors showing the hierarchy. Lines, corners, and dots show parent-child relationships at a glance.

**Drag and drop reorder.** Rearrange the playlist by dragging items. A blue indicator line shows exactly where an item will land. Your custom order is saved and persists between sessions.

**Smart ordering.** Natural sort by default - "Lesson 2" comes before "Lesson 10." When you reopen a folder that has new files, existing items keep their saved order and new files appear at the end.

**Search and filter.** A search field in the playlist header lets you filter videos by name in real time. Matches are case-insensitive and update the displayed list instantly. A clear button resets the filter. Statistics next to the header show total video count and how many are done (or "X of Y" when filtering).

**Scroll to current.** When the currently playing video scrolls out of view in a long playlist, a crosshair button appears in the header. Click it to scroll the active video back into view.

---

### 💬 Subtitles

**Automatic subtitle discovery.** TutorialVault finds subtitles in three ways, in this priority order:

1. **Previously loaded subtitle** - if you've loaded a subtitle for a video before, it's remembered and reloaded automatically.
2. **Sidecar files** - `.srt` or `.vtt` files sitting next to the video with a matching filename (including language variants like `video.en.srt` or `video.french.srt`).
3. **Embedded tracks** - subtitle tracks inside the video container itself (common in MKV files), extracted on demand using ffmpeg.

**Subtitle menu.** A CC button opens a menu listing all available subtitles - external files, embedded tracks, a "load from file" option for picking any subtitle file on your system, and a disable option.

**Language detection.** Sidecar subtitles with language suffixes are automatically labeled (English, French, German, Spanish, Italian, Portuguese, Russian, Japanese, Korean, Chinese, Arabic, Hindi, Dutch, Swedish, Polish). English subtitles are sorted first.

**Persistent selection.** Once a subtitle is loaded for a video, it's converted to VTT format, stored locally, and automatically reloaded every time you watch that video.

---

### 📝 Notes

**Per-video notes.** A text area in the dock panel lets you write notes for each video. Timestamps, reminders, key takeaways, questions - whatever you need. Notes auto-save as you type.

**Timestamp insertion.** Click the clock button in the notes header to insert the current video timestamp at your cursor position in `[M:SS]` format. Useful for marking specific moments while you watch.

**Visible in the playlist.** Videos with notes show a small indicator in the playlist, so you can quickly spot which videos you've annotated.

**Preserved on reset.** Resetting watch progress never touches your notes.

---

### 🔬 Media Information

**Detailed metadata panel.** The info panel shows everything about the current video and folder:

- **Folder info** - path, structure (flat or subfolder), next unfinished video.
- **Video info** - codec, resolution, frame rate, pixel format, bitrate.
- **Audio info** - codec, channels, sample rate, bitrate.
- **Subtitle info** - count and details of embedded tracks, or external file status.
- **File info** - extension, file size, modification date, containing folder.
- **Progress stats** - finished count, remaining count, estimated time remaining.
- **Per-subfolder breakdown** - completion counts for each top-level subdirectory.

All of this requires ffprobe, which TutorialVault will automatically download if it's not already available on your system.

---

### 🖥️ Interface

**Custom titlebar.** The app uses a custom-drawn titlebar with minimize, maximize, and close buttons, replacing the default OS chrome. The titlebar doubles as a drag region for moving the window and integrates the toolbar controls directly.

**Resizable panels.** Drag the divider between the video area and the playlist to adjust the split. Drag the divider between the notes and info panels too. Both ratios are saved. Dividers also support keyboard adjustment with arrow keys.

**Collapsible dock panes.** Click the Notes or Info panel header to collapse it, freeing up vertical space for the other pane. A chevron icon indicates the current state. Collapsed state is saved and restored between sessions.

**UI zoom.** Scale the entire interface from 75% to 200% with the zoom controls in the top bar. Useful for high-DPI displays or when you want more real estate for the video.

**Always on top.** A toggle to keep the window above all others. Handy when following along with a tutorial in another application.

**Autoplay.** When enabled, the next video starts playing automatically when the current one ends. Saved per folder.

**Custom scrollbar.** The playlist has a custom scrollbar that auto-hides when not in use, with fade indicators at the edges when there's more content to scroll.

**Tooltips.** Hover over any control for a two-line tooltip explaining what it does. Tooltips are zoom-aware and stay within the viewport.

**Toast notifications.** Brief confirmations appear at the bottom of the screen for actions like loading folders, resetting progress, and loading subtitles.

---

### ♿ Accessibility

TutorialVault targets WCAG 2.2 AAA compliance throughout the interface.

**Semantic HTML.** The interface uses proper semantic elements -- `<nav>`, `<main>`, `<header>`, `<section>`, `<h2>`, `<h3>` -- so screen readers can navigate the structure meaningfully.

**ARIA attributes.** All interactive elements have appropriate ARIA labels, roles, and state attributes. Menus use `role="menu"` with `aria-haspopup` and `aria-expanded`. The progress bar uses `role="progressbar"` with live value updates. The seek feedback overlay uses `aria-live="assertive"` for screen reader announcements.

**Full keyboard navigation.** Every control is reachable and operable via keyboard. Menus support arrow key navigation, Escape to close, and Enter/Space to activate. Dividers can be adjusted with arrow keys. The shortcut help dialog traps focus while open.

**Touch targets.** All interactive elements meet the 44x44px minimum target size. Buttons, checkboxes, and menu items are sized for comfortable interaction on all input methods.

**Focus indicators.** All focusable elements show a visible `focus-visible` ring (2px solid outline) when navigated via keyboard. Focus indicators use the accent color with sufficient contrast.

**Reduced motion.** The app respects `prefers-reduced-motion` at the OS level. When enabled, all animations and transitions are effectively disabled, ensuring the interface remains usable for people who are sensitive to motion.

**Contrast.** Text and UI elements meet AAA contrast ratios (7:1 for normal text, 4.5:1 for large text) against the dark background surfaces.

---

### 🧳 Portability

**Fully portable.** Everything - preferences, library state, subtitles, ffmpeg binaries, even the WebView2 profile - lives in a `state/` directory next to the executable. Copy the folder to a USB drive and it works anywhere. No registry entries, no AppData folders, no hidden configuration in your home directory.

**Crash-safe storage.** All state files are written atomically with backup rotation. If something goes wrong mid-write, the app falls back to the most recent valid backup. Nobody should lose their progress to a power outage.

**No external dependencies at runtime.** ffmpeg and ffprobe are automatically downloaded on first launch if not found locally. Fonts are bundled. Everything the app needs, it carries with it.

---

## 🎞️ Supported Formats

**Video:** MP4, M4V, MOV, WebM, MKV, AVI, MPG, MPEG, M2TS, MTS, OGV

**Subtitles:** SRT, VTT (sidecar files or embedded tracks in video containers)

Native HTML5 video playback works best with MP4 (H.264 + AAC) and WebM. Other formats are supported but may depend on system codecs.

---

## 🔨 Building from Source

### Prerequisites

- [Node.js](https://nodejs.org/) (18+)
- [Rust](https://rustup.rs/) (stable)
- [Tauri v2 prerequisites](https://v2.tauri.app/start/prerequisites/) for your platform

### Development

```
npm install
npm run tauri dev
```

### Production Build

```
npm run tauri build
```

The built executable and all assets will be in `src-tauri/target/release/`.

---

## 🏗️ Architecture

TutorialVault is a [Tauri v2](https://v2.tauri.app/) application with a Rust backend and a TypeScript frontend.

**Backend (Rust):** Handles file scanning, fingerprinting, state persistence, ffmpeg integration, subtitle processing, and a custom HTTP protocol for serving video and subtitle files to the frontend.

**Frontend (TypeScript + Vite):** A modular architecture with dedicated modules for each concern:

- `main.ts` -- Boot sequence, tick loop, keyboard shortcuts, cross-module wiring
- `player.ts` -- Video element, seek/volume/speed controls, mute, fullscreen, PiP, error states
- `playlist.ts` -- Playlist rendering, tree view, drag-and-drop, search/filter, scroll-to-current
- `subtitles.ts` -- Subtitle discovery, menu, embedded track extraction
- `ui.ts` -- Zoom, split ratios, notes, info panel, recent menu, toast, collapsible panes
- `tooltips.ts` -- Hover tooltips with zoom awareness and viewport clamping
- `store.ts` -- Shared state, pure utilities, cross-module callback registry
- `api.ts` -- Typed wrapper around Tauri's invoke API

**Design theme.** The interface uses a "Cold Open" dark theme built on cool slate backgrounds (`#0f1117` base) with a steel blue accent (`#88A4C4`). Typography uses [Bricolage Grotesque](https://fonts.google.com/specimen/Bricolage+Grotesque) for headings, [Inter](https://fonts.google.com/specimen/Inter) for body text, and [Space Mono](https://fonts.google.com/specimen/Space+Mono) for monospace elements. All fonts are bundled -- no external requests at runtime.

**State is local.** All data is stored in JSON files with atomic writes and backup rotation. No database, no server, no network requests beyond the one-time ffmpeg download.

---

## ⚖️ License

TutorialVault is released into the public domain under [CC0 1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/).

No rights reserved. No permission needed. No conditions. No restrictions.

Do whatever you want with it. Learn from it. Change it. Share it. Build on it. The whole point is that it's yours.

This project is developed with the help of a locally-run LLM via opencode for scaffolding, planning, and routine code tasks. Architecture and design decisions are my own.
