🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.
Add username generation tools and enhance related tools section
Bill Yang55c5941bd417
diff --git a/docs/src/app/(home)/tools/(font-generators)/[slug]/page.tsx b/docs/src/app/(home)/tools/(font-generators)/[slug]/page.tsxindex c1247c78f..663be87c1 100644--- a/docs/src/app/(home)/tools/(font-generators)/[slug]/page.tsx+++ b/docs/src/app/(home)/tools/(font-generators)/[slug]/page.tsx@@ -3,6 +3,7 @@ import { FontGeneratorTool } from "../../components/FontGeneratorTool";import AICommentForm from "../../components/AICommentForm";import PageNameGenerator from "../../components/PageNameGenerator";import PostGenerator from "../../components/PostGenerator";+import UsernameGenerator from "../../components/UsernameGenerator";import { platformConfigs, platformList } from "../../components/platform-configs";import {commentPlatformConfigs,@@ -16,6 +17,10 @@ import {postGeneratorPlatformConfigs,postGeneratorPlatformList,} from "../../components/post-generator-platform-configs";+import {+ usernameGeneratorPlatformConfigs,+ usernameGeneratorPlatformList,+} from "../../components/username-generator-platform-configs";import type { Metadata } from "next";import { notFound } from "next/navigation";@@ -43,11 +48,16 @@ export async function generateStaticParams() {slug: `${platform.id}-post-generator`,}));+ const usernameGenerators = usernameGeneratorPlatformList.map((platform) => ({+ slug: `${platform.id}-username-generator`,+ }));+return [...fontGenerators,...commentGenerators,...pageNameGenerators,...postGenerators,+ ...usernameGenerators,];}@@ -57,6 +67,36 @@ export async function generateMetadata({}: PageProps): Promise<Metadata> {const { slug } = await params;+ // Check if it's a username generator+ if (slug.endsWith("-username-generator")) {+ const platformId = slug.replace("-username-generator", "");+ const platform = usernameGeneratorPlatformConfigs[platformId];++ if (!platform) {+ return { title: "Username Generator Not Found" };+ }++ return {+ title: `${platform.displayName} | AI-Powered ${platform.name} Usernames`,+ description: platform.description,+ openGraph: {+ title: platform.displayName,+ description: platform.description,+ type: "website",+ url: `https://rybbit.com/tools/${platform.id}-username-generator`,+ siteName: "Rybbit Documentation",+ },+ twitter: {+ card: "summary_large_image",+ title: platform.displayName,+ description: platform.description,+ },+ alternates: {+ canonical: `https://rybbit.com/tools/${platform.id}-username-generator`,+ },+ };+ }+// Check if it's a post generatorif (slug.endsWith("-post-generator")) {const platformId = slug.replace("-post-generator", "");@@ -181,6 +221,188 @@ export async function generateMetadata({export default async function PlatformToolPage({ params }: PageProps) {const { slug } = await params;+ // Check if it's a username generator+ if (slug.endsWith("-username-generator")) {+ const platformId = slug.replace("-username-generator", "");+ const platform = usernameGeneratorPlatformConfigs[platformId];++ // Handle invalid platform+ if (!platform) {+ notFound();+ }++ const structuredData = {+ "@context": "https://schema.org",+ "@type": "WebApplication",+ name: platform.displayName,+ description: platform.description,+ url: `https://rybbit.com/tools/${platform.id}-username-generator`,+ applicationCategory: "Utility",+ offers: {+ "@type": "Offer",+ price: "0",+ priceCurrency: "USD",+ },+ author: {+ "@type": "Organization",+ name: "Rybbit",+ url: "https://rybbit.com",+ },+ };++ const educationalContent = (+ <>+ <h2 className="text-2xl font-bold text-neutral-900 dark:text-white mb-4">+ About {platform.name} Usernames+ </h2>+ <p className="text-neutral-700 dark:text-neutral-300 leading-relaxed mb-6">+ {platform.educationalContent}+ </p>++ <h3 className="text-xl font-semibold text-neutral-900 dark:text-white mb-3">+ How to Use This Tool+ </h3>+ <ol className="space-y-2 text-neutral-700 dark:text-neutral-300 mb-6">+ <li>+ <strong>Enter your name or brand</strong> - What should the+ username be based on?+ </li>+ <li>+ <strong>Add interests (optional)</strong> - Include keywords or+ interests to incorporate+ </li>+ <li>+ <strong>Choose number preference</strong> - Decide if you want+ numbers included+ </li>+ <li>+ <strong>Click "Generate Usernames"</strong> to get 5 unique+ suggestions+ </li>+ <li>+ <strong>Check availability</strong> on {platform.name} and claim+ your favorite+ </li>+ </ol>++ <h3 className="text-xl font-semibold text-neutral-900 dark:text-white mb-3">+ Username Best Practices for {platform.name}+ </h3>+ <ul className="space-y-2 text-neutral-700 dark:text-neutral-300 mb-6">+ <li>+ <strong>Keep it memorable:</strong> Choose something easy to spell+ and remember+ </li>+ <li>+ <strong>Make it brandable:</strong> Think long-term - will this+ still work in 5 years?+ </li>+ <li>+ <strong>Avoid excessive numbers:</strong> Numbers make usernames+ harder to remember and share+ </li>+ <li>+ <strong>Check availability:</strong> Always verify the username is+ available before committing+ </li>+ <li>+ <strong>Be consistent:</strong> Use the same or similar username+ across platforms when possible+ </li>+ </ul>++ <div className="bg-emerald-50 dark:bg-emerald-900/20 border border-emerald-200 dark:border-emerald-800 rounded-lg p-4 mb-6">+ <h4 className="font-semibold text-emerald-900 dark:text-emerald-100 mb-2">+ Platform Requirements+ </h4>+ <ul className="space-y-1 text-sm text-emerald-800 dark:text-emerald-200">+ <li>+ <strong>Allowed characters:</strong>{" "}+ {platform.allowedCharacters}+ </li>+ {platform.characterLimit && (+ <li>+ <strong>Maximum length:</strong> {platform.characterLimit}{" "}+ characters+ </li>+ )}+ {platform.minLength && (+ <li>+ <strong>Minimum length:</strong> {platform.minLength}{" "}+ characters+ </li>+ )}+ </ul>+ </div>++ <p className="text-sm text-neutral-600 dark:text-neutral-400 mt-6">+ <strong>Note:</strong> Always check availability on {platform.name}{" "}+ before settling on a username. Generated suggestions are not+ guaranteed to be available.+ </p>+ </>+ );++ const faqs = [+ {+ question: `How does the ${platform.name} username generator work?`,+ answer: `This tool uses AI to create creative, memorable usernames based on your name, brand, or interests. It considers ${platform.name}'s character limits and naming rules to generate platform-appropriate suggestions.`,+ },+ {+ question: "Are the generated usernames available?",+ answer: `No, this tool generates creative suggestions but doesn't check availability on ${platform.name}. Always verify that your chosen username is available on the platform before committing to it.`,+ },+ {+ question: "Can I modify the generated usernames?",+ answer:+ "Absolutely! Use the generated usernames as inspiration and modify them to better fit your preferences. Combining elements from different suggestions often works well.",+ },+ {+ question: "Should I include numbers in my username?",+ answer:+ "Generally, avoid excessive numbers as they make usernames harder to remember and share verbally. However, a single strategic number can work if it's meaningful or makes the username unique.",+ },+ {+ question: "What makes a good username?",+ answer: `A good ${platform.name} username is memorable, easy to spell, appropriate for the platform, and reflects your brand or personality. It should be something you're comfortable using long-term and sharing professionally if needed.`,+ },+ {+ question: "How can Rybbit help me grow my presence?",+ answer: (+ <>+ Once you've claimed your username, Rybbit helps you track+ engagement, clicks, and growth on {platform.name}. Understand your+ audience and optimize your content strategy.{" "}+ <a+ href="https://rybbit.com"+ className="text-emerald-600 hover:text-emerald-500 underline"+ >+ Start tracking for free+ </a>+ .+ </>+ ),+ },+ ];++ return (+ <ToolPageLayout+ toolSlug={`${platform.id}-username-generator`}+ title={platform.displayName}+ description={platform.description}+ badge="AI-Powered Tool"+ toolComponent={<UsernameGenerator platform={platform} />}+ educationalContent={educationalContent}+ faqs={faqs}+ relatedToolsCategory="social-media"+ ctaTitle={`Build your ${platform.name} presence with Rybbit`}+ ctaDescription={`Track your growth and engagement on ${platform.name} to optimize your content strategy.`}+ ctaEventLocation={`${platform.id}_username_generator_cta`}+ structuredData={structuredData}+ />+ );+ }+// Check if it's a post generatorif (slug.endsWith("-post-generator")) {const platformId = slug.replace("-post-generator", "");diff --git a/docs/src/app/(home)/tools/components/UsernameGenerator.tsx b/docs/src/app/(home)/tools/components/UsernameGenerator.tsxnew file mode 100644index 000000000..821d0e709--- /dev/null+++ b/docs/src/app/(home)/tools/components/UsernameGenerator.tsx@@ -0,0 +1,214 @@+"use client";++import { CheckCircle, Copy, Loader2 } from "lucide-react";+import { useState } from "react";+import type { UsernameGeneratorPlatformConfig } from "./username-generator-platform-configs";++interface UsernameGeneratorProps {+ platform: UsernameGeneratorPlatformConfig;+}++export default function UsernameGenerator({+ platform,+}: UsernameGeneratorProps) {+ const [name, setName] = useState("");+ const [interests, setInterests] = useState("");+ const [includeNumbers, setIncludeNumbers] = useState(false);+ const [usernames, setUsernames] = useState<string[]>([]);+ const [isLoading, setIsLoading] = useState(false);+ const [error, setError] = useState("");+ const [copiedIndex, setCopiedIndex] = useState<number | null>(null);+ const [remainingRequests, setRemainingRequests] = useState<number | null>(+ null+ );++ const generateUsernames = async () => {+ if (!name.trim() && !interests.trim()) {+ setError("Please provide your name or interests");+ return;+ }++ setIsLoading(true);+ setError("");+ setUsernames([]);++ try {+ const response = await fetch("/api/tools/generate-username", {+ method: "POST",+ headers: {+ "Content-Type": "application/json",+ },+ body: JSON.stringify({+ name: name.trim(),+ interests: interests.trim(),+ includeNumbers,+ platform: platform.id,+ characterLimit: platform.characterLimit,+ minLength: platform.minLength,+ }),+ });++ const remaining = response.headers.get("X-RateLimit-Remaining");+ if (remaining) {+ setRemainingRequests(parseInt(remaining));+ }++ if (!response.ok) {+ const data = await response.json();+ throw new Error(data.error || "Failed to generate usernames");+ }++ const data = await response.json();+ setUsernames(data.usernames);+ } catch (err) {+ setError(err instanceof Error ? err.message : "An error occurred");+ } finally {+ setIsLoading(false);+ }+ };++ const copyToClipboard = async (text: string, index: number) => {+ try {+ await navigator.clipboard.writeText(text);+ setCopiedIndex(index);+ setTimeout(() => setCopiedIndex(null), 2000);+ } catch (err) {+ console.error("Failed to copy:", err);+ }+ };++ return (+ <div className="space-y-6">+ <div>+ <label+ htmlFor="name"+ className="block text-sm font-medium text-neutral-700 dark:text-neutral-300 mb-2"+ >+ Your Name or Brand+ </label>+ <input+ id="name"+ type="text"+ className="w-full px-4 py-3 bg-white dark:bg-neutral-800 border border-neutral-300 dark:border-neutral-700 rounded-lg text-neutral-900 dark:text-white placeholder-neutral-400 focus:outline-none focus:ring-2 focus:ring-emerald-500"+ placeholder="Enter your name, brand, or nickname"+ value={name}+ onChange={(e) => setName(e.target.value)}+ maxLength={100}+ />+ </div>++ <div>+ <label+ htmlFor="interests"+ className="block text-sm font-medium text-neutral-700 dark:text-neutral-300 mb-2"+ >+ Interests or Keywords (Optional)+ </label>+ <input+ id="interests"+ type="text"+ className="w-full px-4 py-3 bg-white dark:bg-neutral-800 border border-neutral-300 dark:border-neutral-700 rounded-lg text-neutral-900 dark:text-white placeholder-neutral-400 focus:outline-none focus:ring-2 focus:ring-emerald-500"+ placeholder="e.g., gaming, tech, art, music"+ value={interests}+ onChange={(e) => setInterests(e.target.value)}+ maxLength={100}+ />+ </div>++ <div className="flex items-center gap-3">+ <input+ id="includeNumbers"+ type="checkbox"+ className="w-4 h-4 text-emerald-600 bg-white dark:bg-neutral-800 border-neutral-300 dark:border-neutral-700 rounded focus:ring-2 focus:ring-emerald-500"+ checked={includeNumbers}+ onChange={(e) => setIncludeNumbers(e.target.checked)}+ />+ <label+ htmlFor="includeNumbers"+ className="text-sm font-medium text-neutral-700 dark:text-neutral-300"+ >+ Include numbers in usernames+ </label>+ </div>++ <button+ onClick={generateUsernames}+ disabled={isLoading || (!name.trim() && !interests.trim())}+ className="w-full px-6 py-3 bg-emerald-600 hover:bg-emerald-500 disabled:bg-neutral-400 dark:disabled:bg-neutral-700 text-white font-medium rounded-lg transition-colors flex items-center justify-center gap-2"+ >+ {isLoading ? (+ <>+ <Loader2 className="w-5 h-5 animate-spin" />+ Generating Usernames...+ </>+ ) : (+ "Generate Usernames"+ )}+ </button>++ {remainingRequests !== null && (+ <p className="text-sm text-center text-neutral-600 dark:text-neutral-400">+ {remainingRequests} requests remaining this minute+ </p>+ )}++ {error && (+ <div className="p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg">+ <p className="text-sm text-red-800 dark:text-red-200">{error}</p>+ </div>+ )}++ {usernames.length > 0 && (+ <div className="space-y-4">+ <h3 className="text-lg font-semibold text-neutral-900 dark:text-white">+ Generated Usernames+ </h3>+ {usernames.map((username, index) => (+ <div+ key={index}+ className="p-4 bg-white dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 rounded-lg"+ >+ <div className="flex items-center justify-between gap-3">+ <p className="flex-1 text-lg font-medium text-neutral-900 dark:text-white font-mono">+ {platform.usernamePrefix}+ {username}+ </p>+ <button+ onClick={() => copyToClipboard(username, index)}+ className="flex-shrink-0 p-2 hover:bg-neutral-100 dark:hover:bg-neutral-700 rounded-lg transition-colors"+ title="Copy to clipboard"+ >+ {copiedIndex === index ? (+ <CheckCircle className="w-5 h-5 text-emerald-600" />+ ) : (+ <Copy className="w-5 h-5 text-neutral-600 dark:text-neutral-400" />+ )}+ </button>+ </div>+ <p className="text-xs text-neutral-500 dark:text-neutral-400 mt-1">+ {username.length} characters+ {platform.characterLimit &&+ ` / ${platform.characterLimit} limit`}+ </p>+ </div>+ ))}+ </div>+ )}++ <div className="p-4 bg-neutral-50 dark:bg-neutral-800/50 border border-neutral-200 dark:border-neutral-700 rounded-lg space-y-2">+ <p className="text-sm text-neutral-700 dark:text-neutral-300">+ <strong>Platform Guidelines:</strong> {platform.contextGuidelines}+ </p>+ <p className="text-xs text-neutral-600 dark:text-neutral-400">+ <strong>Allowed characters:</strong> {platform.allowedCharacters}+ </p>+ {platform.characterLimit && (+ <p className="text-xs text-neutral-600 dark:text-neutral-400">+ <strong>Character limit:</strong> {platform.characterLimit}{" "}+ characters+ </p>+ )}+ </div>+ </div>+ );+}diff --git a/docs/src/app/(home)/tools/components/username-generator-platform-configs.ts b/docs/src/app/(home)/tools/components/username-generator-platform-configs.tsnew file mode 100644index 000000000..c74905b40--- /dev/null+++ b/docs/src/app/(home)/tools/components/username-generator-platform-configs.ts@@ -0,0 +1,294 @@+export interface UsernameGeneratorPlatformConfig {+ id: string;+ name: string;+ displayName: string;+ description: string;+ simpleIconSlug: string;+ colorHex: string;+ characterLimit?: number;+ minLength?: number;+ allowedCharacters: string;+ educationalContent: string;+ contextGuidelines: string;+ usernamePrefix?: string; // e.g., "@" for Twitter+}++export const usernameGeneratorPlatformConfigs: Record<+ string,+ UsernameGeneratorPlatformConfig+> = {+ instagram: {+ id: "instagram",+ name: "Instagram",+ displayName: "Instagram Username Generator",+ description:+ "Generate creative Instagram usernames with AI. Create memorable handles that are unique, brandable, and perfect for your profile.",+ simpleIconSlug: "instagram",+ colorHex: "#E4405F",+ characterLimit: 30,+ minLength: 1,+ allowedCharacters: "letters, numbers, periods, and underscores",+ usernamePrefix: "@",+ contextGuidelines:+ "Instagram usernames should be memorable, easy to spell, and reflect your brand or personality. They can't contain spaces or special characters (except periods and underscores).",+ educationalContent: `Your Instagram username (handle) is your unique identifier on the platform. It appears in your profile URL, in @mentions, and in DMs. A good username is memorable, easy to spell, and helps people find and remember you.++Effective Instagram usernames are short, brandable, and relevant to your content or niche. They avoid excessive numbers or underscores that make them hard to remember. The best usernames are instantly recognizable and easy to share verbally.`,+ },+ tiktok: {+ id: "tiktok",+ name: "TikTok",+ displayName: "TikTok Username Generator",+ description:+ "Generate catchy TikTok usernames with AI. Create unique handles that stand out and attract followers in TikTok's creative community.",+ simpleIconSlug: "tiktok",+ colorHex: "#000000",+ characterLimit: 24,+ minLength: 1,+ allowedCharacters: "letters, numbers, periods, and underscores",+ usernamePrefix: "@",+ contextGuidelines:+ "TikTok usernames should be creative, memorable, and fit the platform's fun, trendy vibe. Avoid excessive numbers or characters that make them hard to type.",+ educationalContent: `Your TikTok username is your identity on the platform and appears in all your videos, comments, and profile interactions. It's crucial for brand recognition and discoverability.++Effective TikTok usernames are creative, catchy, and reflect your content niche or personality. They're easy to remember and pronounce, making them shareable. The best usernames hint at your content style or vibe without being too literal.`,+ },+ x: {+ id: "x",+ name: "X (Twitter)",+ displayName: "X (Twitter) Username Generator",+ description:+ "Generate memorable X (Twitter) usernames with AI. Create unique handles that are professional, brandable, and easy to remember.",+ simpleIconSlug: "x",+ colorHex: "#000000",+ characterLimit: 15,+ minLength: 4,+ allowedCharacters: "letters, numbers, and underscores",+ usernamePrefix: "@",+ contextGuidelines:+ "X/Twitter usernames must be 4-15 characters and can only contain letters, numbers, and underscores. They should be memorable and professional.",+ educationalContent: `Your X (Twitter) username (@handle) is permanent and appears in your profile URL, @mentions, and replies. It's a critical part of your brand identity on the platform.++Effective X usernames are concise, memorable, and professional. They avoid excessive numbers or underscores that make them hard to remember or type. The best usernames are short enough to fit easily in tweets and memorable enough to be shared verbally.`,+ },+ twitch: {+ id: "twitch",+ name: "Twitch",+ displayName: "Twitch Username Generator",+ description:+ "Generate gaming-focused Twitch usernames with AI. Create memorable handles that resonate with gaming and streaming communities.",+ simpleIconSlug: "twitch",+ colorHex: "#9146FF",+ characterLimit: 25,+ minLength: 4,+ allowedCharacters: "letters, numbers, and underscores",+ usernamePrefix: "",+ contextGuidelines:+ "Twitch usernames should be gaming-appropriate, memorable, and easy to pronounce for voice chat. They become your channel URL and brand identity.",+ educationalContent: `Your Twitch username is your channel identity and appears in your URL, chat, and all platform interactions. It's permanent (though you can change it once every 60 days) and crucial for building your streaming brand.++Effective Twitch usernames are memorable, easy to pronounce (important for voice chat), and often relate to gaming or your content niche. They avoid confusing characters or excessive numbers. The best usernames are brandable and work well for potential merch or branding.`,+ },+ youtube: {+ id: "youtube",+ name: "YouTube",+ displayName: "YouTube Username Generator",+ description:+ "Generate memorable YouTube channel handles with AI. Create unique usernames that help viewers find and remember your channel.",+ simpleIconSlug: "youtube",+ colorHex: "#FF0000",+ characterLimit: 30,+ minLength: 3,+ allowedCharacters: "letters, numbers, periods, and underscores",+ usernamePrefix: "@",+ contextGuidelines:+ "YouTube handles should be memorable, reflect your channel's content, and be easy to spell. They appear in your channel URL and @mentions.",+ educationalContent: `YouTube handles (@username) are unique identifiers that make your channel easy to find and mention. They appear in URLs, comments, and when people tag your channel.++Effective YouTube handles are memorable, relevant to your content, and easy to spell. They're short enough to be easily shared but descriptive enough to give viewers an idea of your content. The best handles are brandable and work across other social platforms.`,+ },+ reddit: {+ id: "reddit",+ name: "Reddit",+ displayName: "Reddit Username Generator",+ description:+ "Generate creative Reddit usernames with AI. Create memorable handles that reflect your personality and Reddit's unique culture.",+ simpleIconSlug: "reddit",+ colorHex: "#FF4500",+ characterLimit: 20,+ minLength: 3,+ allowedCharacters: "letters, numbers, underscores, and hyphens",+ usernamePrefix: "u/",+ contextGuidelines:+ "Reddit usernames are permanent and should reflect your personality or interests. They can be humorous, creative, or descriptive.",+ educationalContent: `Your Reddit username (u/username) is permanent and appears on all your posts, comments, and interactions. It's a key part of your Reddit identity and reputation.++Effective Reddit usernames are creative, memorable, and often humorous or clever. They might reference memes, puns, or personal interests. Unlike other platforms, Reddit culture appreciates quirky, creative usernames. The best usernames are unique without being too cryptic.`,+ },+ discord: {+ id: "discord",+ name: "Discord",+ displayName: "Discord Username Generator",+ description:+ "Generate unique Discord usernames with AI. Create memorable handles for gaming communities and friend groups.",+ simpleIconSlug: "discord",+ colorHex: "#5865F2",+ characterLimit: 32,+ minLength: 2,+ allowedCharacters: "letters, numbers, periods, and underscores",+ usernamePrefix: "",+ contextGuidelines:+ "Discord usernames should be memorable and appropriate for gaming/community contexts. They can be creative, funny, or cool.",+ educationalContent: `Discord usernames identify you across servers and in DMs. While you can have different nicknames in different servers, your username is your core identity on Discord.++Effective Discord usernames are memorable, appropriate for gaming/community contexts, and easy to type. They can be creative, funny, or reflect your interests. The best usernames work well in both casual and organized communities.`,+ },+ github: {+ id: "github",+ name: "GitHub",+ displayName: "GitHub Username Generator",+ description:+ "Generate professional GitHub usernames with AI. Create handles that reflect your developer identity and look good on your resume.",+ simpleIconSlug: "github",+ colorHex: "#181717",+ characterLimit: 39,+ minLength: 1,+ allowedCharacters: "letters, numbers, and hyphens",+ usernamePrefix: "",+ contextGuidelines:+ "GitHub usernames should be professional since they appear on your profile URL and in all contributions. Many developers use their real name or a professional handle.",+ educationalContent: `Your GitHub username appears in your profile URL, on all your repositories, and in your contribution history. Many employers and collaborators will see it, making professionalism important.++Effective GitHub usernames are professional, memorable, and often related to your real name or developer identity. They avoid excessive numbers or random characters. The best usernames are brandable and appropriate for sharing with potential employers or clients.`,+ },+ pinterest: {+ id: "pinterest",+ name: "Pinterest",+ displayName: "Pinterest Username Generator",+ description:+ "Generate creative Pinterest usernames with AI. Create memorable handles that reflect your style and attract followers.",+ simpleIconSlug: "pinterest",+ colorHex: "#E60023",+ characterLimit: 30,+ minLength: 3,+ allowedCharacters: "letters, numbers, and underscores",+ usernamePrefix: "@",+ contextGuidelines:+ "Pinterest usernames should be memorable, brandable, and reflect your niche or style. They appear in your profile URL and when people @mention you.",+ educationalContent: `Your Pinterest username appears in your profile URL, in mentions, and when people share your pins. It's an important part of your brand on the platform.++Effective Pinterest usernames are creative, reflect your niche (e.g., DIY, fashion, recipes), and are easy to remember. They're brandable and work well for potential business use. The best usernames give viewers an idea of what content to expect.`,+ },+ snapchat: {+ id: "snapchat",+ name: "Snapchat",+ displayName: "Snapchat Username Generator",+ description:+ "Generate fun Snapchat usernames with AI. Create unique handles that are creative, memorable, and perfect for your snap identity.",+ simpleIconSlug: "snapchat",+ colorHex: "#FFFC00",+ characterLimit: 15,+ minLength: 3,+ allowedCharacters: "letters, numbers, periods, underscores, and hyphens",+ usernamePrefix: "",+ contextGuidelines:+ "Snapchat usernames are permanent (can't be changed), so choose carefully. They should be fun, memorable, and easy to share with friends.",+ educationalContent: `Your Snapchat username is permanent and is how friends add you on the platform. Unlike your display name (which can be changed), your username can never be changed, so choose wisely.++Effective Snapchat usernames are fun, easy to remember, and easy to spell when sharing with friends. They're often creative or playful, reflecting Snapchat's casual, personal nature. The best usernames are short and memorable enough to share verbally.`,+ },+ spotify: {+ id: "spotify",+ name: "Spotify",+ displayName: "Spotify Username Generator",+ description:+ "Generate creative Spotify usernames with AI. Create memorable handles for your music profile and playlists.",+ simpleIconSlug: "spotify",+ colorHex: "#1DB954",+ characterLimit: 30,+ minLength: 1,+ allowedCharacters: "letters, numbers, periods, and underscores",+ usernamePrefix: "",+ contextGuidelines:+ "Spotify usernames appear on your profile and playlists. They should be memorable and reflect your music taste or personality.",+ educationalContent: `Your Spotify username identifies your profile and appears on your public playlists. While your display name can be changed, your username is more permanent.++Effective Spotify usernames are memorable and often reflect music taste, personality, or your real name. They're brandable if you're building a curator presence. The best usernames work well if you're sharing playlists publicly or building a following.`,+ },+ steam: {+ id: "steam",+ name: "Steam",+ displayName: "Steam Username Generator",+ description:+ "Generate gaming-focused Steam usernames with AI. Create memorable handles for your gaming profile and friend connections.",+ simpleIconSlug: "steam",+ colorHex: "#000000",+ characterLimit: 32,+ minLength: 2,+ allowedCharacters: "letters, numbers, and underscores",+ usernamePrefix: "",+ contextGuidelines:+ "Steam usernames (account names) are permanent and used for login. Choose something memorable but professional enough for your gaming identity.",+ educationalContent: `Your Steam username (account name) is permanent and used for login, while your profile name (display name) can be changed. The username is less visible but still important for account management.++Effective Steam usernames are memorable, gaming-appropriate, and professional enough for long-term use. While less visible than your display name, it's permanent, so choose something you won't regret.`,+ },+ linkedin: {+ id: "linkedin",+ name: "LinkedIn",+ displayName: "LinkedIn Custom URL Generator",+ description:+ "Generate professional LinkedIn custom URLs with AI. Create clean, professional profile URLs that look great on resumes and business cards.",+ simpleIconSlug: "linkedin",+ colorHex: "#0A66C2",+ characterLimit: 100,+ minLength: 3,+ allowedCharacters: "letters, numbers, and hyphens",+ usernamePrefix: "linkedin.com/in/",+ contextGuidelines:+ "LinkedIn custom URLs should be professional and typically use your name. They appear on your resume, business cards, and in your profile link.",+ educationalContent: `Your LinkedIn custom URL (vanity URL) appears in your profile link and is what you share on resumes, business cards, and professional materials. A clean URL looks more professional than the default random string.++Effective LinkedIn URLs typically use your name or a professional variation. They're short, professional, and easy to remember. The best URLs use your full name if available, or a professional abbreviation. Avoid numbers unless necessary.`,+ },+ medium: {+ id: "medium",+ name: "Medium",+ displayName: "Medium Username Generator",+ description:+ "Generate professional Medium usernames with AI. Create memorable handles for your writing profile and articles.",+ simpleIconSlug: "medium",+ colorHex: "#000000",+ characterLimit: 30,+ minLength: 1,+ allowedCharacters: "letters, numbers, and underscores",+ usernamePrefix: "@",+ contextGuidelines:+ "Medium usernames appear in your profile URL and when you publish articles. They should be professional and reflect your writing identity.",+ educationalContent: `Your Medium username appears in your profile URL, on your articles, and when people mention you. It's an important part of your writer identity on the platform.++Effective Medium usernames are professional, memorable, and often related to your name or writing niche. They're brandable and appropriate for professional contexts. The best usernames work well if you're building a writing portfolio or personal brand.`,+ },+ substack: {+ id: "substack",+ name: "Substack",+ displayName: "Substack URL Generator",+ description:+ "Generate professional Substack subdomain URLs with AI. Create memorable URLs for your newsletter that are easy to share and remember.",+ simpleIconSlug: "substack",+ colorHex: "#FF6719",+ characterLimit: 63,+ minLength: 1,+ allowedCharacters: "letters, numbers, and hyphens",+ usernamePrefix: "",+ contextGuidelines:+ "Substack subdomains become your newsletter URL (yourname.substack.com). They should be professional, memorable, and related to your newsletter's name or topic.",+ educationalContent: `Your Substack subdomain is your newsletter's primary URL (yourname.substack.com) and is crucial for branding and shareability. It's one of the first things potential subscribers see.++Effective Substack URLs are professional, memorable, and related to your newsletter name or topic. They're short enough to be easily shared and remembered. The best URLs reflect your newsletter's brand and are appropriate for professional promotion.`,+ },+};++export const usernameGeneratorPlatformList = Object.values(+ usernameGeneratorPlatformConfigs+);diff --git a/docs/src/app/(home)/tools/page.tsx b/docs/src/app/(home)/tools/page.tsxindex 1d0f7c558..74b02b1c4 100644--- a/docs/src/app/(home)/tools/page.tsx+++ b/docs/src/app/(home)/tools/page.tsx@@ -26,6 +26,7 @@ import { platformList } from "./components/platform-configs";import { commentPlatformList } from "./components/comment-platform-configs";import { pageNamePlatformList } from "./components/page-name-platform-configs";import { postGeneratorPlatformList } from "./components/post-generator-platform-configs";+import { usernameGeneratorPlatformList } from "./components/username-generator-platform-configs";import {SiDiscord,SiX,@@ -49,6 +50,8 @@ import {SiGithub,SiMedium,SiSubstack,+ SiSnapchat,+ SiSteam,} from "@icons-pack/react-simple-icons";export const metadata = {@@ -232,6 +235,8 @@ const platformIconMap: Record<string, any> = {github: SiGithub,medium: SiMedium,substack: SiSubstack,+ snapchat: SiSnapchat,+ steam: SiSteam,};const fontGeneratorTools = platformList.map(platform => ({@@ -262,11 +267,19 @@ const postGeneratorTools = postGeneratorPlatformList.map(platform => ({description: `Generate engaging posts for ${platform.name} with AI-powered content creation.`,}));+const usernameGeneratorTools = usernameGeneratorPlatformList.map(platform => ({+ href: `/tools/${platform.id}-username-generator`,+ icon: platformIconMap[platform.id],+ title: platform.displayName,+ description: `Generate creative usernames for ${platform.name} with AI.`,+}));+const socialMediaTools = [...fontGeneratorTools,...commentGeneratorTools,...pageNameGeneratorTools,...postGeneratorTools,+ ...usernameGeneratorTools,];function ToolCard({ tool }: { tool: { href: string; icon: any; title: string; description: string } }) {diff --git a/docs/src/app/api/tools/generate-username/route.ts b/docs/src/app/api/tools/generate-username/route.tsnew file mode 100644index 000000000..db2b1c1b3--- /dev/null+++ b/docs/src/app/api/tools/generate-username/route.ts@@ -0,0 +1,153 @@+import { callOpenRouter } from "@/lib/openrouter";+import { getClientIP, rateLimit } from "@/lib/rate-limit";+import { NextRequest, NextResponse } from "next/server";+import { z } from "zod";++const requestSchema = z.object({+ name: z.string().max(100).optional(),+ interests: z.string().max(100).optional(),+ includeNumbers: z.boolean(),+ platform: z.string(),+ characterLimit: z.number().optional(),+ minLength: z.number().optional(),+});++export async function POST(request: NextRequest) {+ try {+ // Rate limiting - 5 requests per minute+ const ip = getClientIP(request);+ const rateLimitResult = rateLimit(+ `username-generator:${ip}`,+ 5,+ 60 * 1000+ );++ const headers = new Headers({+ "X-RateLimit-Limit": rateLimitResult.limit.toString(),+ "X-RateLimit-Remaining": rateLimitResult.remaining.toString(),+ "X-RateLimit-Reset": new Date(rateLimitResult.reset).toISOString(),+ });++ if (!rateLimitResult.success) {+ return NextResponse.json(+ { error: "Rate limit exceeded. Please try again later." },+ { status: 429, headers }+ );+ }++ // Parse and validate request+ const body = await request.json();+ const validatedData = requestSchema.parse(body);++ if (!validatedData.name && !validatedData.interests) {+ return NextResponse.json(+ { error: "Please provide at least name or interests" },+ { status: 400, headers }+ );+ }++ const nameText = validatedData.name+ ? `Name/Brand: ${validatedData.name}`+ : "";+ const interestsText = validatedData.interests+ ? `Interests/Keywords: ${validatedData.interests}`+ : "";++ const characterLimitText = validatedData.characterLimit+ ? `\n- Maximum ${validatedData.characterLimit} characters`+ : "";+ const minLengthText = validatedData.minLength+ ? `\n- Minimum ${validatedData.minLength} characters`+ : "";+ const numbersText = validatedData.includeNumbers+ ? "\n- Can include numbers strategically"+ : "\n- Avoid excessive numbers";++ // Call OpenRouter to generate usernames+ const prompt = `You are a creative branding expert specializing in ${validatedData.platform} usernames. Generate 5 unique, memorable usernames based on:++${nameText}+${interestsText}++Requirements:${characterLimitText}${minLengthText}${numbersText}+- Must be unique and brandable+- Easy to spell, pronounce, and remember+- Appropriate for ${validatedData.platform}+- Avoid excessive special characters, numbers, or underscores+- Make them creative but not too random or cryptic+- Each username should be distinct and take different creative approaches+- Only use characters allowed on ${validatedData.platform}++Return ONLY a JSON array of username strings (without any @ symbol or prefix) in this exact format:+["username1", "username2", "username3", "username4", "username5"]++Do not include any markdown formatting, explanation, or additional text - just the raw JSON array of strings.`;++ const response = await callOpenRouter([+ {+ role: "user",+ content: prompt,+ },+ ]);++ // Parse JSON response+ let usernames;+ try {+ // Extract JSON from response+ const jsonMatch = response.match(/\[[\s\S]*\]/);+ if (!jsonMatch) {+ throw new Error("No JSON array found in response");+ }+ usernames = JSON.parse(jsonMatch[0]);++ // Validate it's an array of strings+ if (+ !Array.isArray(usernames) ||+ !usernames.every((u) => typeof u === "string")+ ) {+ throw new Error("Invalid username format");+ }++ // Filter out usernames that exceed limits if specified+ if (validatedData.characterLimit) {+ usernames = usernames.filter(+ (username) => username.length <= validatedData.characterLimit!+ );+ }++ if (validatedData.minLength) {+ usernames = usernames.filter(+ (username) => username.length >= validatedData.minLength!+ );+ }++ // If we filtered out too many, we might have fewer than 5 usernames+ if (usernames.length === 0) {+ throw new Error(+ "Generated usernames didn't meet requirements. Please try again."+ );+ }+ } catch (error) {+ console.error("Parse error:", error);+ return NextResponse.json(+ { error: "Failed to parse generated usernames. Please try again." },+ { status: 500, headers }+ );+ }++ return NextResponse.json({ usernames }, { headers });+ } catch (error) {+ if (error instanceof z.ZodError) {+ return NextResponse.json(+ { error: "Invalid request data", details: z.treeifyError(error) },+ { status: 400 }+ );+ }++ console.error("Username generation error:", error);+ return NextResponse.json(+ { error: "Failed to generate usernames. Please try again." },+ { status: 500 }+ );+ }+}diff --git a/docs/src/components/RelatedTools.tsx b/docs/src/components/RelatedTools.tsxindex 2a1622274..1e36aafda 100644--- a/docs/src/components/RelatedTools.tsx+++ b/docs/src/components/RelatedTools.tsx@@ -519,6 +519,96 @@ const allTools: Tool[] = [href: "/tools/substack-post-generator",category: "social-media",},+ {+ name: "Instagram Username Generator",+ description: "Generate creative Instagram usernames with AI",+ href: "/tools/instagram-username-generator",+ category: "social-media",+ },+ {+ name: "TikTok Username Generator",+ description: "Generate catchy TikTok usernames with AI",+ href: "/tools/tiktok-username-generator",+ category: "social-media",+ },+ {+ name: "X (Twitter) Username Generator",+ description: "Generate memorable X (Twitter) usernames with AI",+ href: "/tools/x-username-generator",+ category: "social-media",+ },+ {+ name: "Twitch Username Generator",+ description: "Generate gaming-focused Twitch usernames with AI",+ href: "/tools/twitch-username-generator",+ category: "social-media",+ },+ {+ name: "YouTube Username Generator",+ description: "Generate memorable YouTube handles with AI",+ href: "/tools/youtube-username-generator",+ category: "social-media",+ },+ {+ name: "Reddit Username Generator",+ description: "Generate creative Reddit usernames with AI",+ href: "/tools/reddit-username-generator",+ category: "social-media",+ },+ {+ name: "Discord Username Generator",+ description: "Generate unique Discord usernames with AI",+ href: "/tools/discord-username-generator",+ category: "social-media",+ },+ {+ name: "GitHub Username Generator",+ description: "Generate professional GitHub usernames with AI",+ href: "/tools/github-username-generator",+ category: "social-media",+ },+ {+ name: "Pinterest Username Generator",+ description: "Generate creative Pinterest usernames with AI",+ href: "/tools/pinterest-username-generator",+ category: "social-media",+ },+ {+ name: "Snapchat Username Generator",+ description: "Generate fun Snapchat usernames with AI",+ href: "/tools/snapchat-username-generator",+ category: "social-media",+ },+ {+ name: "Spotify Username Generator",+ description: "Generate creative Spotify usernames with AI",+ href: "/tools/spotify-username-generator",+ category: "social-media",+ },+ {+ name: "Steam Username Generator",+ description: "Generate gaming-focused Steam usernames with AI",+ href: "/tools/steam-username-generator",+ category: "social-media",+ },+ {+ name: "LinkedIn Custom URL Generator",+ description: "Generate professional LinkedIn URLs with AI",+ href: "/tools/linkedin-username-generator",+ category: "social-media",+ },+ {+ name: "Medium Username Generator",+ description: "Generate professional Medium usernames with AI",+ href: "/tools/medium-username-generator",+ category: "social-media",+ },+ {+ name: "Substack URL Generator",+ description: "Generate professional Substack URLs with AI",+ href: "/tools/substack-username-generator",+ category: "social-media",+ },];interface RelatedToolsProps {