This file gives actionable, repository-specific guidance for AI coding agents working on AnimationManager.
Overview
server/server.js is the HTTP server and router. It serves static files from client/ and admin/ and exposes REST endpoints under /api/*.client/ (end-user) and admin/ (management) are static HTML/JS pages (no build step) loaded by the server.server/ (modules, users/, avatar/, temp/) and server/python/ contains matting/AI scripts invoked by server modules.Quick start (dev on Windows)
server/ and run npm install (dependencies in server/package.json).server/ run npm start or run the workspace root start-server.bat.3000.Key files to read before coding
server/server.js — central router, API registration, static file handling, CORS and caching logic.server/package.json — start script and runtime deps (sharp, sqlite3, formidable, etc.).server/ai-queue.js, server/disk.js, server/store/store.js, server/user.js — implementation points for AI, storage, store/catalog, and user logic.client/index.html and admin/index.html — demonstrate iframe-based UI structure and pages under page/.Patterns & conventions (explicit)
server/server.js. Follow existing style: check pathname, branch, call handler modules, then return.decodeURIComponent) and maps /admin/ → admin/, other → client/, and /texture|/avatar|/users → server/.Cache-Control and ETag based on stat (follow that pattern for image endpoints)./api/frames/<encoded-folder>). Use encodeURIComponent per-segment when calling.storeManager.clearCategoriesCache() or storeManager.clearPricesCache() as appropriate (seen in server.js).res.writeHead usage.Integration & external dependencies
sharp, sqlite3, ws, formidable, archiver (see server/package.json).server/python/ and are invoked by server modules (ensure a Python venv with pip install -r server/python/requirements.txt when testing matting locally).server/users/<username>/ai-images and served via /api/ai/image?username=...&id=....Developer tips for common tasks
server/server.js near other /api/... handlers, require or delegate to server/*.js handler modules.pathname.startsWith('/api/'). For interactive debugging, run node --inspect server.js from server/ and attach VS Code.client/ or admin/ and reload browser; no build step.Examples (call sites)
POST /api/pack handled by server/zip.js.POST /api/ai/generate handled by server/ai-queue.js; preview/image endpoints are /api/ai/preview and /api/ai/image.server/disk.js handlers exposed under /api/disk/*.When to ask maintainers / open an issue
npm modules or Python libs), request permission because CI/deployment may require environment changes.If anything above is unclear or you want more examples (handler templates, common response shapes, or a suggested VS Code launch config), tell me which part to expand.