2.7 KiB
2.7 KiB
Scout findings
Project snapshot
- Tech stack: SvelteKit + TypeScript + Vite + Tailwind v4.
- App name/branding:
beA-Edit. - Core purpose: upload one or more ZIP files, extract relevant PDFs/images, preview them, optionally reorder attachments, and download a merged PDF.
Main user flow
- User adds ZIP files via drag/drop or file picker (
ZipDropzone). +page.sveltestarts async extraction for each file.- Each ZIP is processed into one or more
ProcessedZipArchiveentries. ProcessedZipArchiveEditorshows thumbnails, allows reordering, and can download the merged PDF.AttachmentPreviewrenders image previews directly and PDF previews viapdfjs-dist.
Important source files
src/routes/+page.svelte— top-level page state, file selection, localStorage-backed thumbnail width setting, async ZIP processing.src/lib/zip-processing.ts— archive extraction, recursive nested ZIP handling, metadata ordering, PDF merge/export, image conversion.src/lib/services/zip-inflating.service.ts— thin wrapper aroundfflateunzip.src/lib/services/xml-reading.service.ts— parses XJustiz XML metadata (sender,receiver,documentNames).src/lib/components/ZipDropzone.svelte— file picker + drag/drop ZIP intake.src/lib/components/ProcessedZipArchiveEditor.svelte— archive editor, drag reordering, download button.src/lib/components/AttachmentPreview.svelte— preview generation for images/PDFs.src/lib/components/Card.svelte— generic page container.
ZIP/PDF processing details
- ZIP entries are filtered to ignore macOS metadata (
__MACOSX,.DS_Store,._*). - Relevant attachments are PDFs and common image formats.
- Nested ZIP archives are processed recursively.
xjustiz_nachricht.xmlis used to derive archive naming and ordering.- Ordering prefers document names from metadata before falling back to original attachment order.
- PDF merging uses
pdf-lib; images are embedded as PNG/JPG, with browser-side canvas conversion for other image types.
UI/state details
- Thumbnail width is stored in
localStorageunderthumbnailWidthand clamped to100..400. - Processing progress is shown as a count of pending ZIP files.
- The editor supports manual attachment reordering via drag-and-drop.
Dependencies worth noting
fflatefor ZIP extractionpdf-libfor PDF generation/mergingpdfjs-distfor PDF thumbnail previews@skeletonlabs/skeleton/@skeletonlabs/skeleton-sveltefor styling components
Current working tree observations
agents.mdis newly created.- Existing local changes are present in:
src/lib/zip-processing.tssrc/routes/+page.svelte
- New/untracked directory present:
src/lib/services/