feat: EduEasy checkpoint - plan, scaffolding, pedagogia modules, components child+parent, API routes, Prisma schema, Docker infra, Better Auth

This commit is contained in:
Renato
2026-07-20 17:58:49 +02:00
commit e69b18abaa
49 changed files with 9842 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
import { NextResponse } from "next/server"
import type { NextRequest } from "next/server"
const CHILD_HOST = "mate"
const PARENT_HOST = "simulacro"
export function middleware(request: NextRequest) {
const hostname = request.headers.get("host") || ""
const { pathname } = request.nextUrl
if (pathname.startsWith("/api") || pathname.startsWith("/_next") || pathname.startsWith("/static") || pathname === "/favicon.ico") {
return NextResponse.next()
}
if (hostname.includes(CHILD_HOST)) {
if (pathname === "/" || pathname.startsWith("/child")) {
return NextResponse.next()
}
const url = request.nextUrl.clone()
url.pathname = `/child${pathname === "/" ? "" : pathname}`
return NextResponse.rewrite(url)
}
if (hostname.includes(PARENT_HOST)) {
if (pathname === "/" || pathname.startsWith("/parent")) {
return NextResponse.next()
}
const url = request.nextUrl.clone()
url.pathname = `/parent${pathname === "/" ? "" : pathname}`
return NextResponse.rewrite(url)
}
return NextResponse.next()
}
export const config = {
matcher: ["/((?!_next/static|_next/image|favicon.ico).*)"],
}