Add player difficulty ratings, drop hint system, use Peninsular Spanish in Gemini prompt

Players can now submit a voluntary 1-5 difficulty rating after a story
ends (POST /api/stories/:id/ratings), stored in data/ratings.json. A new
reclassifyDifficulty script (wired to a weekly systemd timer) averages
those ratings and adjusts a story's difficulty band once it has enough
votes. The progressive hint system is removed end-to-end (schema, Gemini
prompt/response schema, generation instructions), and the Gemini prompt
is rewritten in Peninsular Spanish with an explicit instruction to
generate story content in Spain Spanish rather than any LatAm variant.
Also translates remaining Spanish code comments/error strings to English
and updates the backend README and systemd units accordingly.
This commit is contained in:
dasemu committed 2026-08-24 04:53:12 +02:00
1 parent 7f3e6cc839
commit 99a903f6e1
20 files changed
+275 -97

No files matched your search

+7 -7
View File
@@ -1,17 +1,17 @@
# Ejemplo de virtual host para nginx en el LXC de Debian.
# Sirve el frontend (build estatica de Vite) y reversa-proxea /api al backend
# Node que corre en localhost:8787 via el servicio systemd story-api.
# Example nginx virtual host for the Debian LXC.
# Serves the frontend (static Vite build) and reverse-proxies /api to the
# Node backend running on localhost:8787 via the story-api systemd service.
#
# Copialo a /etc/nginx/sites-available/historias, ajusta el dominio y la ruta,
# y despues:
# Copy it to /etc/nginx/sites-available/historias, adjust the domain and
# path, then:
# ln -s /etc/nginx/sites-available/historias /etc/nginx/sites-enabled/historias
# nginx -t && systemctl reload nginx
# Para TLS con Let's Encrypt: certbot --nginx -d tu-dominio.com
# For TLS with Let's Encrypt: certbot --nginx -d your-domain.example
server {
listen 80;
listen [::]:80;
server_name tu-dominio.com;
server_name your-domain.example;
root /opt/historias/frontend/dist;
index index.html;
+2 -2
View File
@@ -1,5 +1,5 @@
[Unit]
Description=API de Historias Incompletas
Description=Sí, no, o indiferente API
After=network.target
[Service]
@@ -11,7 +11,7 @@ EnvironmentFile=/opt/historias/backend/.env
ExecStart=/usr/bin/node /opt/historias/backend/dist/index.js
Restart=on-failure
RestartSec=5
# Endurecimiento basico del sandbox systemd
# Basic systemd sandbox hardening
NoNewPrivileges=true
ProtectSystem=strict
ProtectHome=true
+1 -1
View File
@@ -1,5 +1,5 @@
[Unit]
Description=Genera 5 historias nuevas del dia con Gemini
Description=Generates 5 new stories for the day with Gemini
After=network-online.target
Wants=network-online.target
+1 -1
View File
@@ -1,5 +1,5 @@
[Unit]
Description=Dispara la generacion diaria de historias (story-generate.service)
Description=Triggers the daily story generation (story-generate.service)
[Timer]
OnCalendar=*-*-* 06:00:00
+11
View File
@@ -0,0 +1,11 @@
[Unit]
Description=Reclassifies story difficulty from player ratings
After=network.target
[Service]
Type=oneshot
User=historias
Group=historias
WorkingDirectory=/opt/historias/backend
EnvironmentFile=/opt/historias/backend/.env
ExecStart=/usr/bin/node /opt/historias/backend/dist/scripts/reclassifyDifficulty.js
+10
View File
@@ -0,0 +1,10 @@
[Unit]
Description=Triggers the periodic difficulty reclassification (story-reclassify.service)
[Timer]
OnCalendar=Sun *-*-* 05:00:00
RandomizedDelaySec=600
Persistent=true
[Install]
WantedBy=timers.target