apps/api
The Node/Hono service at api.toolzerhub.com. It does three unrelated jobs behind one process:
- A metered public data API (
/v1,/v2) — public social, e-commerce, and ad-library data, scraped or proxied from third parties and normalized into a stable shape. - Toolzer Hub's own account dashboard backend (
/hub) — API keys, credits, usage, billing. - Vantage, a TikTok Shop rank-tracking product (
/app) — a separate multi-tenant application that happens to live in the same deployment.
Staff tooling (/admin) and internal observatory endpoints (/internal) round out the surface. The Apify Store GET views are public catalogue data; its POST controls require a staff session. See apps/api/src/routes/index.ts for the exact mounting.
There is no /docs route on this service. The public API reference is docs.toolzerhub.com, a separate Fumadocs site (apps/web/toolzerhub-docs) built from this service's /openapi.json.
Router surfaces
| Mount | Auth | Who calls it | Notes |
|---|---|---|---|
/v1 | x-api-key (apiKeyAuth) | External customers, published Apify Actors | Public data API — one router per platform (/v1/tiktok, /v1/walmart, /v1/ad-library, ...). Metered. |
/v2 | x-api-key (apiKeyAuth) | External customers | Newer, fully external (RapidAPI-sourced) surface. Currently just Instagram. Metered. |
/auth | none (issues sessions) | Toolzer Hub and Vantage browser clients | Signup/login/logout/invites, shared by both dashboards so neither authenticates through a route named after the other. |
/hub | session (sessionAuth + requireCapability("api")) | Toolzer Hub's own dashboard UI | API key management, credits, usage, billing. |
/app | session (sessionAuth, requireCapability("rankings") on most routes) | Vantage dashboard UI | TikTok Shop keyword tracking, scans, creator/ad intel. |
/admin | staff session (adminAuth, applied inside the router) | Internal staff console | Cross-tenant: every workspace, every user, manual credit grants, job health. |
/internal | mixed | Internal network only | Apify Store GET views are public catalogue data; sweep and developer-watch POST controls require adminAuth. |
Plus /health, /ready, /openapi.json, and /llm.txt (unauthenticated, outside all of the above). /health is process liveness; /ready gates traffic on Postgres, worker, and browser minter, and attests their built commit against the API while reporting optional ClickHouse degradation. See infrastructure.md for probe and rollout semantics.
In this folder
- architecture.md — module map, the app/worker split, and how a request travels through middleware to a response.
- auth-and-credits.md — API keys, sessions, the workspace/subscription/allowance model, and the credit reservation lifecycle.
- env.md — every environment variable this service reads, with defaults and which are conditionally required.
- observability.md — logging, metrics, tracing, and where the operational runbooks live.