Files
Art-gallery/README.md
Danila KhodjaefandClaude Opus 5 72fe45fa52 Document the test suite in the command and setup docs.
`package.json` has had a `test` script since the interior-polish work landed,
and 12 files under `server/__tests__/` now guard hall geometry, clearance,
brightness, window styles and the movement-links validators. Nothing outside
`data-and-images.md` said the suite existed, and no document said how to run
it — despite Bible.md requiring tests to be written before the code.

FAC.md gains a Tests section between Verify and Build frontend: the command,
what the suite covers by area, and the two properties that make it cheap to
run — no test framework (Node's built-in runner) and no database or server,
since the tests read the client's style and geometry modules from disk.

setup.md lists `npm test` first in the Run table and notes on the Node
prerequisite that the script depends on `node --test` expanding `**` itself.
README.md gets the command beside the dev-server ones, and the interiors
section of data-and-images.md now points at the suite that enforces its rules.

Docs only; no source changes. Verified by running the suite (15 suites, 41
tests, all passing) and by confirming from PowerShell — which does not expand
globs — that the runner does its own pattern matching.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-15 22:04:59 +03:00

103 lines
5.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Art Gallery
Interactive virtual art gallery: zoomable historical timeline (classic left→right, vertical, or **Tree of Art** lineage chart — shareable via `?layout=`) with era click-to-zoom, major event markers (vertical guides into the movement flow), branching art-movement streams (click a movement name to enter its **3D movement gallery** — photorealistic period interiors with painted walls, stone, and wood textures; chronological wings with up to ~55 works each, side-wall windows, wing navigator), one 3D hall per artist (parquet floor, movement-tinted walls, black/gold frames by review status, corridor layout for large catalogs, museum-style exit doors, golden influence lamps, canvas placeholders for missing works, influence-linked exits), painting detail with art-history annotations, prev/next catalog browsing and fullscreen lightbox, **curator-gated** debug-mode image audit on painting detail and artist bio (**Checked** / **Fix it** / **More** / **Clear** / **Upload**; painting detail also **Remove entry**), optional **Show more** auto-opens the search picker, Checkup page, preserved gallery camera on return, and Wikipedia-sourced artist biographies. Anonymous visitors browse freely; curators sign in via **Curator login** in the header.
## Documentation
| Document | Purpose |
|----------|---------|
| [Documentation/Bible.md](Documentation/Bible.md) | Agent instructions (primary source for AI assistants) |
| [Documentation/basics.md](Documentation/basics.md) | Architecture, layout, user flow |
| [Documentation/ui-interaction-and-component-standards.md](Documentation/ui-interaction-and-component-standards.md) | UI interaction, navigation, and component standards |
| [Documentation/movement-tree.md](Documentation/movement-tree.md) | **Tree of Art** start page — tree layout rules |
| [Documentation/FAC.md](Documentation/FAC.md) | **Command cheat sheet** — start/stop, import, deploy |
| [Documentation/environments.md](Documentation/environments.md) | Dev/prod URLs, DB split, deploy, sync |
| [Documentation/setup.md](Documentation/setup.md) | Install, env, npm scripts |
| [Documentation/DB_structure.md](Documentation/DB_structure.md) | PostgreSQL tables |
| [Documentation/API.md](Documentation/API.md) | REST endpoints |
| [Documentation/data-and-images.md](Documentation/data-and-images.md) | Catalog, bios, seeding, image pipeline |
## Stack
- **Backend:** Node.js, Express, PostgreSQL
- **Frontend:** React, Vite, Three.js (`@react-three/fiber`, `@react-three/drei`)
## Setup
1. Copy `.env.example` to `.env` and set database credentials (`DB_NAME=gallery_dev` after [one-time split](Documentation/environments.md)). Set `SESSION_SECRET`, `CURATOR_USERNAME`, and `CURATOR_PASSWORD` for curator login (see [setup.md](Documentation/setup.md)).
2. Install dependencies:
```bash
npm install
cd client && npm install && cd ..
```
3. Apply database schema (requires PostgreSQL superuser for first-time setup):
```bash
npm run dev:migrate
npm run dev:seed
```
4. Enrich the catalog (recommended after seed):
```bash
npm run dev:sync-image-paths # import paintings from data/images/paintings/ when present
npm run dev:fetch-artist-images # link or download artist portraits
npm run dev:fetch-artist-bios # Wikipedia biographies for all artists
npm run dev:expand-catalog # add famous works for artists with thin catalogs
npm run dev:update-influences # art-history lineage links (detail panels + 3D hall)
npm run dev:migrate:artist-palette # optional: JSONB column for PainterPalette enrichment
npm run dev:import-painter-palette # optional: metadata + influence links from Inputs/PainterPalette.csv
npm run dev:migrate:checkup-flags # review/fixed flags for Checkup + debug mode (paintings)
npm run dev:migrate:artist-checkup-flags # same flags for artist portraits (bio debug)
npm run dev:migrate:painting-annotations # art-history notes on painting detail
npm run dev:update-painting-annotations # load curated notes (+ optional --wikipedia)
npm run dev:fetch-images -- --limit=50 # random batch of missing images (10s per work)
npm run dev:fetch-images -- --artist="Claude Monet" # one artist in catalog order
```
5. **Development (public URL):**
```bash
npm run dev:web
```
Open https://devgallery.mysuperlab.netcraze.pro (or http://localhost:5173 locally).
**Production:** https://gallery.mysuperlab.netcraze.pro — see [Documentation/environments.md](Documentation/environments.md) and [infra/docker/DEPLOY-truenas.md](infra/docker/DEPLOY-truenas.md).
## Deployed URLs
| Environment | URL | Host |
|-------------|-----|------|
| Development | https://devgallery.mysuperlab.netcraze.pro | Dev PC `:5173` (Vite) + `:3451` (API) |
| Production | https://gallery.mysuperlab.netcraze.pro | TrueNAS Docker `:5173` |
Operator guide: [Documentation/environments.md](Documentation/environments.md).
## Development
**Workflow:** All changes are made and tested on **dev** (`gallery_dev`, https://devgallery.mysuperlab.netcraze.pro). Production is updated on a **scheduled release** (~weekly): promote DB/images, build/push the Docker image, restart TrueNAS. See [Documentation/environments.md](Documentation/environments.md#development-first-workflow-default).
**Public dev (Keenetic):**
```bash
npm run dev:web # Vite :5173, API :3451
```
**Tests** (Node’s built-in runner — no database or server needed):
```bash
npm test # 15 suites, 41 tests
```
Per [Documentation/Bible.md](Documentation/Bible.md), write the test before the code it covers.
**Local HMR:**
```bash
npm run dev:server # API — PORT from .env
npm run dev:client # http://localhost:5173 (proxies /api and /images)
```