How viettools/checkdomain works
Project Type and Purpose
• This is a full-stack, containerized domain-checking web application (“Check Domain”).
• It exposes an HTTP endpoint (port 6996) with a small web frontend (static assets + Jinja2 templates) and a Python backend that retrieves WHOIS or RDAP data, parses it, applies reserved-domain filters, and returns results.
Top-Level File Structure & Architectural Clues
• Config_File/: External config generators (Nginx, domain checks)
• Dockerfile + docker-compose-*.yml: Containerization and IPv4/IPv6 networking
• main.py / checkdomain.py: Entry points to start the HTTP server or CLI tool
• parse_whois_socket.py & whois.py: Raw WHOIS socket communication
• webwhois/: RDAP lookups per TLD
• verified/: Registrar-specific WHOIS fallbacks
• static/ & templates/: Web UI assets (JS/CSS/fonts) and HTML templates
• data/ + reserved_domains/: Flat-file data stores and regex filters
• tests/: Unit tests for each ccTLD module
Key Components to Capture
a. Clients & Interfaces
• Web Browser (UI)
• Optional CLI consumer (checkdomain.py)
b. Web/Application Server
• HTTP Server (Flask or built-in Python HTTP + Jinja2 engine)
• Routes:
• “/” → index template + static assets
• “/api/check” → controller invoking lookup logic
c. Domain-Lookup Engine
• Controller module (main.py)
• WHOIS Socket Pipeline (parse_whois_socket.py → whois.py → verified/)
• RDAP HTTP Pipeline (webwhois/ per-TLD clients)
• Reserved-domain filter (reserved_domains/*.txt)
• Data file loaders (data/domains.query.csv + regex)
d. External Dependencies
• Port 43 WHOIS servers (TCP)
• RDAP servers (HTTPS)
• Docker network (IPv4 & IPv6 bridge)
e. Deployment & Configuration
• Docker container
• docker-compose network overlay
• Nginx configs (Config_File/Nginx) if fronting with a reverse proxy
• Browser → HTTP Server (HTTP GET/POST)
• HTTP Server → Template Engine & Static Assets
• HTTP Server → Lookup Engine (search request)
• Lookup Engine → WHOIS Socket & → RDAP Clients
• WHOIS/RDAP → External WHOIS/RDAP Servers
• Lookup Engine → Reserved-domain filter → Response assembly
• Response → HTTP Server → Browser
• Blue cluster: “Web Layer” (templates, static, main.py)
• Green cluster: “Lookup Services” (parse_whois_socket.py, whois.py, webwhois/, verified/)
• Yellow cluster: “Data Sources” (data/, reserved_domains/)
• Gray cluster: “Deployment” (Docker, docker-compose, Config_File)
Architectural Patterns
• Layered architecture: Presentation (web UI), Application (HTTP controllers), Domain-Lookup service, Infrastructure (socket/HTTP clients), Configuration/Deployment
• Single-process, event-driven or thread-based HTTP server
• Flat-file data store (no database)
• TLD-specific client plugins (webwhois/<tld>.py)