Skip to content

seldo/domain-name-generator

Repository files navigation

Domain Name Generator

A modern Next.js application that generates short, easy-to-spell domain names and checks their availability using the Namecheap API.

Features

  • Smart Word Generation: Uses the EnglishLikeWordGenerator class to create pronounceable, English-like words
  • Real-time Availability Checking: Integrates with Namecheap API to check domain availability
  • Multiple TLD Support: Generate domains with various top-level domains (.com, .net, .org, .io, etc.)
  • Customizable Parameters: Control word length, count, and filtering options
  • Modern UI: Beautiful, responsive interface built with Tailwind CSS
  • Loading States: Real-time feedback during domain availability checking

Setup

1. Install Dependencies

npm install

2. Configure Namecheap API (Required)

Create a .env.local file with your Namecheap API credentials:

NAMECHEAP_API_USER=your_api_username
NAMECHEAP_API_KEY=your_api_key
NAMECHEAP_CLIENT_IP=your_client_ip

Note: You need to whitelist your server's IP address in your Namecheap account for the API to work. The application will not function without these credentials.

3. Run the Development Server

npm run dev

Open http://localhost:3000 in your browser.

Usage

  1. Configure Generation Settings:

    • Set minimum and maximum word length
    • Choose how many domains to generate
    • Select your preferred TLD (top-level domain)
  2. Generate Domains: Click the "Generate Domain Names" button

  3. Check Availability: The app will automatically check each domain's availability

  4. Filter Results: Use the "Show only available domains" checkbox to filter results

API Integration

The application includes a complete Namecheap API integration:

  • Required Credentials: The application requires valid Namecheap API credentials to function
  • XML Parsing: Properly parses Namecheap's XML responses
  • Error Handling: Robust error handling for API failures with user-friendly error messages

Technology Stack

  • Next.js 14: React framework with App Router
  • TypeScript: Type-safe development
  • Tailwind CSS: Utility-first CSS framework
  • Namecheap API: Domain availability checking
  • xml2js: XML response parsing

Development

Project Structure

src/
├── app/
│   ├── api/
│   │   └── check-availability/
│   │       └── route.ts          # API endpoint for domain checking
│   ├── page.tsx                  # Main application page
│   └── layout.tsx                # App layout
├── lib/
│   └── generatewords.js          # EnglishLikeWordGenerator class
└── ...

Key Components

  • EnglishLikeWordGenerator: Core word generation algorithm
  • Domain Availability API: Handles Namecheap API integration
  • Responsive UI: Modern interface with real-time updates

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

License

MIT License - see LICENSE file for details.

About

A little web app that uses random word generation and the Namecheap API to find your next domain

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors