Root-level Astro pages and the top-level directory for all route files. This directory contains the five static content pages served at fixed URLs. Dynamic routes (provider profiles, state/city directories, specialty pages, guide pages, NPI redirects, and API endpoints) live in subdirectories and are documented separately.
| File | Purpose |
|---|---|
index.astro | Homepage. SSR: queries getSiteStats and getTopSpecialties at request time to display live provider counts and specialty tiles. Mounts DoctorSearchForm as a React island (client:load) for real-time FTS5 search. Injects WebSite + Organization JSON-LD. Uses ToolLayout. |
about.astro | Static about page explaining the site mission, Trust Score factors (hardcoded for copy clarity), and data sources. Uses ContentLayout with breadcrumbs. Generates BreadcrumbList JSON-LD. No D1 queries. |
privacy.astro | Static privacy policy page. Lists what data is and is not collected, retention periods, and user rights. Uses ContentLayout. Generates BreadcrumbList JSON-LD. No D1 queries. |
terms.astro | Static terms of service page. Covers acceptable use, disclaimer, Trust Score disclaimer, IP ownership, and liability limitation. Uses ContentLayout. Generates BreadcrumbList JSON-LD. No D1 queries. |
dispute.astro | Static correction request page. Instructs users to email [email protected] with NPI, URL, and error description. Clarifies which corrections require source updates at NPPES or state board. Uses ContentLayout. No form submission logic — email-based process only. |
| Directory | Routes served |
|---|---|
api/ | /api/search (FTS5 provider search), /api/verify (badge verification), /api/lead (lead form submission) |
doctor/ | /doctor/[slug] — 1.1M+ SSR provider profile pages |
npi/ | /npi/[npi] — 301 redirects to /doctor/{slug} |
state/ | /state/[state] (state overview) and /state/[state]/[city] (city directory) |
specialty/ | /specialty/[slug] and /specialty/index.astro |
guide/ | /guide/[slug] and /guide/index.astro |
badge/ | /badge/[npi] (dynamic SVG) and /badge/[npi]/embed |
src/layouts/ (ToolLayout, ContentLayout), src/lib/ (db, queries, seo, schema, format, constants), src/components/tool/ (DoctorSearchForm)index.astro is the primary entry point. All other root-level pages are self-contained static responses. The homepage is the only root-level page that performs D1 queries.
The subdirectory pages are the high-traffic surfaces: /doctor/[slug] handles ~1.1M routes, /state/ handles 51 + 3,000+ routes.
index.astro uses client:load for DoctorSearchForm, meaning it hydrates immediately on page load. If D1 is unavailable at render time, the stats section will throw — there is no fallback for getSiteStats.about.astro hardcodes the Trust Score factor weights (30, 25, 20, 15, 10) in HTML. If the algorithm changes, this page must be updated manually — it does not read from trust-score.ts or _meta/trust-score.md.dispute.astro has no actual form — it instructs users to email. A Cloudflare Worker form submission endpoint (/api/lead) exists in the api/ subdirectory but is not wired to dispute. The lead endpoint is for commercial lead capture, not corrections.about, privacy, terms, dispute) are rendered at build time because they contain no Astro.locals references. However, Astro’s hybrid rendering mode means they still go through the CF Pages adapter — they are not true static files unless export const prerender = true is explicitly declared. Currently they are not prerendered — they are SSR with no dynamic content, which is slightly wasteful but not incorrect.ARCHITECTURE.md — full page type inventory with counts_meta/seo-architecture.md — URL patterns and JSON-LD requirements per page typerecall("pages routes homepage", project_id="doctor-license-pro")