feat: fase 5 — botones volver, seguridad APIs, infraestructura

- Botón 'Volver' en todas las sesiones de ejercicios (ExerciseSession)
- Botón 'Cambiar perfil' en las 3 home pages (Isabella/Francesca/Sebastián)
- Páginas inline de Isabella migradas a ExerciseSession (elimina código duplicado)
- APIs con try/catch: curriculum/next, dashboard/summary, fsrs/next, children
- Validación childId en curriculum/next (404 si no existe)
- /api/health endpoint para Docker healthcheck
- .env.example, .dockerignore, README.md creados
- docker-compose.yml con healthcheck en app service
- Test E2E: health endpoint + childId validation
- 62/62 tests pasan, TS exit 0
This commit is contained in:
renato97
2026-07-26 02:00:27 -03:00
parent ce7cb27290
commit 411f235f75
18 changed files with 470 additions and 457 deletions
+9 -4
View File
@@ -2,10 +2,11 @@ import { NextRequest, NextResponse } from "next/server"
import { prisma } from "@/lib/db"
export async function GET(request: NextRequest) {
const childId = request.nextUrl.searchParams.get("childId")
if (!childId) {
return NextResponse.json({ error: "childId required" }, { status: 400 })
}
try {
const childId = request.nextUrl.searchParams.get("childId")
if (!childId) {
return NextResponse.json({ error: "childId required" }, { status: 400 })
}
const today = new Date()
today.setHours(0, 0, 0, 0)
@@ -118,6 +119,10 @@ export async function GET(request: NextRequest) {
}
: null,
})
} catch (error) {
console.error("[dashboard/summary] error:", error)
return NextResponse.json({ error: "Internal error" }, { status: 500 })
}
}
async function calculateStreak(childId: string): Promise<number> {