Last verified: 2026-06-26
parsehub-api is an independent backend service for a WeChat mini-program media parsing product. It exposes stable API endpoints for login, quota, media parsing, ad rewards, orders, and payment callbacks.
This repository is separate from E:\github\btch-downloader. Do not add product backend code to the SDK repository.
- Runtime: Node.js 20+, TypeScript, Fastify.
- Data: MySQL via Prisma.
- Cache and control plane: Redis.
- First parse provider:
btch-downloader. - Provider access must go through
src/modules/providers. - Public API version prefix:
/api/v1. - Stable response shape:
requestId,status,code,message,data,error.
- API changes: read
docs/api-contract.md. - Parse/provider changes: read
docs/provider-strategy.md. - Auth, API keys, URL validation, payment, or secrets: read
docs/security.md. - Architecture decisions: read
docs/architecture.md. - Deployment work: read
docs/deployment.md. - AI handoff and skill rules: read
docs/ai/ai-workflow.mdanddocs/ai/skill-development.md. - Project skill: read
skills/parsehub-api/SKILL.md; then load only the relevant reference file.
- Do not write business code inside
E:\github\btch-downloader. - Do not bypass the Provider layer when calling parsing libraries or upstream APIs.
- Do not expose
mediafireoraiounless product owners explicitly re-enable them. - Do not hardcode secrets, production URLs, payment keys, or WeChat secrets.
- Do not log access tokens, refresh tokens, API keys, raw payment secrets, or full user identifiers.
- Do not return stack traces in API responses.
- Do not introduce breaking API changes under
/api/v1; add/api/v2for breaking changes. - Do not proxy or store media files in MVP; return metadata and download links only.
npm install
npm run dev
npm run build
npm test
npm run prisma:generate
npm run prisma:migrate
npm run docker:up
npm run docker:down- Copy
.env.exampleto.env. - Start MySQL and Redis with Docker Compose or point env vars to existing services.
- Run
npm install. - Run
npm run prisma:migrate. - Run
npm run dev.
/healthzreturns without database or Redis dependency./readyzchecks MySQL and Redis./api/v1/platformslists enabled and disabled platforms.- Authenticated
/api/v1/parsevalidates input, checks cache, consumes quota, calls Provider, records parse history, and returns the stable response shape. - Tests pass before handoff.