No description
Find a file
Suphonchai Phoonsawat 0b2c9e6343
All checks were successful
Deploy eCourt Note Web to Server / Validate Database Schema (Drizzle) (push) Successful in 3s
Deploy eCourt Note Web to Server / Build Web Docker Image (push) Successful in 1m9s
Deploy eCourt Note Web to Server / Deploy eCourt Note Web to Server (push) Successful in 4s
Deploy eCourt Note Web to Server / Notify Deployment Status (push) Successful in 1s
feat(docver): derive docId from fid claim and drop [docId] URL segment
- docId of every docver operation now comes from the Bearer token: the fid
  claim (e-Court fileId) is used directly as docId; segment [docId] removed
  from URLs — POST/GET /api/documents/versions and
  GET /api/documents/versions/{versionId}/download-link
- fid is required and must be a string (trim 1-200): token issuance rejects
  missing/blank/non-string fid with 400, verify rejects fid-less tokens with 401
- parseDocId removed from lib/document-versioning.ts (dead code, no callers)
- openapi spec: paths renamed, docId path params removed, fid required + string
- PLAN-DOCVER.md / CLAUDE.md / wordaddin versioningService comment updated
- tests: fid required/string cases added, parseDocId describe removed (256 pass)

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-26 10:05:01 +07:00
.claude refactor(routes): move routes under /note, APIs under /api/note 2026-10-06 14:55:07 +07:00
.forgejo/workflows CD: ย่อ description ของ input version ใน uat.yml ให้สั้นลง — "เวอร์ชันที่จะ deploy เช่น 1.2.3 (ว่าง = latest)" 2026-09-17 17:16:30 +07:00
app feat(docver): derive docId from fid claim and drop [docId] URL segment 2026-10-26 10:05:01 +07:00
components feat(wordaddin): add template tools tab 2026-10-20 09:49:17 +07:00
db feat(docver): add document versioning API (docx+pdf in MinIO) 2026-10-20 10:52:35 +07:00
docker fix(docker): copy public/ into production image 2026-10-16 13:28:04 +07:00
docs feat(docver): derive docId from fid claim and drop [docId] URL segment 2026-10-26 10:05:01 +07:00
drizzle feat(docver): add document versioning API (docx+pdf in MinIO) 2026-10-20 10:52:35 +07:00
hooks refactor(routes): move routes under /note, APIs under /api/note 2026-10-06 14:55:07 +07:00
lib feat(docver): derive docId from fid claim and drop [docId] URL segment 2026-10-26 10:05:01 +07:00
public Add new template format with hashing algorithm 2026-10-22 22:33:14 +07:00
scripts feat(wordaddin): port Word add-in taskpane from poc 2026-10-16 12:07:25 +07:00
tests feat(docver): derive docId from fid claim and drop [docId] URL segment 2026-10-26 10:05:01 +07:00
utils feat(wordaddin): serve manifest with automatic origin rewrite 2026-10-16 13:54:25 +07:00
wordaddin feat(docver): derive docId from fid claim and drop [docId] URL segment 2026-10-26 10:05:01 +07:00
.dockerignore refactor(routes): move routes under /note, APIs under /api/note 2026-10-06 14:55:07 +07:00
.env.example feat(docver): add access token endpoint and Bearer auth on all endpoints 2026-10-26 06:29:19 +07:00
.gitignore feat(wordaddin): port Word add-in taskpane from poc 2026-10-16 12:07:25 +07:00
CLAUDE.md feat(docver): derive docId from fid claim and drop [docId] URL segment 2026-10-26 10:05:01 +07:00
docker-compose.yml feat(docver): add document versioning API (docx+pdf in MinIO) 2026-10-20 10:52:35 +07:00
drizzle.config.ts Add application codebase: PDF annotation for e-Court 2026-09-10 14:29:40 +07:00
middleware.ts Add new template format with hashing algorithm 2026-10-22 22:33:14 +07:00
next.config.mjs fix(config): move root redirect to page and skip slash redirect 2026-10-08 11:11:48 +07:00
package-lock.json feat(docver): add access token endpoint and Bearer auth on all endpoints 2026-10-26 06:29:19 +07:00
package.json Add new template format with hashing algorithm 2026-10-22 22:33:14 +07:00
pnpm-lock.yaml feat(docver): add document versioning API (docx+pdf in MinIO) 2026-10-20 10:52:35 +07:00
pnpm-workspace.yaml feat(docver): add document versioning API (docx+pdf in MinIO) 2026-10-20 10:52:35 +07:00
postcss.config.js Add application codebase: PDF annotation for e-Court 2026-09-10 14:29:40 +07:00
README.md feat(docver): add document versioning API (docx+pdf in MinIO) 2026-10-20 10:52:35 +07:00
tailwind.config.ts genesis+worker: design system Genesis ทั้งชุด + patch pdf.worker แก้ fake-space ไทย + ปิด review design/responsive/quality รอบ 2026-09-24 — (1) Genesis: ฟอนต์ General Sans self-host + DM Sans + Sarabun, AppNav 56px backdrop-blur แทน SessionBar, DotGrid หน้า login, palette/รัศมี/เงา/focus ตาม docs/DESIGN.md ครบทุกหน้า (2) postinstall scripts/patch-pdf-worker.mjs ถอด if (scaledDim) รอบ prevTransform ให้อัปเดตทุก glyph — กัน addFakeSpaces แทรก space กลางคำไทยใน PDF ที่ justify ด้วย letter-spacing + test กัน regression (tests/scripts/ + fixture thai_letterspacing.pdf, invariant #6) (3) ฟอร์มอัปโหลด + ช่องกลุ่ม typeId ทางเลือก — normDocumentGroup ที่ utils/external-file.ts เป็น single source ร่วมกับ N8 (4) token fixes: focus ring ปุ่ม pin + แถว bookmark ตามหน้า, ปุ่ม action ใน popup/composer/dialog เป็น rounded-md ทั้งคู่, selection preview เป็น tint ของ primary แทน blue-500 ดิบ, default สี shape/highlight รวมที่ utils/annotation-display, loading animate-pulse + จดข้อยกเว้น (เงา pin, font weights ของ viewer) ลง DESIGN.md (5) responsive: Export PDF max-lg:order-first ให้เห็นบน iPad, แถวบน header แถวเดียวเลื่อนได้บนจอแคบ, re-fit ความกว้างตอน toggle sidebar เฉพาะเมื่อยังไม่ซูมเอง, pin popover flip ขึ้นบนเมื่อใกล้ท้ายหน้า, toast hint ตอนสลับ tool กลางเอกสาร, ป้าย "ชนิด · ผู้ทำ" ของรายการผู้อื่นสำหรับจอสัมผัส (6) คุณภาพ: @layer ครอบ @media กันกฎ touch รั่ยไป desktop (Tailwind v3 ยก @layer ออกจาก media ทิ้ง wrapper — ยืนยันด้วย build จริง + วัดบนจอ), กฎ M5 ครอบ contenteditable กัน Safari zoom ตอนแก้ไข TEXTBOX บน iPad, COMMENT ใช้ box มาตราฐานเดียวตาม pin px จริง (render/scroll target/move-clamp/bookmark), ตัดหัวการ์ดซ้ำกับ h2 หน้ารายการ — พร้อมไฟล์ untracked ที่ postinstall/โค้ดอ้างถึงครบชุด (app/fonts/, AppNav, DotGrid, tests/) กัน fresh clone fail ที่ npm install (คำขอผู้ใช้ 2026-09-24) 2026-09-24 11:46:02 +07:00
tsconfig.json Add application codebase: PDF annotation for e-Court 2026-09-10 14:29:40 +07:00
vitest.config.ts Add application codebase: PDF annotation for e-Court 2026-09-10 14:29:40 +07:00

Judge's Note — PDF Annotation สำหรับ e-Court

ระบบ annotate ไฟล์ PDF คดีบนเว็บ แบบ Non-Destructive — ไฟล์ PDF ต้นฉบับไม่ถูกแก้ไขเด็ดขาด annotation ทั้งหมด (highlight / เส้นวาด / comment / bookmark) เก็บใน PostgreSQL เป็นพิกัด % ของขนาดหน้า แล้วซิงก์ระหว่างทุก browser แบบ realtime ผ่าน SSE (Server-Sent Events)

สร้างด้วย Next.js 14 (App Router) + TypeScript strict + pdfjs-dist v4 + Drizzle ORM + PostgreSQL (Docker container เดียว)

ฟีเจอร์

  • Highlight — คลุมดำข้อความ เลือกสีจาก floating toolbar (5 สี) วาดซ้อนหลังข้อความด้วย mix-blend-mode: multiply
  • Freehand draw — วาดเส้นอิสระบน SVG layer ความหนาสัมพัทธ์กับขนาดหน้า ไม่เบี้ยวเวลา zoom
  • Sticky note comment — คลิกวาง pin บนหน้า พร้อม popover ข้อความ/ผู้เขียน/เวลา
  • Bookmark — จดตำแหน่ง (หน้า + % ความสูง) กดแล้ว smooth-scroll กลับตำแหน่งเดิม
  • Realtime sync — เปิด 2 แท็บ วาดในแท็บ A แท็บ B เห็นทันทีผ่าน SSE (EventSource ต่อใหม่อัตโนมัติเมื่อขาด)
  • Page Virtualization — render เฉพาะหน้าใน viewport ± 1 หน้า ไฟล์หลายสิบหน้าเลื่อนลื่น
  • หน้า login (mock e-Court — dropdown user1–user5 รหัสผ่านกลาง Demo1234) — identity จาก cookie oacCase บังคับทุกหน้า (ปุ่มลบ/แก้ไขแสดงเฉพาะรายการของตัวเอง)

สิ่งที่ต้องมี (Prerequisites)

เครื่องมือ เวอร์ชันที่ใช้พัฒนา/ทดสอบ หมายเหตุ
Node.js v24.3.0 ≥ 20 น่าจะใช้ได้
Docker 29.1.3 ใช้รัน PostgreSQL + MinIO ผ่าน docker-compose.yml

ขั้นตอน Setup จากศูนย์

1. ติดตั้ง dependencies

npm install

postinstall จะคัดลอก pdf.worker.min.mjs จาก node_modules/pdfjs-dist/build/ มาไว้ที่ public/ ให้อัตโนมัติ

2. รัน PostgreSQL + MinIO ด้วย docker compose

docker compose up -d
  • db = PostgreSQL (judes-note-db พอร์ต 54322, database ecourt-note สร้างตอน first init) — ใช้ชื่อ container/วอลุ่มเดียวกับคำสั่ง docker run เดิม: ถ้ามี container เก่าจาก docker run อยู่ ให้ docker rm -f judes-note-db ก่อน (วอลุ่ม judes-note-db-data เดิม ข้อมูลไม่หาย — ถ้าวอลุ่มเดิม init ด้วย database postgres ให้สร้าง ecourt-note เอง: docker exec judes-note-db psql -U postgres -c 'CREATE DATABASE "ecourt-note"') · จะรันแค่ MinIO ก็ได้ด้วย docker compose up -d minio
  • minio = object storage ของ API เอกสาร versioning (judes-note-minio — API ที่ พอร์ตโฮสต์ 19000, console ดูผ่าน browser ที่ http://localhost:19001; ข้างใน container ยังเป็น 9000/9001 — host เลี่ยงมา 19000/19001 เพราะ 9000/9001 มักชนกับ service อื่นในเครื่อง dev; image ดึงจาก quay.io/minio/minio ซึ่งเป็น registry ทางการของ MinIO) — bucket ไม่ต้องสร้างเอง app สร้างตอน first use

ครั้งต่อไปแค่ docker compose start — ข้อมูลอยู่ใน volume judes-note-db-data/judes-note-minio-data ไม่หาย

3. สร้างไฟล์ .env

DATABASE_URL=postgresql://postgres:postgres@127.0.0.1:54322/ecourt-note
# N10 (optional): API key ของ /api/note/external/* สำหรับ backend e-Court เรียกแบบ server-to-server
# ไม่ตั้งหรือเว้นว่าง = API ปฏิเสธทุก request (fail closed) — ตั้งค่ายาวและสุ่ม เช่น 32+ ตัวอักษร
# EXTERNAL_API_KEY=
# MinIO ของ API เอกสาร versioning (ค่าตรง docker-compose.yml — ไม่ต้องแก้ถ้ารันตามขั้นตอน 2)
MINIO_ENDPOINT=127.0.0.1
MINIO_PORT=19000
MINIO_USE_SSL=false
MINIO_ACCESS_KEY=minioadmin
MINIO_SECRET_KEY=minioadmin

(เทียบกับ .env.example)

4. สร้างตารางในฐานข้อมูล

npx drizzle-kit push

5. Seed ไฟล์ตัวอย่าง

ไฟล์ตัวอย่างอยู่ที่ public/note/samples/ แล้ว — sync ลงตาราง files (idempotent รันซ้ำได้) — รองรับทั้ง .pdf และรูปภาพ .jpg/.jpeg/.png/.tif/.tiff (N3):

npm run seed-samples

บน production ไม่ต้องรันมือ — script เดียวกัน (scripts/seed-samples.mjs) รันอัตโนมัติตอน container start ต่อจาก migration ไฟล์ที่หายจาก public/note/samples/ จะถูกลบ row พร้อม annotation ที่ผูกอยู่ (CASCADE)

6. รัน dev server

npm run dev

เปิด http://localhost:3000/docedit/note — คลิกไฟล์เพื่อเข้าหน้า annotate หรืออัปโหลดไฟล์ใหม่ (PDF/รูปภาพ ≤ 100MB) ผ่านฟอร์มบนหน้ารายการ (N4 — ไฟล์เก็บที่ public/note/uploads/)

การใช้งานบนหน้า annotate

ปุ่ม พฤติกรรม
ลูกศร (select) คลุมดำข้อความ → เด้ง toolbar เลือกสี → ติด highlight บนหน้า
ดินสอ (draw) ลากเมาส์วาดเส้นอิสระ (ปล่อย = บันทึก)
ลูกศร+กล่องแชท (comment) คลิกจุดบนหน้า → พิมพ์ข้อความ → บันทึก pin
bookmark+ เพิ่ม bookmark ที่ตำแหน่งกึ่งกลางจอปัจจุบัน
zoom − / + สเกล 50%–300% (annotation ทั้งหมด scale ตามเพราะเก็บเป็น %)

Sidebar ซ้าย: แท็บ Bookmarks / Annotations — คลิกรายการเพื่อเลื่อนกลับไปตำแหน่งนั้น และมีปุ่มลบเฉพาะรายการของตัวเอง (identity จากหน้า login)

ทดสอบ realtime: เปิดหน้า annotate ไฟล์เดียวกันใน 2 แท็บ แล้ววาด/comment จากแท็บหนึ่ง — อีกแท็บเห็นทันทีโดยไม่ต้อง refresh

API สำหรับระบบภายนอก (N10)

Read-only API ให้ backend ของ e-Court เรียกแบบ server-to-server (ไม่มีหน้า UI) — endpoint เดียว POST /api/note/external/documents (JSON body) ตรวจสิทธิ์ด้วย API Key เดียวใน env EXTERNAL_API_KEY ส่งผ่าน header x-api-key (env ไม่ตั้ง/ว่าง = ปฏิเสธทุก request — fail closed) — คู่มือการใช้สำหรับผู้เรียก: docs/API-DOCUMENTS.md · สเปก/เหตุผลการออกแบบ: docs/PLAN-API.md

// POST /docedit/api/note/external/documents   (URL เต็มฝั่งผู้เรียกอยู่ใต้ basePath)
// headers: x-api-key + content-type: application/json
{
  "fileId": "<fileId ของ e-Court>",     // ถามเอกสารเดียว — ส่งพร้อม typeId ได้ = กรองเฉพาะเอกสารที่ตรงทั้งสองเงื่อนไข (AND)
  "typeId": "<typeId>",                 // ถามทุกเอกสารในกลุ่ม N9 — กลุ่มว่าง = 200 documents: []
  "filter": {
    "type": "bookmarks",                // optional: "bookmarks" | "annotations" — ไม่ส่ง (หรือ type เป็น "") = ทั้งสอง
    "userId": "<userId>",               // optional: string หรือ array — กรองตามเจ้าของรายการ (ทั้ง annotations/bookmarks)
    "annotationTypes": ["COMMENT"],     // optional: ค่าจาก HIGHLIGHT|DRAW|COMMENT|SHAPE|REDACTION|TEXTBOX|STAMP — เฉพาะ annotations
  }
}
  • Response 200 เป็นรูปเดียวเสมอ: { "documents": [ { "id", "externalFileId", "title", "typeId", "createdAt", "annotations": [… พร้อม url + replies], "bookmarks": [… พร้อม url] } ] } (field เอกสารอยู่ระดับเดียวกับ annotations/bookmarks) — ถามด้วย fileId ได้ array ยาว 1 ชิ้น (ไม่เคยเปิดในระบบ = 404)
  • url ต่อรายการ = deep link กลับมาหน้า viewer เป็น URL เต็มพร้อมใช้ทันที (http://<host>/docedit/note/annotate/<fileId>?ann=<id> สำหรับ annotation · ?page=<หน้า 1-based> สำหรับ bookmark) — origin อ่านจาก request ที่เรียกเข้ามา (ผ่าน reverse proxy ต้องตั้งส่งต่อ x-forwarded-proto/x-forwarded-host)
  • error ทุกสถานะ (400/401/404/500) เป็น JSON { "error": "<ข้อความไทย>" } รูปเดียวกันทั้ง endpoint — 500 เกิดเมื่อ query ฐานข้อมูลล้ม (log รายละเอียดฝั่ง server อย่างเดียว)
  • ตัวอย่าง:
curl -X POST -H "x-api-key: $EXTERNAL_API_KEY" -H "content-type: application/json" \
  -d '{"fileId":"1234","filter":{"type":"bookmarks"}}' \
  "http://localhost:3000/docedit/api/note/external/documents"

curl -X POST -H "x-api-key: $EXTERNAL_API_KEY" -H "content-type: application/json" \
  -d '{"typeId":"CASE-2569-0001"}' \
  "http://localhost:3000/docedit/api/note/external/documents"

API จัด version เอกสาร (docver — stand-alone)

กลุ่ม API ให้ Word add-in / ระบบภายนอก เก็บเอกสารเป็น version: เอกสารเดียวต่อ docId (unique) แต่ละ version เก็บไฟล์ .docx + .pdf ใน MinIO พร้อม userId/userName/createdAt ของผู้อัปโหลด — ไม่มี auth ไม่มี session (stand-alone): ผู้เรียกบอก identity เองผ่าน field userId/userName ของ multipart · contract ตรง mock ของ wordaddin (versioningService) เป๊ะเพื่อวันสลับของจริง · สเปก/เหตุผล: docs/PLAN-DOCVER.md

# POST อัปโหลด version (เอกสารถูกสร้างแบบ implicit เมื่อเป็น version แรก)
curl -F "file=@คำสั่งเรียก.docx" -F "pdf=@คำสั่งเรียก.pdf" \
  -F "userId=u0001" -F "userName=ผู้พิพากษา ก." \
  "http://localhost:3000/docedit/api/documents/CASE-2569-0001/versions"
# → {"hasPdf":true,"versionId":"<uuid>","versionNumber":1}   (versionNumber เป็นค่าจาก server)

# GET history (ใหม่ → เก่า) — docId ที่ยังไม่เคยมี version = 404
curl "http://localhost:3000/docedit/api/documents/CASE-2569-0001/versions"

# GET presigned URL อายุสั้น (default docx, ?format=pdf — version ไม่มี pdf = 404)
curl "http://localhost:3000/docedit/api/documents/CASE-2569-0001/versions/<versionId>/download-link?format=pdf"
  • ไฟล์แนบ file (.docx) บังคับ · pdf optional (add-in แนบ blob เปล่าได้ = ถือว่าไม่มี ดู hasPdf) · ทั้งคู่ ≤ 100MB + ตรวจ magic bytes · field นอก allowlist = 400 กัน typo เงียบ ๆ
  • error ทุกสถานะเป็น JSON { "error": "<ข้อความไทย>" } — 400 (รูปผิด/ไม่ใช่ multipart/เนื้อไฟล์เพี้ยน) · 413 (เกิน 100MB) · 404 (ไม่มีเอกสาร/version/pdf) · 500 (MinIO env ไม่ตั้ง/ล้ม, DB ล้ม — log เต็มฝั่ง server)
  • presigned URL อ้าง MINIO_ENDPOINT:MINIO_PORT ตรง ๆ — production ต้องเป็นโฮสต์ที่เบราว์เซอร์ของผู้ใช้เข้าถึงได้ ไม่ใช่แค่ที่ Next server เข้าถึงได้

Troubleshooting

อาการ สาเหตุ/ทางแก้
Realtime ไม่ซิงก์ sync ใช้ pub/sub in-memory ของ process เดียว — ทุกแท็บต้องเข้าผ่าน dev server เดียวกัน (ถ้าวันหนึ่งรันหลาย instance ต้องเพิ่ม Redis pub/sub หรือ Postgres LISTEN/NOTIFY ก่อน)
หน้าเว็บ 500 หลังรัน next build ระหว่างที่ dev server กำลังรัน build เขียนทับ cache ของ dev — ปิด dev server ก่อน build หรือ restart dev server หลัง build
tsc --noEmit error ชี้ route ที่ถูกลบไปแล้ว (เช่น app/api/external/document* หลังรวมเป็น query รอบสองของ N10) type stub ค้างใน .next/types/ ของ dev/build รอบก่อน — ลบ .next หรือรัน next build/restart dev server หนึ่งครั้งให้ regenerate แล้วรันใหม่
ต่อ DB ไม่ได้ ตรวจว่า container รันอยู่ (docker compose start db — เดิม docker start judes-note-db) และพอร์ต 54322 ไม่ถูกใช้โดย container อื่น
API เอกสาร versioning ตอบ 500 ทุก call ตรวจ env MINIO_ENDPOINT/MINIO_ACCESS_KEY/MINIO_SECRET_KEY และ container minio (docker compose start minio) — รายละเอียดอยู่ใน log ฝั่ง server
Highlight ใช้ไม่ได้กับไฟล์คดีตัวอย่าง ไฟล์ 01012-*.pdf ทั้งสองเป็นภาพสแกนล้วน (ไม่มี text layer) — ใช้ dashboard-report-2026-09-03.pdf ซึ่งเป็น text-based PDF แทน จึงจะคลุมดำได้ (DRAW/COMMENT/BOOKMARK ใช้ได้ปกติกับทุกไฟล์)

หมายเหตุทางเทคนิค

  • Realtime = SSE + pub/sub in-process: Server Actions (app/actions/annotations.ts) publish event หลังเขียน DB สำเร็จทุกครั้ง → lib/annotate-events.ts → SSE endpoint app/api/note/annotations/stream → hook เปิด EventSource รับ event (payload เป็น DTO จาก server ตรง ๆ)
  • UI ใช้ useOptimistic ที่มาจาก React canary build ซึ่ง Next.js 14 vendored ไว้ให้ — หากหยิบ component ไปรันนอก Next bundling (เช่น unit test ด้วย react เปล่า) จะหา export นี้ไม่เจอ
  • พิกัด annotation ทุกชนิดเก็บเป็น % ของขนาดหน้า → render ถูกต้องทุก zoom/ขนาดจอ และ mergeRectsByLine รวบ rect ให้เหลือ 1 อันต่อบรรทัดก่อนบันทึก highlight
  • สถาปัตยกรรม/สเปกฉบับเต็ม: docs/PLAN.md · กติกาที่ต้องรักษาตอนแก้โค้ด: CLAUDE.md · ฟีเจอร์ต่อยอด: docs/PLAN-FEAT.md

โครงสร้างหลัก

db/schema.ts              ตาราง + JSONB strict union + DTO + toDTO
db/index.ts               postgres.js + drizzle (prepare: false)
lib/annotate-events.ts    pub/sub in-process (actions → SSE route)
lib/document-versioning.ts  validation ล้วนของกลุ่ม /api/documents (docver)
lib/docver-store.ts       MinIO client + tx จ่ายเลข version + query ของ docver
utils/coordinates.ts      px ⇄ % + clamp + mergeRectsByLine
utils/user.ts             parse/build cookie oacCase (mock login e-Court)
hooks/useAnnotationRealtime.ts   EventSource รับ SSE event + dedupe ด้วย id
app/actions/annotations.ts       Server Actions CRUD + publish event (ทางเขียนทางเดียว)
app/api/note/annotations/stream/route.ts  SSE endpoint (GET ?fileId=)
app/api/documents/[docId]/versions/       API จัด version เอกสาร (POST/GET + download-link)
app/note/page.tsx              รายการไฟล์ + ฟอร์มอัปโหลด (N4)
app/note/annotate/[id]/page.tsx  โหลด file + initial data → PDFViewer
components/pdf/           PDFViewer (root + virtualization), InkLayer, HighlightToolbar
components/sidebar/       AnnotationSidebar
public/note/samples/      ไฟล์ตัวอย่าง (PDF + รูปภาพ) — seed ด้วย npm run seed-samples
public/note/uploads/      ไฟล์ที่อัปโหลดผ่านหน้ารายการ (N4)