From d32a112e84ae15ac25aa1b5623c2c55b378cfb0f Mon Sep 17 00:00:00 2001 From: KonstantinMB Date: Tue, 19 May 2026 10:48:57 +0300 Subject: [PATCH] Render a real 404 page for unknown routes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Unknown URLs previously rendered as a 200 with an empty body — typos and stale shared links landed users on a blank page with no nav and no way to recover. Adds NotFoundPage as the last route inside the Layout block so the nav is preserved and the user can navigate out. Closes #12 Co-Authored-By: Claude Opus 4.7 (1M context) --- frontend/src/App.tsx | 2 ++ frontend/src/pages/NotFoundPage.tsx | 51 +++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 frontend/src/pages/NotFoundPage.tsx diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 3e29843..c7a9a87 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -30,6 +30,7 @@ import { ShareHub } from './pages/ShareHub'; import { CompanyCardPage } from './pages/CompanyCardPage'; import { HiringBoardPagePaginated } from './pages/HiringBoardPagePaginated'; import { HiringAnalyticsPage } from './pages/HiringAnalyticsPage'; +import { NotFoundPage } from './pages/NotFoundPage'; import './index.css'; const queryClient = new QueryClient({ @@ -185,6 +186,7 @@ function AnimatedRoutes() { } /> } /> } /> + } /> ); diff --git a/frontend/src/pages/NotFoundPage.tsx b/frontend/src/pages/NotFoundPage.tsx new file mode 100644 index 0000000..1e80a55 --- /dev/null +++ b/frontend/src/pages/NotFoundPage.tsx @@ -0,0 +1,51 @@ +import { Link, useLocation } from 'react-router-dom'; +import { Helmet } from 'react-helmet-async'; +import { ArrowLeft } from 'lucide-react'; + +export function NotFoundPage() { + const location = useLocation(); + + return ( +
+ + 404 Not Found — ExploreYC + + +
+
+ $ cd {location.pathname} +
+
+ error: no such file or directory +
+ +

+ > Page not found +

+

+ The page you're looking for doesn't exist on ExploreYC — yet. + If you followed a link from somewhere else, it might be stale. +

+ +
+
Try one of these:
+ → Home (the YC company explorer) + → Hiring board + → Idea validator + → Batch analytics + → For founders +
+ +
+ + + Back to home + +
+
+
+ ); +}