This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
PixivNow is a Pixiv mirror/proxy web application built with Nuxt 4 (Vue 3, TypeScript). It runs as a client-side only SPA (SSR disabled) with server-side API proxy routes. Templates use Pug syntax. Deployed on Vercel.
pnpm dev # Start dev server
pnpm build # Production build
pnpm generate # Static site generation
pnpm preview # Preview production buildNo test or lint commands are configured.
- Pages (
app/pages/): File-based routing — artworks, users, search, ranking, following, login, about - Stores (
app/stores/): Pinia stores for session, artwork, search, ranking, following, user profile/artworks, home - Components (
app/components/): Vue SFCs using Pug templates. Key groups: Artwork/, Comment/, SideNav/ - Composables (
app/composables/):states.ts(shared state),userData.ts(auth/session init) - API client (
app/api/pixiv-client.ts): Client-side Pixiv API wrapper - Utils (
app/utils/): Image URL handling (pximg.ts), animated artwork player (UgoiraPlayer.ts), ZIP downloads (ZipDownloader.ts) - i18n: Chinese only (
zh-Hans), lazy-loaded fromapp/locales/
Two server middleware handle proxying:
pixiv-proxy.ts: Proxies/ajax/*,/rpc/*,*.phprequests topixiv.net(with UA blacklist)pximg-proxy.ts: Proxies/-/*→i.pximg.net,/~/*→s.pximg.net(image CDN)
API routes:
GET /api/illust/random— random artworks from Pixiv discoveryGET /api/user— current logged-in user profile (parses Pixiv HTML for user data)
Session relies on PHPSESSID cookie forwarded to Pixiv. The /api/user endpoint extracts user data and CSRF token from Pixiv's HTML response.
- UI: naive-ui (component library), @tabler/icons-vue
- State: pinia, vue-router
- Media: gif.js, modern-mp4, fflate (for animated artwork export)
- Prettier: no semicolons, single quotes, 2-space indent, trailing commas (es5)
- Vue templates use Pug syntax (
lang="pug") - Auto-imports enabled for Vue/Nuxt composables, naive-ui components, and Pinia stores
NUXT_PUBLIC_PXIMG_BASEURL_I— i.pximg.net proxy base (default:/-/)NUXT_PUBLIC_PXIMG_BASEURL_S— s.pximg.net proxy base (default:/~/)NUXT_PUBLIC_GOOGLE_ANALYTICS_ID— GA tracking IDNUXT_UA_BLACKLIST— JSON array of blocked user-agent patterns
Reverse-engineered Pixiv API documentation is in DEV_NOTES/PIXIV_WEB_API.md.