From 3b7b1382b436d99dad2876f0a04aeab231b8597f Mon Sep 17 00:00:00 2001 From: emil Date: Sat, 9 May 2026 13:32:35 +0300 Subject: [PATCH] feat: add password generator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds /generators/password/ with length slider (4–64), uppercase/lowercase/digits/symbols toggles, guaranteed character-type coverage, Fisher-Yates shuffle, and clipboard copy. Sets password status to live in the generator catalog. Also adds CLAUDE.md with project architecture notes. Co-Authored-By: Claude Sonnet 4.6 --- CLAUDE.md | 37 ++++ .../generators/PasswordGenerator.astro | 201 ++++++++++++++++++ src/data/generators.ts | 2 +- src/pages/generators/password.astro | 63 ++++++ 4 files changed, 302 insertions(+), 1 deletion(-) create mode 100644 CLAUDE.md create mode 100644 src/components/generators/PasswordGenerator.astro create mode 100644 src/pages/generators/password.astro diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..a2e2dce --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,37 @@ +# 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 static site (Astro 4 + Tailwind CSS 4) that hosts random-value generators. Only the number generator is live; the rest are catalogued in `src/data/generators.ts` with `status: 'coming-soon'`. + +## 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 compiles with Node 20 then serves via `nginx:alpine`. The nginx config handles pretty URLs via `try_files $uri $uri/index.html`. + +```bash +docker build -t randify . +docker run -p 8080:80 randify +``` + +## Architecture + +**Adding a new generator** involves three steps: + +1. Add an entry to `src/data/generators.ts` (set `status: 'live'` when ready). +2. Create `src/components/generators/Generator.astro` — interactive logic goes in an inline ` diff --git a/src/data/generators.ts b/src/data/generators.ts index 91e039a..7579d87 100644 --- a/src/data/generators.ts +++ b/src/data/generators.ts @@ -26,7 +26,7 @@ export const generators: Generator[] = [ title: 'Password', description: 'Create a strong, random password with custom rules.', icon: 'lock', - status: 'coming-soon', + status: 'live', }, { slug: 'lottery', diff --git a/src/pages/generators/password.astro b/src/pages/generators/password.astro new file mode 100644 index 0000000..1613a4e --- /dev/null +++ b/src/pages/generators/password.astro @@ -0,0 +1,63 @@ +--- +import BaseLayout from '../../layouts/BaseLayout.astro'; +import PasswordGenerator from '../../components/generators/PasswordGenerator.astro'; +import AdBanner from '../../components/AdBanner.astro'; +import { generators } from '../../data/generators'; + +const generator = generators.find((g) => g.slug === 'password')!; +--- + + +
+ + +
+
+ + randify +
+

+ {generator.title} Generator +

+

{generator.description}

+
+ +
+ +
+ +
+ + + +
+
+