Język wynikał z navigator.language liczonego przy każdym renderze, więc nie dało się go wybrać ani zalinkować. Teraz nośnikiem języka jest ścieżka. - src/router.ts: usePathname() na useSyncExternalStore + navigate(). pushState nie emituje zdarzenia, więc bez tego React nie widzi zmiany URL-a. - i18n: useLang(), localizePath(), stripLangPrefix(), setLang(). useT() czyta język ze ścieżki i jest reaktywne na nawigację. - Detekcja przeglądarki tylko przy pierwszym wejściu na "/" i tylko gdy w localStorage nic nie ma; wynik zapisujemy od razu, więc przekierowanie na /en zadziała najwyżej raz i nie nadpisze późniejszego wyboru użytkownika. Deep linki honorujemy bez ruszania. - App.tsx: jedna tablica tras dla obu języków (/en/privacy -> '/privacy'). Ustawia też document.documentElement.lang, bo index.html ma na sztywno "pl". - Header: przełącznik PL/EN (desktop + mobile), <button>, nie <a> — link przeładowałby dokument. - Hrefy w Header/Footer/PrivacyPolicyPage/PlatformPage przez localizePath, inaczej /en jest pułapką jednokierunkową: każdy klik wraca na PL. - index.html: hreflang pl/en/x-default; og:url z gethumanai.com na .pl (wskazywał na cudzą domenę). Bez nowych tłumaczeń treści — to osobny krok. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .junie/memory | ||
| mailer | ||
| src | ||
| .env.example | ||
| .gitignore | ||
| deploy.sh | ||
| Dockerfile | ||
| index.html | ||
| nginx.conf | ||
| package-lock.json | ||
| package.json | ||
| postcss.config.js | ||
| README.md | ||
| tailwind.config.js | ||
| tsconfig.json | ||
| tsconfig.node.json | ||
| vite.config.ts | ||
humanAI — landing page
React + Vite static site, served by nginx in the humanai-landing Docker container,
behind Nginx Proxy Manager on the nginxproxymanager_default network.
Development
npm install
npm run dev
Deploy
./deploy.sh
The script builds images locally, pushes them to piha.local via the piha Docker context,
and runs smoke tests against the mailer endpoint.
Mailer
The mailer/ directory contains a standalone Express microservice that handles the contact
form. It runs as humanai-mailer on the same Docker network as NPM so it can be proxied
without exposing any port to the host.
Manual steps required before first deploy
(a) Create a Fastmail app-password and write credentials to mailer.env on the deploy machine:
# mailer.env (never commit this file)
SMTP_USER=youruser@fastmail.com
SMTP_PASS=your-app-password
(b) In Nginx Proxy Manager → Proxy Host for gethumanai.pl → Custom Locations:
| Field | Value |
|---|---|
| location | /api |
| scheme | http |
| forward hostname | humanai-mailer |
| port | 3000 |