Describes Shop Inventory System hosting architecture (Vite/React client, Express/Prisma API) and guides migration or redesign when cold starts, Render free tier spin-down, or staff-facing latency block adoption. Use when discussing deployment, hosting, Render, cold start, always-on, moving the API, static hosting, or production architecture changes for this repo.
apps/*, packages/*.apps/client — Vite, React, React Router, TanStack Query, PWA (vite-plugin-pwa). Build output is static assets.apps/server — Express, Prisma, sessions, JWT, file uploads (multer). Long-lived Node process; not serverless by default.packages/* — types and shared code consumed by client and server.When proposing changes, read package.json files and server entry (apps/server/src) if you need to confirm scripts, env vars, or coupling (e.g. session cookies, CORS, upload paths).
On Render free (or similar) idle spin-down:
Separate symptoms from fixes:
| Symptom | Usually points to |
|---|---|
| First load after minutes idle is very slow | Idle spin-down / cold start |
| Every request is slow | DB region, N+1 queries, missing indexes, oversized payloads |
| Timeouts on first request only | Cold start + aggressive client timeout |
Always mention measuring (browser Network tab, server logs with request timing) before recommending a large refactor.
Keep architecture; remove idle
Keep Express + Prisma; change host
Split static UI from API (common for SPAs)
Refactor toward serverless / edge (largest effort)
Use this to compare options in conversation; verify current pricing and limits on vendor docs.
| Direction | Cold start impact | Typical migration effort |
|---|---|---|
| Upgrade to always-on on current host | Removes idle cold starts | Low (config + billing) |
| Same stack, new host with always-on | Same | Low–medium (Dockerfile, env, DB networking) |
| Static CDN + API on always-on | UI fast; API depends on API tier | Medium (CORS, cookie domain, asset URLs) |
| API on serverless (Lambda/Functions) | Cold starts may persist or shift | High (Prisma pooling, sessions, uploads) |
app. + api. splitWhen the user asks where to deploy or how to fix cold starts, respond with:
Do not prescribe a vendor as the only solution; tie suggestions to their constraints and this codebase’s Express + Prisma assumptions.
For extended hosting comparisons or runbooks, add or link a project-specific reference.md in this skill folder — keep SKILL.md under ~500 lines.