f5bc39fbbf
Phase 6 — архитектурный skeleton нового интерактивного учебника 'Геометрия — 9 класс' (Казаков В.В., 2019). 16 параграфов, 4 главы. - Миграция 021_geometry_9_hub.sql: hub + 4 главы. Hub: rose-палитра, sort_order 8. ch1 amber (§1–§6), ch2 emerald (§7–§9), ch3 violet (§10–§12), ch4 cyan (§13–§16). - geometry_9_hub.html: rose/pink-палитра, 4 карточки глав, свернутый финал курса с placeholder для Phase 11. - geometry_9_ch1..ch4.html: полный skeleton по образцу algebra_9_ch4 — sidebars, search modal, achievement popup, XP/progress sync. Builder'ы — stub'ы 'В разработке (Phase 7)'. - backend/scripts/gen_geom9.js: вспомогательный генератор ch2–ch4 для воспроизводимости (одноразовый). Sample dark-theme palettes на каждую главу + SIDEBARS/TIPS с реальными краткими сводками формул учебника. Наполнение параграфов — следующими сессиями (Phase 7+).
backend/scripts
Operational scripts for LearnSpace backend.
Cron setup (production)
# Daily backup at 4am
0 4 * * * /path/to/repo/backend/scripts/backup.sh
# Weekly verification at 6am Sunday (cron mails on non-zero exit)
0 6 * * 0 /path/to/repo/backend/scripts/verify-backup.sh
Scripts
backup.sh
Creates a safe SQLite snapshot via VACUUM INTO. Keeps last 7 backups (configurable via KEEP=14).
./backup.sh # default: ../data/learnspace.db → ../../backups/
./backup.sh /path/to/db /path/to/backups
KEEP=14 ./backup.sh
verify-backup.sh
Restores the latest backup to /tmp, runs PRAGMA integrity_check, compares row counts vs production.
Exit codes:
0— all checks passed2— no backup files found3— latest backup older than 48h (backup job may have stopped)4—integrity_checkfailed (backup is corrupt)5— user count diverged >5% from production
./verify-backup.sh
BACKUP_DIR=/custom/backups PROD_DB=/custom/db.sqlite ./verify-backup.sh
check-route-auth.js
Scans src/routes/*.js for :id-bearing routes without an auth-guard middleware.
Fails if new unprotected routes exceed the current baseline.
npm run lint:routes
import-content.js (coming in Task 8)
Imports question collections from YAML manifests into the database.
npm run import:content -- ../content/phys/ct-2024.yaml
Deploy order (first time / fresh server)
npm install
npm run migrate
npm run seed:permissions
npm start