Update ZXDB docs and notes

Document multi-select filters and shared explorer components.

Signed-off-by: codex@lucy.xalior.com
This commit is contained in:
2026-01-11 13:49:13 +00:00
parent 9807005305
commit 61cc729089
3 changed files with 14 additions and 0 deletions

View File

@@ -82,6 +82,7 @@ Implementation notes
- ZXDB integration uses Drizzle ORM over `mysql2` with a singleton pool at `src/server/db.ts`; API routes declare `export const runtime = "nodejs"`. - ZXDB integration uses Drizzle ORM over `mysql2` with a singleton pool at `src/server/db.ts`; API routes declare `export const runtime = "nodejs"`.
- Entry and detail pages serverrender initial content and use ISR (`revalidate = 3600`) for fast timetocontent; index pages avoid a blocking first client fetch. - Entry and detail pages serverrender initial content and use ISR (`revalidate = 3600`) for fast timetocontent; index pages avoid a blocking first client fetch.
- Database Schema: Repository queries include graceful fallback checks (via `information_schema.tables`) to remain functional even if optional tables (like `releases` or `downloads`) are missing from the connected MySQL instance. - Database Schema: Repository queries include graceful fallback checks (via `information_schema.tables`) to remain functional even if optional tables (like `releases` or `downloads`) are missing from the connected MySQL instance.
- Shared explorer UI components live under `src/components/explorer/` and power both `/zxdb` and `/registers` sidebars.
Further reading Further reading
- ZXDB details and API usage: `docs/ZXDB.md` - ZXDB details and API usage: `docs/ZXDB.md`

View File

@@ -76,6 +76,7 @@ All endpoints are under `/api/zxdb` and validate inputs with Zod. Responses are
- `sort``title` or `id_desc` - `sort``title` or `id_desc`
- `scope``title`, `title_aliases`, or `title_aliases_origins` - `scope``title`, `title_aliases`, or `title_aliases_origins`
- `facets` — boolean; if truthy, includes facet counts for genres/languages/machines - `facets` — boolean; if truthy, includes facet counts for genres/languages/machines
- `machinetypeId` accepts a commaseparated list (e.g. `27,26,8,9`) for multiselect filters
- Entry detail - Entry detail
- `GET /api/zxdb/entries/[id]` - `GET /api/zxdb/entries/[id]`
@@ -90,6 +91,13 @@ All endpoints are under `/api/zxdb` and validate inputs with Zod. Responses are
- `GET /api/zxdb/languages` and `/api/zxdb/languages/[id]?page=1` - `GET /api/zxdb/languages` and `/api/zxdb/languages/[id]?page=1`
- `GET /api/zxdb/machinetypes` and `/api/zxdb/machinetypes/[id]?page=1` - `GET /api/zxdb/machinetypes` and `/api/zxdb/machinetypes/[id]?page=1`
- Search releases
- `GET /api/zxdb/releases/search`
- Query params:
- `q`, `page`, `pageSize`, `year`, `sort` — as used in the releases explorer
- `dLanguageId`, `filetypeId`, `schemetypeId`, `sourcetypeId`, `casetypeId`, `isDemo`
- `dMachinetypeId` accepts a commaseparated list for multiselect filters
Runtime: API routes declare `export const runtime = "nodejs"` to support `mysql2`. Runtime: API routes declare `export const runtime = "nodejs"` to support `mysql2`.
## Implementation notes ## Implementation notes
@@ -103,6 +111,7 @@ Runtime: API routes declare `export const runtime = "nodejs"` to support `mysql2
} }
``` ```
- Repository queries parallelize independent calls with `Promise.all` for lower latency. - Repository queries parallelize independent calls with `Promise.all` for lower latency.
- When no machine filter is provided, the explorer prefers machine IDs `27,26,8,9` for sorting.
## Troubleshooting ## Troubleshooting

View File

@@ -36,3 +36,7 @@ Deployment shortcuts
- pnpm deploy-test: push the current branch to test.explorer.specnext.dev - pnpm deploy-test: push the current branch to test.explorer.specnext.dev
- pnpm deploy-prod: push the current branch to explorer.specnext.dev - pnpm deploy-prod: push the current branch to explorer.specnext.dev
- Ensure the corresponding Git remotes are configured locally before using these. - Ensure the corresponding Git remotes are configured locally before using these.
Shared explorer UI
- Reusable explorer layout/sidebar components live in `src/components/explorer/`.
- These power both `/zxdb` and `/registers` filtering UIs.