Skip to content
MPCBexplorerPublic

About

A single-user, locally-hosted learning dashboard including inspiration, to-do lists, snippets of knowledge, and questions, along with a wishlist system. All in a local web app.

Topics

Resources

Contributing

Stars

10 stars

Watchers

1 watching

Forks

Latest commit

 

History

73 Commits

Folders and files

Repository files navigation

简体中文

Pouch · Learning Record Dashboard

"He, with always a young servant accompanying him, rode a donkey, carrying an old brocade pouch, and whenever he gained something, he wrote it down and put it in the pouch." — Biography of Li He

Java Local Only Version


People often jot down many things, only to forget them later. These records are often scattered across various places or forgotten in some corner. They may be inspirations, questions, knowledge, or to-do items. Pouch is a single-user, locally-run learning record dashboard where data is persisted as plain JSON files. Zero build tools, zero frontend frameworks, zero runtime external requests (except version check). Pouch aims to help you better organize and manage these records. Pouch also includes a wishlist system for managing wish income and expenditure.

  • Backend: Java 21 + JDK HttpServer, third-party library only Gson
  • Frontend: Native HTML/CSS/JS, locally imported—see Third-Party Dependencies

Features

  • Dashboard with six blocks aggregating data overview on the homepage — four-category total count cards, todo completion rate ring, wishlist three-item summary + progress bar, random recall (inspiration/knowledge independent viewed queues), fragmented knowledge composition ring, stale reminder Top N.
  • Supports inserting images — the frontend scales images (max side 1600px) + WebP lossy compression (quality 0.85) and embeds them as base64 into the record's images field, separated from the content text, without bloating the content. When rendering, img:xxx placeholders are replaced with data: URIs. Up to 10 images per record, each compressed image not exceeding 300 KB. The original image file can be deleted after import.
  • Supports inserting local file links — in edit mode, enter the full path to insert a local-file: link into the content; after exiting edit mode, click the link to open with the system's default program.
  • Data security — automatic backup to data/.backup/ before every data write (create/update/delete), keeping the most recent ~50 snapshots per file. On startup, if a data file is corrupted, it automatically attempts recovery from newest to oldest backup; the corrupted file is renamed to .corrupt and retained.
  • Only for local — the server binds only to 127.0.0.1 and is not exposed to the public network, suitable for personal local use.

Export Function

Pouch supports two export formats:

PDF Export

Available on both the list page (/list.html) and wishlist page (/wishlist.html). Select entries, click Export to enter selection mode, then click Download PDF in the preview panel. The preview renders exactly what will appear in the PDF (WYSIWYG). The exported PDF includes an export timestamp and summary rows (wishlist includes Total / Spent / Remaining).

JSON Export & Import

  • JSON Export: On the list page and wishlist page, click Export as JSON to download the selected entries as a JSON file. The file name includes the category and date.
  • JSON Import: Click Import JSON next to the Export button to upload a previously exported JSON file. The system validates that entries belong to the current category before importing.

Environment Requirements

  • JDK 21
  • Currently supports Windows only, requires PowerShell

Quick Start

Ordinary users only need to run start.bat in the folder.

# Compile + start
powershell -ExecutionPolicy Bypass -File server\start.ps1

After starting, open http://127.0.0.1:8787 in your browser. Listens on loopback address only.

# Compile only
powershell -ExecutionPolicy Bypass -File server\build.ps1

# Compile + replace version badge + package distributable zip
powershell -ExecutionPolicy Bypass -File server\build.ps1 -Version 2.0.0

# Start in background (does not occupy current terminal)
powershell -ExecutionPolicy Bypass -File server\run-bg.ps1

Start Parameters

start.ps1 supports three parameters to override defaults, useful for testing with temporary data without polluting real data:

Parameter Default Description
-Data <repo>\data Data root directory (where 5 JSON files reside)
-Web <repo>\web Static resource root directory
-Port 8787 Listening port (localhost only)
powershell -ExecutionPolicy Bypass -File server\start.ps1 -Data D:\tmp\pouch-test -Port 9000

Equivalent to: java -cp server\out;server\lib\* com.pouch.PouchServer --data=… --web=… --port=…

Data Directory

Default is data/, containing 5 JSON files (UTF-8, pretty-printed):

File Content
inspirations.json / questions.json / knowledge.json / todos.json Four record categories (shared record model, distinguished by type)
wishlist.json Wishlist entries (independent model)

Each file contains version and file-level updatedAt. Write backup: before each write, a snapshot is saved in data/.backup/ (keeps about 50 snapshots per file). Data file names are declared only in server/src/com/pouch/model/Category.java, not hardcoded elsewhere.

Four Pages

Page Content
/ Dashboard: category counts, todo completion rate ring, wishlist summary, random recall, knowledge composition ring, stale reminder
/list.html?type=<category> List page: browse by category, filter (subject/tag/status/keyword/date/sort/pagination), inline status toggle, quick new record
/detail.html?id=<uuid> Detail page: Markdown read/edit, append-only notes, tag management, category change, status switch
/wishlist.html Wishlist: add/delete, mark purchased, ↑/↓ adjacent sorting, three-item summary

Common Troubleshooting

Symptom Cause / Fix
Page shows "Unable to connect to local server" Backend not started → run start.ps1; or opened with file://
Unable to bind port 8787 Port occupied, change with -Port 9000
package com.google.gson does not exist server/lib/*.jar missing, or classpath separator wrong (Windows uses ;)
error: invalid target release: 21 JAVA_HOME points to old JDK, explicitly specify JDK 21's javac
Startup prints [WARN] xxx.json parse failed, attempting to restore from backup… Data file corrupted, auto-restored from .backup/, original saved as xxx.json.corrupt; orange warning banner at top of page
Modified data file but page not changed Memory is the query source, restart server
Chinese characters garbled in console Run chcp 65001 before starting

Constraint Checks

# Reverse search all constraints in the repository (innerHTML / color literals / fetch / data file names / CSS variables)
powershell -ExecutionPolicy Bypass -File scripts\check-constraints.ps1

These constraints come from the spec's Testing Decisions: innerHTML is only allowed in web/js/dom.js after DOMPurify sanitization; color literals are only allowed in web/css/tokens.css; fetch is only allowed in web/js/api.js.

Directory Structure

server/            Java source code (PouchServer → Handler → Service → Store layered architecture)
web/               Frontend (pages / js / css / vendor)
data/              5 JSON data files + .backup/ backups
scripts/           Constraint check scripts

Third-Party Dependencies

Pouch uses the following third-party open-source libraries, see NOTICE file for details:

  • Gson 2.11.0 — Apache License 2.0 (backend JSON serialization)
  • Chart.js — MIT License (frontend charts)
  • marked — MIT License (frontend Markdown rendering)
  • DOMPurify — Mozilla Public License 2.0 (frontend HTML sanitization)
  • KaTeX — MIT License (frontend LaTeX math rendering, local files under web/vendor)
  • jsPDF — MIT License (frontend PDF generation, local file web/vendor/jspdf.umd.min.js)
  • Noto Sans SC — SIL Open Font License 1.1 (frontend CJK font, local file web/vendor/fonts/NotoSansSC-Regular.ttf)
  • html2canvas — MIT License (frontend PDF screenshot, local file web/vendor/html2canvas.min.js)

Contributing

See CONTRIBUTING.md for how to report issues, submit pull requests, and follow coding conventions.


Thank you for using Pouch! 🎉

About

A single-user, locally-hosted learning dashboard including inspiration, to-do lists, snippets of knowledge, and questions, along with a wishlist system. All in a local web app.

Topics

Resources

Contributing

Stars

10 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages