Conversation
There was a problem hiding this comment.
Pull request overview
This PR migrates the landing page to Next.js Server-Side Generation (SSG) for improved SEO and performance, and restructures internationalization from subdomain-based (fr.mobilitydatabase.org) to path-based (mobilitydatabase.org/fr) routing following Next.js conventions.
Changes:
- Landing page converted to server component with SSG, enabling pre-rendering and better SEO discoverability
- Internationalization restructured to use path prefixes (
/fr) instead of subdomains, following Next.js and Google SEO recommendations - Removed
react-helmet-asyncdependency in favor of Next.js native metadata API
Reviewed changes
Copilot reviewed 30 out of 32 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/proxy.ts |
Replaced subdomain-based locale detection with path-based locale routing using Next.js middleware |
src/i18n/routing.ts |
New centralized routing configuration defining available locales and path prefix behavior |
src/i18n/request.ts |
Updated to use requestLocale parameter from route segments instead of cookies |
src/i18n/navigation.ts |
New locale-aware navigation utilities for Next.js App Router |
src/i18n/config.ts |
Removed (replaced by routing.ts) |
src/app/[locale]/page.tsx |
New SSG landing page with metadata for SEO optimization |
src/app/[locale]/layout.tsx |
New locale-aware root layout replacing old layout.tsx |
src/app/[locale]/components/HomePage.tsx |
Server component version of Home screen with translations |
src/app/[locale]/components/SearchBox.tsx |
Extracted client-side search functionality from Home page |
src/app/screens/Home.tsx |
Removed (replaced by HomePage server component) |
src/app/context/ThemeProvider.tsx |
Fixed SSR hydration issues with theme initialization |
src/app/components/Header.tsx |
Added SSR safety checks and lazy loading for better performance |
src/app/components/ThemeToggle.tsx |
Removed direct localStorage access in favor of context state |
src/app/App.tsx |
Added locale-aware basename for BrowserRouter compatibility |
messages/en.json & messages/fr.json |
Added translation keys for home and about pages |
| xs: 2, | ||
| sm: 4, | ||
| }, | ||
| fontWeight: 700, |
There was a problem hiding this comment.
The fontSize property is missing from this section's styling, but the previous Typography elements specify font sizes. For consistency and proper semantic heading hierarchy, consider adding an appropriate font size (e.g., fontSize: 18 or fontSize: '1.125rem').
| fontWeight: 700, | |
| fontWeight: 700, | |
| fontSize: '1.125rem', |
| <br /> <br /> | ||
| In addition to our database, we develop and maintain other tools that | ||
| integrate with it such as |
There was a problem hiding this comment.
Line 47-48 contains hardcoded English text that should be moved to the translation file. This text is not internationalized while the rest of the page uses t() for translations. Move this content to messages/en.json and messages/fr.json under the about namespace.
| the GBFS Validator. | ||
| {t('gbfsValidator')} | ||
| </Button> | ||
| Additional benefits of using the Mobility Database include |
There was a problem hiding this comment.
This line contains hardcoded English text that should be moved to the translation file. While the list items below use t('benefits.*'), the introductory text is not internationalized. Add this text to the translation files for proper i18n support.
| Additional benefits of using the Mobility Database include | |
| {t('additionalBenefitsIntro')} |
| // TODO: Revisit theme for best SSR practices | ||
|
|
There was a problem hiding this comment.
This TODO comment should be converted to a GitHub issue and linked here, or removed if the current implementation is considered acceptable. The current SSR theme handling may cause the "flash of unstyled content" mentioned in the PR description's follow-up tasks.
| // TODO: Revisit theme for best SSR practices | |
| // Theme is initialized from system preference and persisted via localStorage to | |
| // provide a consistent experience between server-rendered markup and client-side hydration. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary:
closes #1554
Make the landing page a server component and apply best practices for SEO discoverability.
Landing Page Changes
i18n Changed
mobilitydatabase.org/frand notfr.mobilitydatabase.orgFollow up tickets
Expected behavior:
Explain and/or show screenshots for how you expect the pull request to work in your testing (in case other devices exhibit different behavior).
Testing tips:
Provide tips, procedures and sample files on how to test the feature.
Testers are invited to follow the tips AND to try anything they deem relevant outside the bounds of the testing tips.
Please make sure these boxes are checked before submitting your pull request - thanks!
yarn testto make sure you didn't break anythingBuild struture

Screaming Spider SEO Auditing Tool
Current MobilityDatabase landing page

New Landing Page
