Ship Novya PWA with backend for deployable production use.

Fix production TypeScript builds and add DEPLOY.md so the app can be hosted from this repo.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
ar.badiei
2026-09-03 21:01:52 +03:30
co-authored by Cursor
parent aa9236fb92
commit 370ac15471
193 changed files with 25997 additions and 1991 deletions
@@ -0,0 +1,34 @@
/**
* PCQ-24 Reverse Scoring Configuration
*
* Reverse scoring formula: 7 - rawValue
* After reversal, a value of 1 becomes 6, 2 becomes 5, 3 becomes 4, etc.
*
* Reverse-scored questions (as specified):
* - pcq_13 (Question 13 — Resilience dimension)
* - pcq_20 (Question 20 — Optimism dimension)
* - pcq_23 (Question 23 — Optimism dimension)
*
* Scale: 1–6
* Reversed: 1→6, 2→5, 3→4, 4→3, 5→2, 6→1
*/
import type { PcqLikertValue } from '@/config/pcq24';
/** Set of question IDs that must be reverse-scored */
export const REVERSE_SCORED_QUESTIONS = new Set<string>(['pcq_13', 'pcq_20', 'pcq_23']);
/** Returns true if the given question ID is reverse-scored */
export function isReverseScored(questionId: string): boolean {
return REVERSE_SCORED_QUESTIONS.has(questionId);
}
/**
* Apply the PCQ-24 reverse scoring formula: 7 − rawValue
*
* @param rawValue - Likert value as string or number (expected 1–6)
* @returns reversed score (6→1, 5→2, 4→3, 3→4, 2→5, 1→6)
*/
export function applyReverseScoring(rawValue: PcqLikertValue | string): number {
return 7 - Number(rawValue);
}