diff --git a/Dockerfile b/Dockerfile
index 5f73241..4dbdc40 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -15,4 +15,4 @@ ENV NODE_ENV=production \
EXPOSE 5173
-CMD ["node", "server.js"]
+CMD ["node", "src/server/index.js"]
diff --git a/data/years.json b/data/years.json
index c1ff079..f52d851 100644
--- a/data/years.json
+++ b/data/years.json
@@ -4615,8 +4615,8 @@
"title": "I Heard It Through The Grapevine",
"artist": "Marvin Gaye",
"mbid": "d97b9286-07ce-436f-bb31-2d880b9476ee",
- "earliestDate": "1988",
- "year": 1988,
+ "earliestDate": "1968",
+ "year": 1968,
"confidence": {
"mbScore": 100,
"titleSim": 1,
@@ -5314,8 +5314,8 @@
"title": "La Bamba",
"artist": "Ritchie Valens",
"mbid": "821f5395-f90f-432f-a807-da8dbb45ceb6",
- "earliestDate": "1963",
- "year": 1963,
+ "earliestDate": "1958",
+ "year": 1958,
"confidence": {
"mbScore": 96,
"titleSim": 1,
diff --git a/package.json b/package.json
index ecb1fb9..bfad438 100644
--- a/package.json
+++ b/package.json
@@ -3,11 +3,11 @@
"version": "0.1.0",
"private": true,
"description": "Local Hitster-like multiplayer web app using WebSockets and local MP3s",
- "main": "server.js",
+ "main": "src/server/index.js",
"type": "module",
"scripts": {
- "start": "node server.js",
- "dev": "nodemon server.js",
+ "start": "node src/server/index.js",
+ "dev": "nodemon src/server/index.js",
"years:resolve": "node scripts/resolve-years.js",
"years:resolve:10": "node scripts/resolve-years.js --max 10",
"years:force": "node scripts/resolve-years.js --force"
diff --git a/public/client.js b/public/client.js
index 4a2a367..0bf1acf 100644
--- a/public/client.js
+++ b/public/client.js
@@ -1,3 +1,5 @@
+import { badgeColorForYear } from './utils/colors.js';
+
let ws;
let reconnectAttempts = 0;
let reconnectTimer = null;
@@ -233,17 +235,7 @@ function shortName(id) {
function escapeHtml(s) { return String(s).replace(/[&<>"']/g, c => ({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c])); }
-// Stable distinct color per year for the year badge
-function badgeColorForYear(y) {
- const val = (y === undefined || y === null) ? '?' : y;
- if (val === '?' || Number.isNaN(Number(val))) {
- // Neutral slate for unknown years
- return 'background-color: hsl(215 16% 34%);';
- }
- const n = Number(val);
- const hue = ((n * 23) % 360 + 360) % 360; // spread hues deterministically
- return `background-color: hsl(${hue} 70% 42%);`;
-}
+// color helper imported from utils/colors.js
function handleMessage(ev) {
const msg = JSON.parse(ev.data);
diff --git a/public/index.html b/public/index.html
index ebead02..063cf8b 100644
--- a/public/index.html
+++ b/public/index.html
@@ -152,6 +152,6 @@
-
+