How janwilmake/openapisearch works
Project type and purpose
• This is an open‑source, serverless web application and API (“OpenAPI‑Search”) that aggregates and exposes multiple OpenAPI definitions via a searchable interface.
• It combines static front‑end pages (HTML/CSS/JS) with a Cloudflare Worker back end, plus static JSON “registry” assets in the repo (“providers.json”, “openapi.json”, the handmade/ folder).
File structure
• Top‑level static pages: homepage.html, search.html, openapi.html, provider.html
• Core serverless code: main.ts (entrypoint for Cloudflare Worker routes), logo.ts (utility for on‑the‑fly logos)
• Data assets: providers.json, openapi.json, handmade/*.json + schema files (provider.schema.json, providers.schema.json)
• Deployment config: wrangler.toml (Cloudflare Worker config), package.json/tsconfig
README
• Confirms a goal of combining multiple OpenAPI specs into a searchable directory
• Mentions moving to Cloudflare, programmatic registry, AI crawlers planned, schema‑based validation (via actionschema)
Main components & interactions
a. Front‑End (Browser)
• Static HTML pages + embedded JS for search UI, API calls, result rendering.
b. Cloudflare Worker (Back‑End)
• Acts as router: serves HTML/JS/CSS assets and JSON endpoints (/api/search, /api/providers/:id, /api/openapi/:id).
• Loads & validates JSON assets against schemas.
• Performs in‑memory or KV‑backed searches over the registry.
• May schedule updates via QStash/Upstash (future AI crawler integration).
c. Data Storage
• Script‑bundled JSON assets as “source of truth.”
• Optionally Cloudflare KV or Upstash Redis for caching or incremental updates.
d. External Services (future/optional)
• AI crawler service for metadata augmentation.
• Third‑party OpenAPI sources (APIs.guru, RapidAPI, etc.)
Architectural patterns & design principles
• Serverless “Function as a Service” with Cloudflare Workers
• Static‑first: keep registry data in code assets, load at startup
• JSON‑Schema validation layer to enforce standard compliance
• Separation of concerns:
• Static UI assets vs. dynamic API routes
• Data layer (JSON + optional KV) vs. business logic (search, validation)
Technologies & frameworks
• TypeScript / Deno‑like Worker runtime (via Wrangler)
• JSON Schema for data validation
• HTML5/CSS/Vanilla JS for front‑end
• (Planned) Upstash QStash & Redis for scheduling & caching
Detailed capture of essential elements
• That the handmade/ folder JSONs are loaded at build/deploy time as part of the Worker bundle
• Schema files driving validation before indexing