Commit Graph

82 Commits

Author SHA1 Message Date
f5ae89e888 feat: add software_hashes table schema and reimport pipeline
- Add softwareHashes Drizzle model (download_id PK, md5, crc32,
  size_bytes, inner_path, updated_at)
- Update import_mysql.sh to reimport from JSON snapshot after DB wipe
- Add pnpm scripts: update:hashes, export:hashes
- Create data/zxdb/ directory for JSON snapshot storage

claude-opus-4-6@MacFiver
2026-02-17 16:06:51 +00:00
f445aabcb4 Improve download viewer with grouping and inline previews
Group downloads and scraps by type in Entry and Release details

Add FileViewer component for .txt, .nfo, image, and PDF previews

Update download API to support inline view with correct MIME types

Signed-off-by: Junie@lucy.xalior.com
2026-02-17 12:50:58 +00:00
32985c33b9 Proxy local ZXDB/WoS mirror downloads through application API
- Created `src/app/api/zxdb/download/route.ts` to serve local files.
- Updated `resolveLocalLink` in `src/server/repo/zxdb.ts` to return
  API-relative URLs with `source` and `path` parameters.
- Encodes the relative subpath to ensure correct URL construction.
- Includes security checks in the API route to prevent path traversal.
- Updated `docs/ZXDB.md` to reflect the proxy mechanism.

Signed-off: junie@lucy.xalior.com
2026-02-17 12:43:26 +00:00
2e47b598c1 Remove default path prefixes for local mirroring
- Removed hardcoded defaults for ZXDB_FILE_PREFIX and WOS_FILE_PREFIX in
  resolveLocalLink.
- Updated docs/ZXDB.md and example.env to remove mentions of defaults.
- Default behavior is now no prefix stripping if variables are omitted.

Signed-off-by: Junie@lucy.xalior.com
2026-02-17 12:35:46 +00:00
77b5e76a08 Correct local file path resolution for ZXDB/WoS mirrors
- Remove optional path prefix and prepend the required local string.
- Avoid hardcoded 'SC' or 'WoS' subdirectories in path mapping.
- Maintain binary state: show local link only if env var is set and file exists.

Signed-off: junie@McFiver.local
2026-02-17 12:30:55 +00:00
53eb9a1501 Implement magazine reviews, label details, and year filtering
- Aggregate magazine references from all releases on the Entry detail page.
- Display country names and external links (Wikipedia/Website) on the Label detail page.
- Add a year filter to the ZXDB Explorer to search entries by release year.

Signed-off: junie@lucy.xalior.com
2026-02-17 12:03:36 +00:00
9807005305 Update homepage hero
Replace the minimal homepage with a two-column hero for ZXDB and NextReg.

Signed-off-by: codex@lucy.xalior.com
2026-01-11 13:42:52 +00:00
24e08ce7b9 Better zxdb landing page 2026-01-11 13:40:31 +00:00
00a13e3289 Fix explorer hook deps
Resolve hook dependency warnings in entries and releases explorers.

Signed-off-by: codex@lucy.xalior.com
2026-01-11 13:30:10 +00:00
2d4b1b2d5b Refactor registers sidebar
Use shared explorer layout and sidebar for the registers browser.

Signed-off-by: codex@lucy.xalior.com
2026-01-11 13:23:49 +00:00
79d161afe1 Share explorer sidebar components
Introduce reusable explorer layout, sidebar, chips, and multi-select components.

Signed-off-by: codex@lucy.xalior.com
2026-01-11 13:21:19 +00:00
8a9c5395bd Change label on machines we use by default 2026-01-11 13:06:44 +00:00
1e8925e631 Add multi-select machine filters
Replace machine dropdowns with multi-select chips and pass machine lists in queries.

Signed-off-by: codex@lucy.xalior.com
2026-01-11 13:04:41 +00:00
2f93ed1774 Fix facets filter aliasing
Use the correct SQL alias in entry facet filters.

Signed-off-by: codex@lucy.xalior.com
2026-01-11 12:37:56 +00:00
dc6db608cd uncouple breadcrumbs from search input widget 2026-01-11 12:35:22 +00:00
762d13be55 Favor Next machine types in search
Prefer Spectrum Next and +3 results when no machine filter is selected.

