# CLAUDE.md This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. ## What this is Randify is a bilingual (EN/RU) static site (Astro 4 + Tailwind CSS 4) hosting random-value generators. All 10 generators are live. Deployed to randify.pro on reg.ru via GitHub Actions + rsync on push to `main`. **i18n is handled via Astro's built-in i18n routing.** English pages live at `src/pages/`, Russian pages at `src/pages/ru/`. Both share identical templates because `BaseLayout`, `GeneratorLayout`, and components derive the active locale from `Astro.currentLocale`. ## Commands ```bash npm run dev # Dev server (localhost:4321) npm run build # Static build → dist/ npm run preview # Serve the built dist/ locally ``` **Docker (production):** multi-stage build with Node 20, served via `nginx:alpine` with pretty URLs. ```bash docker build -t randify . docker run -p 8080:80 randify ``` No test runner or linter is configured. ## Adding a new generator Every new generator must be created in **both English and Russian simultaneously**. 1. **`src/content/generators/.json`** — create a JSON file with all fields: `slug`, `title`, `description`, `icon`, `status`, `seoTitle`, `seoDescription`, `ruTitle`, `ruDescription`, `ruSeoTitle`, `ruSeoDescription`, `pageTitle`, `ruPageTitle`, `howTo`, `whenTo`, `ruHowTo`, `ruWhenTo`. The schema is defined in `src/lib/generator-schema.ts` and validated automatically at build time via Zod (`.strict()` — unknown fields will fail the build). 2. **`src/components/generators/Generator.astro`** — the interactive component. Language detection pattern: - Frontmatter: `const isRu = Astro.url.pathname.startsWith('/ru'); const T = useT(isRu ? 'ru' : 'en');` - Client script: `const isRu = document.documentElement.lang === 'ru';` - Use `T.*` keys for all user-visible strings in the template; use `isRu` ternaries in the `