feat: app educativa comarques de Catalunya v3

- 6 nivells de dificultat (flashcards, tria, uneix, escriu, mapa, mapa cec)
- Registre de jugadors sense contrasenya (nom + emoji avatar)
- Backend Node.js + Express + PostgreSQL (pg)
- Mapa SVG interactiu amb dades GeoJSON reals (ICGC)
- Filtre de comarques per jugador (muntanya, BCN, GI, LL, T, totes)
- Estadistiques per nivell guardades a PostgreSQL
- Panel d'administrador amb PIN
- Manual integrat per a nens de 10-12 anys
- Mode offline (fallback sense backend)
- Deploy: Docker + Nginx + Let's Encrypt a Oracle Cloud ARM
This commit is contained in:
Jaume Garriga Maestre
2026-05-02 00:15:30 +02:00
commit 3f251d6dc2
10 changed files with 1914 additions and 0 deletions

21
Dockerfile Normal file
View File

@@ -0,0 +1,21 @@
# Multi-arch: funciona en ARM64 (Oracle Ampere) i AMD64
FROM node:20-alpine
WORKDIR /app
# pg (node-postgres) és pur JS — no cal compilació nativa
COPY package*.json ./
RUN npm install --omit=dev --no-audit --no-fund
COPY server.js ./
# Els fitxers estàtics (index.html, comarca-paths.js) es munten com a volum
# en /app/public/ — no s'inclouen a la imatge per facilitar actualitzacions.
RUN mkdir -p /app/public
EXPOSE 3003
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s \
CMD wget -qO- http://localhost:3003/api/health || exit 1
CMD ["node", "server.js"]