How imsyy/dailyhotapi works
DailyHotApi is a Hono service that aggregates trending lists from many sites and exposes them as JSON or RSS. The request path is app middleware and routing, dynamic source-specific handlers, then normalized responses; the registry applies limits and RSS formatting before returning results. Shared internals provide HTTP fetching, cache, time conversion, and authentication helpers. The README documents a broad catalog of feeds and deployment modes. Unsampled handlers are represented collectively; edges are limited to relationships shown in excerpts, the source index, or README.
Main entry points: app.tsx Hono app · routes Site handlers · getData.ts HTTP fetch/cache · registry.ts Route registry
Components 21
HTTP service
- Hono app
src/app.tsx - Route registry
src/registry.ts - Robots response
src/robots.txt.ts - Home view
src/views/Home.tsx - Error view
src/views/Error.tsx - Not-found view
src/views/NotFound.tsx - Shared layout
src/views/Layout.tsx
Trend sources
- Site handlers
src/routes - GitHub trending
src/routes/github.ts
Shared internals
- Runtime config
src/config.ts - HTTP fetch/cache
src/utils/getData.ts - Cache backends
src/utils/cache.ts - Bilibili WBI auth
src/utils/getToken/bilibili.ts - Token helpers
src/utils/getToken - Time conversion
src/utils/getTime.ts - Number parsing
src/utils/getNum.ts - Logger
src/utils/logger.ts
Response formats
- RSS builder
src/utils/getRSS.ts - RSS parser
src/utils/parseRSS.ts
Other components
- API client
- Source websites
Connections 24
- API client → Hono app: requests
src/app.tsx - Hono app → Route registry: mounts routes
src/app.tsx - Hono app → Robots response: serves robots
src/app.tsx - Hono app → Home view: renders home
src/app.tsx - Hono app → Not-found view: renders 404
src/app.tsx - Hono app → Error view: renders errors
src/app.tsx - Route registry → Site handlers: dispatches
src/registry.ts - Route registry → RSS builder: builds RSS
src/registry.ts - Site handlers → HTTP fetch/cache: fetches data
src/routes/bilibili.ts - HTTP fetch/cache → Source websites: requests
src/utils/getData.ts - HTTP fetch/cache → Cache backends: reads/writes
src/utils/getData.ts - GitHub trending → Cache backends: reads/writes
src/routes/github.ts - GitHub trending → Source websites: scrapes GitHub
src/routes/github.ts - Site handlers → Time conversion: converts times
src/routes/bilibili.ts - Site handlers → Number parsing: parses counts
src/routes/sina.ts - Site handlers → Token helpers: uses tokens
src/routes/bilibili.ts - Bilibili WBI auth → HTTP fetch/cache: gets WBI keys
src/utils/getToken/bilibili.ts - Bilibili WBI auth → Cache backends: caches keys
src/utils/getToken/bilibili.ts - Route registry → Runtime config: checks RSS mode
src/registry.ts - Hono app → Runtime config: reads settings
src/app.tsx - HTTP fetch/cache → Logger: logs requests
src/utils/getData.ts - Cache backends → Logger: logs cache
src/utils/cache.ts - Hono app → Logger: logs errors
src/app.tsx - RSS parser → Logger: logs parse errors
src/utils/parseRSS.ts