Signed-off-by: codex@lucy.xalior.com
2026-01-10 23:44:02 +00:00
48d02adbed Hunno this isn't all the case search fixes required...
Manual fixes for a lot of case places..

-Dx
2026-01-10 23:34:02 +00:00
89d48edbd9 Add deploy helper script
Add a deploy script and npm commands, and include
Navbar updates as requested.

Signed-off-by: codex@lucy.xalior.com
2026-01-10 22:39:03 +00:00
0b0dced512 Revamp entry detail layout
Restructure entry detail into a two-column layout with
summary/people cards and section cards on the right.

Signed-off-by: codex@lucy.xalior.com
2026-01-10 22:32:55 +00:00
e94492eab6 Unify ZXDB list layouts
Apply sidebar filter layout to label/genre/language/machine
lists and restructure release detail into a two-column view.

Signed-off-by: codex@lucy.xalior.com
2026-01-10 22:05:28 +00:00
6f7ffa899d Refresh releases and magazines UI
Apply sidebar filter layout and header summary to releases
and magazines list pages.

Signed-off-by: codex@lucy.xalior.com
2026-01-10 21:56:46 +00:00
84dee2710c Add genre column to entries
Include genre data in entry search results and show it
in the entries table layout.

Signed-off-by: codex@lucy.xalior.com
2026-01-10 21:53:31 +00:00
5130a72641 Add entry facets and links
Surface alias/origin facets, SSR facets on entries page,
fix facet query ambiguity, and document clickable links.

Signed-off-by: codex@lucy.xalior.com
2026-01-10 19:21:46 +00:00
964b48abf1 Add entry ports and scores
Surface ports, remakes, scores, and notes on entry detail.

Signed-off-by: codex@lucy.xalior.com
2026-01-10 18:26:34 +00:00
d9f55c3eb6 Add entry relations and tags
Show relations and tag membership sections on entry detail.

Signed-off-by: codex@lucy.xalior.com
2026-01-10 18:23:58 +00:00
06ddeba9bb Polish origins and guidelines
Add issue/magazine links and ordering to entry origins,
and document preferred validation guidance.

Signed-off-by: codex@lucy.xalior.com
2026-01-10 18:18:20 +00:00
fb206734db Add ZXDB origins and label types
Show entry origins data and display label type names
in label detail view.

Signed-off-by: codex@lucy.xalior.com
2026-01-10 18:12:30 +00:00
e2f6aac856 Expand ZXDB entry data and search
Add entry release/license sections, label permissions/licenses,
expanded search scope (titles+aliases+origins), and home search.
Also include ZXDB submodule and update gitignore.

Signed-off-by: codex@lucy.xalior.com
2026-01-10 18:04:04 +00:00
3e13da5552 Improve ZXDB releases list
Link release titles to release detail, add magref count
badges, and show other releases on release detail.

Signed-off-by: codex@lucy.xalior.com
2026-01-10 17:46:57 +00:00
0594b34c62 Add ZXDB breadcrumbs and release places
Add ZXDB breadcrumbs on list/detail pages and group release
magazine references by issue for clearer Places view.

Signed-off-by: codex@lucy.xalior.com
2026-01-10 17:35:36 +00:00
5d140a45a7 Enhance ZXDB releases and caching
Signed-off-by: codex@lucy.xalior.com
2026-01-10 17:05:37 +00:00
208a06c351 Adding more releases, and sorting SASS 2026-01-10 16:55:12 +00:00
686e057bb4 Add missing ZXDB ORM tables
Signed-off-by: codex@lucy.xalior.com
2026-01-10 16:44:02 +00:00
cabd0567f7 Add hostname details to env, for opengraph 2026-01-04 13:37:14 +00:00
31522acd04 missing files 2026-01-01 15:54:59 +00:00
6237ff86d0 A yolo test of codex 2026-01-01 15:42:22 +00:00
a1a04a89cf Adding the first stubs of the magazine browser 2025-12-18 13:10:58 +00:00
2bade1825c Add entry_id relationship links to Entries
- Introduce reusable EntryLink component
- Use EntryLink in Releases and Label detail tables
- Link both ID and title to /zxdb/entries/[id] for consistency

