Skip to content

Conversation

williasc
Copy link
Member

Closes #75.

The VM ran the Slim dataset (1 007 wines), so reviewers could not test how the solution scales (delivery 3 feedback, finding F02). The VM now runs Full: 100 646 wines and 21 013 536 ratings.

What

On the VM (done 17 Nov, not part of the diff)

  • Backed up the database first: ~/vinmonopolet-slim-2026-11-17.dump in williasc's home.
  • Downloaded Full from the X-Wines Google Drive to /tmp, imported it with seed-xwines.ts under nohup, ran VACUUM (ANALYZE) and deleted the files.
  • The import took 8 minutes: wines 14.1 s, ratings 443 s, averages 13.4 s. The database is 2.4 GB, and the VM has 2.7 GB of disk left.
  • Existing student reviews and users are kept.

Docs

  • README: the VM uses Full. The load test shows VM times next to the local ones.
  • docs/vm.md: «Load the Slim dataset» is now «Load the Full dataset»: backup, download, import, cleanup and how to go back to Slim.
  • docs/tasks.md: the scaling task is ticked.

ESLint fix

  • AuthForm.tsx: one ref per input instead of an object of refs, which React's lint rules reported as reading a ref during render.
  • eslint.config.js: skip the generated coverage/ folder.

How it was tested

  • npm run check from the root: all 7 checks pass
  • On the VM: 100 646 wines, all with an average, 21 013 536 ratings, and the review and user from before still there
  • Request times through Apache on the VM (median of three after a warm-up): first page 12 ms, «pinot noir» 32 ms, red from Italy 4+ 15 ms, filter counts 344 ms
  • Frontend, deep links and GraphQL respond on the VM
  • By hand: errors in the login form still move focus to the first field with an error (covered by AuthForm.test.tsx)

Notes

  • The filter counts take 344 ms on the VM against 57 ms locally. The VM has one CPU core, and that query goes through every matching wine. It is fast enough, but it is the first place to look if we work on performance.
  • The backend still listens on all interfaces, so port 3001 can be reached without going through Apache (F18). Not changed here.

Full X-Wines (100 646 wines, 21 013 536 ratings) is loaded on the VM.
The README and vm.md describe the import and show the VM's timings,
and the scaling task is ticked.

Also fixes the ESLint error in AuthForm (one ref per input) and skips
the generated coverage folder, so npm run check passes.
@williasc williasc requested a review from a team as a code owner November 17, 2026 20:35
@williasc williasc linked an issue Nov 17, 2026 that may be closed by this pull request
4 tasks
# Conflicts:
#	frontend/eslint.config.js
#	frontend/src/features/auth/components/AuthForm.tsx
Copy link
Member

@manerlan manerlan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, have checked that the full dataset is loaded on the vm, documentation seems good also

@manerlan manerlan merged commit 24db345 into main Nov 18, 2026
@manerlan manerlan deleted the 75-load-the-full-x-wines-dataset-on-the-vm branch November 18, 2026 09:56
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Load the Full X-Wines dataset on the VM
2 participants