[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-81321":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":8,"htmlUrl":8,"language":9,"languages":8,"totalLinesOfCode":8,"stars":10,"forks":11,"watchers":12,"openIssues":13,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":15,"stars7d":16,"stars30d":16,"stars90d":14,"forks30d":14,"starsTrendScore":17,"compositeScore":18,"rankGlobal":8,"rankLanguage":8,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":20,"hasPages":20,"topics":22,"createdAt":8,"pushedAt":8,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":14,"starSnapshotCount":14,"syncStatus":12,"lastSyncTime":26,"discoverSource":27},81321,"codex-pet-share","portons\u002Fcodex-pet-share","portons",null,"TypeScript",56,6,2,7,0,3,12,9,52.74,"MIT License",false,"master",[],"2026-06-12 04:01:32","# Codex Pet Share\n\nA self-hostable web app for sharing animated pixel pets. Upload a spritesheet, browse a community gallery, drop into multiplayer playground rooms, and pull pets straight into your terminal via a one-line CLI command.\n\nOpen-source so you can run your own instance for any pet\u002Fspritesheet community you like, or fork it as a starting point for any \"share an asset, embed it elsewhere\" app. Provider contracts are explicit so new backends can be added without changing feature code.\n\n## What you'll need to run your own\n\n- **Node 20+** and `npm`.\n- A backend that implements the app API and realtime room contract.\n- A static host for `dist\u002F`.\n- For the checked-in adapter: a Cloudflare account with Workers, D1, R2, and Durable Objects. For another provider, implement the contracts in `docs\u002FPROVIDER_ADAPTERS.md`.\n\nThere is no shared demo URL. Every fork brings up its own backend and storage.\n\n## Stack at a glance\n\n| Layer | Contract | Shipped adapter |\n|---|---|---|\n| Frontend | React 19 + Vite 7 + TypeScript | Static SPA. |\n| Backend API | HTTP `\u002Fapi\u002F*` contract | Cloudflare Worker in `adapters\u002Fcloudflare-worker\u002Fsrc\u002F*`. |\n| Persistence | Pets, profiles, likes, collections, rooms | Cloudflare D1 migrations in `adapters\u002Fcloudflare-worker\u002Fmigrations\u002F*`. |\n| Storage | Pet packages and rendered share PNGs | Cloudflare R2. |\n| Realtime | Presence + broadcast room channel | Cloudflare Durable Objects. |\n| Hosting | Static host plus optional share-page route functions | Worker Assets in the Cloudflare Worker adapter. |\n\nNo global state library, no design system framework — just plain CSS variables and React function components.\n\n## Quick start (local dev)\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fyour-org\u002Fyour-pet-share.git\ncd your-pet-share\nnpm install\ncp .env.example .env.local\n# Fill in .env.local — see docs\u002FGETTING_STARTED.md for what each var is.\nnpm run dev\n```\n\nVite serves at `http:\u002F\u002F127.0.0.1:5173`. The dev server hits the API and realtime provider from `.env.local`, so for the gallery to show pets you need either a seeded backend or a working remote project.\n\nThe build (`npm run build`) fails fast if any required env var is missing or malformed — fresh forks get a clear error pointing at exactly what to set.\n\n## Deploy to production\n\nStart with **[docs\u002FGETTING_STARTED.md](docs\u002FGETTING_STARTED.md)**. If you are handing the repo to an AI coding agent, also point it at **[.agents\u002Fskills\u002Fpetshare-setup\u002FSKILL.md](.agents\u002Fskills\u002Fpetshare-setup\u002FSKILL.md)**:\n\n1. Fill the provider-neutral public env vars.\n2. Bring up a backend adapter.\n3. Register and sign in.\n4. Seed a pet.\n5. Run the smoke checklist.\n\nProvider boundaries live in **[docs\u002FPROVIDER_ADAPTERS.md](docs\u002FPROVIDER_ADAPTERS.md)**.\n\nThe checked-in Cloudflare adapter walkthrough lives in **[adapters\u002Fcloudflare-worker\u002FREADME.md](adapters\u002Fcloudflare-worker\u002FREADME.md)**:\n\n1. Create D1\u002FR2 resources and set Worker secrets.\n2. Build the frontend with the required `VITE_*` env vars.\n3. Apply D1 migrations.\n4. Deploy the Worker and wire up your custom domain\u002FCORS.\n\n## Rebrand for your fork\n\nBrand strings are parametrized via four build-time env vars — no source code edits needed for a fresh rebrand:\n\n```bash\nVITE_APP_NAME=\"My Pet Share\"\nVITE_APP_HANDLE=\"my-pet-share\"\nVITE_APP_TAGLINE=\"A shareable home for your pixel pets.\"\nVITE_APP_REPO_URL=\"https:\u002F\u002Fgithub.com\u002Fyour-org\u002Fmy-pet-share\"\n```\n\nThese flow into the `\u003Ctitle>`, OG metadata, nav wordmark, share-image canvas text, share-text templates, and the `npx my-pet-share add \u003Cid>` CLI hint shown next to every pet.\n\nReplace `public\u002Ffavicon.ico` and `public\u002Fassets\u002Fpetshare-*.png` with your own art. Full rebrand checklist in **[docs\u002FREBRANDING.md](docs\u002FREBRANDING.md)**.\n\n## Operator scripts\n\nRun from a trusted environment (local dev or CI).\n\n| Script | Purpose |\n|---|---|\n| `npm run build:social-card` | Rebuild `public\u002Fassets\u002Fpetshare-social-preview.png` (the OG image). |\n| `npm run build:nav-mark` | Rebuild the nav wordmark PNG. |\n\n## Pet package format\n\nUpload a folder containing exactly:\n\n- `pet.json` — manifest (name, description, kind, animation states).\n- `spritesheet.webp` — `1536 x 1872`, 9 animation rows × 8 frame columns.\n\nThe backend adapter validator rejects mismatched dimensions, manifest schema errors, and unknown `kind`s.\n\n## Secret boundary\n\nNever commit, screenshot, or expose to a `VITE_*` env var:\n\n- `PET_STATS_SALT` (any 32+ random chars; used to hash visitor IPs for view-count dedup)\n- `AUTH_SECRET`\n- `RESEND_API_KEY`\n- `AUTH_GOOGLE_CLIENT_SECRET`\n- `AUTH_X_CLIENT_SECRET`\n- backend database credentials\n- Cloudflare API tokens\n\nProvider public keys may be publishable by provider design, but they are still project-specific. The build-env validator (`scripts\u002Fcheck-public-build-env.mjs`) blocks any `VITE_*` whose name matches `(SERVICE_ROLE|SECRET|TOKEN|PASSWORD|PET_STATS_SALT|PRIVATE)\u002Fi`.\n\n## Privacy note\n\nView and download counters are deduped per day. For anonymous visitors, the shipped backend adapter hashes `PET_STATS_SALT` with the trusted edge IP header and user agent before storing the event key. Keep `PET_STATS_SALT` secret.\n\n## Security checklist for production\n\n- Keep storage service-role keys only in backend secrets and trusted operator environments.\n- Add host\u002Fprovider rate limiting on `\u002Fapi\u002Fauth\u002F*`, `\u002Fapi\u002Fadmin\u002F*`, `\u002Fapi\u002Fpets` (POST), and `\u002Fshare\u002F*` paths.\n- Browser localStorage holds the session JWT — known v1 tradeoff. Hardening to HttpOnly cookies is an open follow-up.\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) — short version: open an issue first for non-trivial changes, then open a PR against `master`.\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n\n## Acknowledgements\n\nBuilt for self-hosted pixel-pet communities and Codex-compatible pet packages. Forks should set their own brand via the `VITE_APP_*` env vars above.\n","Codex Pet Share 是一个可自托管的网页应用，用于分享动画像素宠物。用户可以上传精灵图、浏览社区画廊、进入多人游戏房间，并通过一行CLI命令将宠物直接拉入终端。项目采用TypeScript编写，前端基于React 19 + Vite 7构建，后端API由Cloudflare Worker实现，支持实时通信和持久化存储。其设计允许轻松更换后端服务提供者而无需改动功能代码，适用于任何想要搭建自己宠物\u002F精灵图社区或类似“分享资源并嵌入其他地方”应用的场景。","2026-06-11 04:04:36","CREATED_QUERY"]