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
+38
View File
@@ -0,0 +1,38 @@
import { Navigate } from 'react-router-dom';
import { useAuth } from '@/hooks/useAuth';
import { useLearningJourney } from '@/hooks/useLearningJourney';
/**
* Entry router at "/".
* Routes the learner to the correct step of the single product journey.
*/
export function HomeRedirect() {
const { effectiveUserId, guestSessionHydrated } = useAuth();
const { progress, loading } = useLearningJourney(effectiveUserId ?? undefined);
if (!guestSessionHydrated || (effectiveUserId && loading)) {
return (
<div className="flex min-h-[50vh] items-center justify-center">
<div className="border-primary h-12 w-12 animate-spin rounded-full border-b-2" />
</div>
);
}
if (!effectiveUserId) {
return <Navigate to="/login" replace />;
}
if (!progress?.pre_test_completed_at) {
return <Navigate to="/assessment/pre" replace />;
}
if (!progress?.training_completed_at) {
return <Navigate to="/chat" replace />;
}
if (!progress?.post_test_completed_at) {
return <Navigate to="/assessment/post" replace />;
}
return <Navigate to="/finished" replace />;
}