Signed-off-by: Junie@MacOS
2025-12-17 22:30:48 +00:00
07478b280c Fix build errors 2025-12-17 20:22:00 +00:00
89001f53da No explicit any 2025-12-17 20:10:00 +00:00
53a1821547 Remove topbar nav 2025-12-17 19:54:47 +00:00
f563b41792 ZXDB: Releases browser filters, schema lists, and fixes
- UI: Add /zxdb hub cards for Entries and Releases; implement Releases browser
  with URL‑synced filters (q, year, sort, DL language/machine, file/scheme/source/case, demo)
  and a paginated table (Entry ID, Title, Release #, Year).
- API: Add GET /api/zxdb/releases/search (Zod‑validated, Node runtime) supporting
  title, year, sort, and downloads‑based filters; return paged JSON.
- Repo: Rewrite searchReleases to Drizzle QB; correct ORDER BY on releases.release_year;
  implement EXISTS on downloads using explicit "from downloads as d"; return JSON‑safe rows.
- Schema: Align Drizzle models with ZXDB for releases/downloads; add lookups
  availabletypes, currencies, roletypes, and roles relation.
- API (lookups): Add GET /api/zxdb/{availabletypes,currencies,roletypes} for dropdowns.
- Stability: JSON‑clone SSR payloads before passing to Client Components to avoid
  RowDataPacket serialization errors.

Signed-off-by: Junie@lucy.xalior.com
2025-12-16 23:00:38 +00:00
fd4c0f8963 Show downloads even without releases rows
Add synthetic release groups in getEntryById so downloads
are displayed even when there are no matching rows in
`releases` for a given entry. Group by `release_seq`,
attach downloads, and sort groups for stable order.

This fixes cases like /zxdb/entries/1 where `downloads`
exist for the entry but `releases` is empty, resulting in
no downloads shown in the UI.

Signed-off-by: Junie@devbox
2025-12-16 21:47:17 +00:00
285c7da87c Handle missing ZXDB releases/downloads schema gracefully
Prevent runtime crashes when `releases`, `downloads`, or related lookup tables
(`releasetypes`, `schemetypes`, `sourcetypes`, `casetypes`) are absent in the
connected ZXDB MySQL database.

- Repo: gate releases/downloads queries behind a schema capability check using
  `information_schema.tables`; if missing, skip queries and return empty arrays.
- Keeps entry detail page functional on legacy/minimal DB exports while fully
  utilizing rich data when available.

Refs: runtime error "Table 'zxdb.releasetypes' doesn't exist"

Signed-off-by: Junie@quinn
2025-12-16 18:41:14 +00:00
240936a850 Standardize ZXDB UI; add SSR search/tables
Unify the look and feel of all /zxdb pages and minimize client pop-in.

- Make all /zxdb pages full-width to match /explorer
- Convert Languages, Genres, Machine Types, and Labels lists to
  Bootstrap tables with table-striped and table-hover inside
  table-responsive wrappers
- Replace raw FK IDs with linked names via SSR repository joins
- Add scoped search boxes on detail pages (labels, genres, languages,
  machine types) with SSR filtering and pagination that preserves q/tab
- Keep explorer results consistent: show Machine/Language names with
  links, no client lookups required

This improves consistency, readability, and first paint stability across
the ZXDB section while keeping navigation fast and discoverable.

Signed-off-by: Junie@lucy.xalior.com
2025-12-12 16:58:50 +00:00
ddbf72ea52 docs: add ZXDB guide; refresh README & AGENTS
Expand and update documentation to reflect the current app (Registers + ZXDB Explorer), with clear setup and usage instructions.

Changes
- README: add project overview including ZXDB Explorer; routes tour; ZXDB setup (DB import, helper search tables, readonly role); environment configuration; selected API endpoints; implementation notes (Next 15 async params, Node runtime for mysql2, SSR/ISR usage); links to AGENTS.md and docs/ZXDB.md.
- docs/ZXDB.md (new): deep-dive guide covering database preparation, helper tables, environment, Explorer UI, API reference under /api/zxdb, performance approach (helper tables, parallel queries, ISR), troubleshooting, and roadmap.
- AGENTS.md: refresh Project Overview/Structure with ZXDB routes and server/client boundaries; document Next.js 15 dynamic params async pattern for pages and API routes; note Drizzle+mysql2, Node runtime, and lookup `text`→`name` mapping; keep commit workflow guidance.
- example.env: add reference to docs/ZXDB.md and clarify mysql:// format and setup pointers.

Notes
- Documentation focuses on the current state of the codebase (what the code does), not a log of agent actions.
- Helper SQL at ZXDB/scripts/ZXDB_help_search.sql is required for performant searches.

Signed-off-by: Junie@lucy.xalior.com
2025-12-12 16:17:35 +00:00
3ef3a16bc0 Fix ZXDB pagination counters and navigation
Implement URL-driven pagination and correct total counts across ZXDB:
- Root /zxdb: SSR reads ?page; client syncs to SSR; Prev/Next as Links.
- Sub-index pages (genres, languages, machinetypes): parse ?page on server; use SSR props in clients; Prev/Next via Links.
- Labels browse (/zxdb/labels): dynamic SSR, reads ?q & ?page; typed count(*); client syncs to SSR; Prev/Next preserve q.
- Label detail (/zxdb/labels/[id]): tab-aware Prev/Next Links; counters from server.
- Repo: replace raw counts with typed Drizzle count(*) for reliable totals.

Signed-off-by: Junie <Junie@lucy.xalior.com>
2025-12-12 16:11:12 +00:00
54cfe4f175 perf(zxdb): server-render index pages with ISR and initial data
Why
- Reduce time-to-first-content on ZXDB index pages by eliminating the initial client-side fetch and enabling incremental static regeneration.

What
- Main Explorer (/zxdb):
  - Server-renders first page of results and lookup lists (genres, languages, machinetypes) and passes them as initial props.
  - Keeps client interactivity for subsequent searches/filters.
- Labels index (/zxdb/labels):
  - Server-renders first page of empty search and passes as initial props to skip the first fetch.
- Category lists:
  - Genres (/zxdb/genres), Languages (/zxdb/languages), Machine Types (/zxdb/machinetypes) now server-render their lists and export revalidate=3600.
  - Refactored list components to accept server-provided items; removed on-mount fetching.
- Links & prefetch:
  - Replaced remaining anchors with Next Link to enable prefetch where applicable.

Tech details
- Added revalidate=3600 to the index pages for ISR.
- Updated ZxdbExplorer to accept initial results and initial filter lists; skips first client fetch when initial props are present.
- Updated LabelsSearch to accept initial payload and skip first fetch in default state.
- Updated GenreList, LanguageList, MachineTypeList to be presentational components receiving items from server pages.

Notes
- Low-churn list APIs already emit Cache-Control for CDN; list pages now render instantly from server.
- Further polish (breadcrumbs, facet counts UI) can build on this foundation without reintroducing initial network waits.

Signed-off-by: Junie@lucy.xalior.com
2025-12-12 15:31:10 +00:00
ad77b47117 chore: commit pending ZXDB explorer changes prior to index perf work
Context
- Housekeeping commit to capture all current ZXDB Explorer work before index-page performance optimizations.

Includes
- Server-rendered entry detail page with ISR and parallelized DB queries.
- Node runtime for ZXDB API routes and params validation updates for Next 15.
- ZXDB repository extensions (facets, label queries, category queries).
- Cross-linking and Link-based prefetch across ZXDB UI.
- Cache headers on low-churn list APIs.

Notes
- Follow-up commit will focus specifically on speeding up index pages via SSR initial data and ISR.

Signed-off-by: Junie@lucy.xalior.com
2025-12-12 15:25:35 +00:00
3fe6f980c6 feat: integrate ZXDB with Drizzle + deep explorer UI; fix Next 15 dynamic params; align ZXDB schema columns
End-to-end ZXDB integration with environment validation, Drizzle ORM MySQL
setup, typed repositories, Zod-validated API endpoints, and a deep, cross‑
linked Explorer UI under `/zxdb`. Also update dynamic route pages to the
Next.js 15 async `params` API and align ZXDB lookup table columns (`text` vs
`name`).

Summary
- Add t3.gg-style Zod environment validation and typed `env` access
- Wire Drizzle ORM to ZXDB (mysql2 pool, singleton) and minimal schemas
- Implement repositories for search, entry details, label browsing, and
  category listings (genres, languages, machinetypes)
- Expose a set of Next.js API routes with strict Zod validation
- Build the ZXDB Explorer UI with search, filters, sorting, deep links, and
  entity pages (entries, labels, genres, languages, machinetypes)
- Fix Next 15 “sync-dynamic-apis” warning by awaiting dynamic `params`
- Correct ZXDB lookup model columns to use `text` (aliased as `name`)

Details
Env & DB
- example.env: document `ZXDB_URL` with readonly role notes
- src/env.ts: Zod schema validates `ZXDB_URL` as `mysql://…`; fails fast on
  invalid env
- src/server/db.ts: create mysql2 pool from `ZXDB_URL`; export Drizzle instance
- drizzle.config.ts: drizzle-kit configuration (schema path, mysql2 driver)

Schema (Drizzle)
- src/server/schema/zxdb.ts:
  - entries: id, title, is_xrated, machinetype_id, language_id, genretype_id
  - helper tables: search_by_titles, search_by_names, search_by_authors,
    search_by_publishers
  - relations: authors, publishers
  - lookups: labels, languages, machinetypes, genretypes
  - map lookup display columns from DB `text` to model property `name`

Repository
- src/server/repo/zxdb.ts:
  - searchEntries: title search via helper table with filters (genre, language,
    machine), sorting (title, id_desc), and pagination
  - getEntryById: join lookups and aggregate authors/publishers
  - Label flows: searchLabels (helper table), getLabelById, getLabelAuthoredEntries,
    getLabelPublishedEntries
  - Category lists: listGenres, listLanguages, listMachinetypes
  - Category pages: entriesByGenre, entriesByLanguage, entriesByMachinetype

API (Node runtime, Zod validation)
- GET /api/zxdb/search: search entries with filters and sorting
- GET /api/zxdb/entries/[id]: fetch entry detail
- GET /api/zxdb/labels/search, GET /api/zxdb/labels/[id]: label search and detail
- GET /api/zxdb/genres, /api/zxdb/genres/[id]
- GET /api/zxdb/languages, /api/zxdb/languages/[id]
- GET /api/zxdb/machinetypes, /api/zxdb/machinetypes/[id]

UI (App Router)
- /zxdb: Explorer page with search box, filters (genre, language, machine), sort,
  paginated results & links to entries; quick browse links to hubs
- /zxdb/entries/[id]: entry detail client component shows title, badges
  (genre/lang/machine), authors and publishers with cross-links
- /zxdb/labels (+ /[id]): search & label detail with "Authored" and "Published"
  tabs, paginated lists linking to entries
- /zxdb/genres, /zxdb/languages, /zxdb/machinetypes and their /[id] detail pages
  listing paginated entries and deep links
- Navbar: add ZXDB link

Next 15 dynamic routes
- Convert Server Component dynamic pages to await `params` before accessing
  properties:
  - /zxdb/entries/[id]/page.tsx
  - /zxdb/labels/[id]/page.tsx
  - /zxdb/genres/[id]/page.tsx
  - /zxdb/languages/[id]/page.tsx
  - /registers/[hex]/page.tsx (Registers section)
- /api/zxdb/entries/[id]/route.ts: await `ctx.params` before validation

ZXDB schema column alignment
- languages, machinetypes, genretypes tables use `text` for display columns;
  models now map to `name` to preserve API/UI contracts and avoid MySQL 1054
  errors in joins (e.g., entry detail endpoint).

Notes
- Ensure ZXDB helper tables are created (ZXDB/scripts/ZXDB_help_search.sql)
  — required for fast title/name searches and author/publisher lookups.
- Pagination defaults to 20 (max 100). No `select *` used in queries.
- API responses are `cache: no-store` for now; can be tuned later.

Deferred (future work)
- Facet counts in the Explorer sidebar
- Breadcrumbs and additional a11y polish
- Media assets and download links per release

Signed-off-by: Junie@lucy.xalior.com

Signed-off-by: Junie@lucy.xalior.com
2025-12-12 14:41:19 +00:00