Agent instructions for this repository.
- Stack: React 19 + TypeScript + Vite frontend, Express backend in
server.js. - Routing: custom state routing in
App.tsx(no React Router). - i18n: i18next with locale files in
src/i18n/locales. - SEO: per-view
Seocomponent usage, plus sitemap generation during build.
For full context, prefer these docs instead of duplicating details:
Use npm scripts from package.json:
npm run dev: starts Vite on port 3000.npm run start: starts Express backend on port 8080.npm run build: Vite production build + sitemap generation.
Development behavior:
- For end-to-end local testing (including contact form), run BOTH
npm run startandnpm run dev. - Vite proxies
/api/*tohttp://localhost:8080.
- Keep route changes in sync in
App.tsx:Pageunion typePAGE_PATHSPATH_PAGESrenderPage()switch
- Keep navigation-aware components using
setPagecallback patterns already used byNavbar,Footer, and views. - Use existing styling approach (Tailwind utility classes + design language already present).
- Use Framer Motion for non-trivial motion and transitions.
- Keep API form submissions aligned with existing
/api/contactbehavior and validation shape.
- When adding a page/view:
- Add proper
<Seo />metadata in the view. - Add route to sitemap route list in
vite.config.ts.
- Add proper
- When adding copy:
- Update all locale files in
src/i18n/locales(en,pt,fr,es) to avoid fallback-only behavior.
- Update all locale files in
Expected environment variables:
RESEND_API_KEY(required for contact email flow)PORT(default 8080)VITE_SITE_URL(used for canonical URL generation)
Do not print or commit secret values when debugging.
There is no dedicated lint/test script currently. Use:
npm run buildas the primary validation gate.- If touching API behavior, also smoke test
POST /api/contactwith required fields.
- Running only
npm run devwill not validate backend-dependent flows. - This repository uses custom SPA routing; introducing React Router would be a behavior change.
- Keep route-level SEO and sitemap updates together to avoid discoverability regressions.