[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-minimax-fullstack-dev":3,"mdc-ur6ayp-key":40,"related-repo-minimax-fullstack-dev":16794,"related-org-minimax-fullstack-dev":16910},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":12,"stars":29,"repoUrl":30,"updatedAt":31,"license":32,"forks":33,"topics":34,"repo":35,"sourceUrl":38,"mdContent":39},"fullstack-dev","build full-stack web applications","Full-stack backend architecture and frontend-backend integration guide.\nTRIGGER when: building a full-stack app, creating REST API with frontend, scaffolding backend service,\nbuilding todo app, building CRUD app, building real-time app, building chat app,\nExpress + React, Next.js API, Node.js backend, Python backend, Go backend,\ndesigning service layers, implementing error handling, managing config\u002Fauth,\nsetting up API clients, implementing auth flows, handling file uploads,\nadding real-time features (SSE\u002FWebSocket), hardening for production.\nDO NOT TRIGGER when: pure frontend UI work, pure CSS\u002Fstyling, database schema only.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},"minimax","MiniMax","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fminimax.jpg","MiniMax-AI",[13,17,20,23,26],{"name":14,"slug":15,"type":16},"Backend","backend","tag",{"name":18,"slug":19,"type":16},"Full-stack","full-stack",{"name":21,"slug":22,"type":16},"REST API","rest-api",{"name":24,"slug":25,"type":16},"Web Development","web-development",{"name":27,"slug":28,"type":16},"Frontend","frontend",13030,"https:\u002F\u002Fgithub.com\u002FMiniMax-AI\u002Fskills","2026-07-13T06:16:43.219005","MIT",1118,[],{"repoUrl":30,"stars":29,"forks":33,"topics":36,"description":37},[],null,"https:\u002F\u002Fgithub.com\u002FMiniMax-AI\u002Fskills\u002Ftree\u002FHEAD\u002Fskills\u002Ffullstack-dev","---\nname: fullstack-dev\ndescription: |\n  Full-stack backend architecture and frontend-backend integration guide.\n  TRIGGER when: building a full-stack app, creating REST API with frontend, scaffolding backend service,\n  building todo app, building CRUD app, building real-time app, building chat app,\n  Express + React, Next.js API, Node.js backend, Python backend, Go backend,\n  designing service layers, implementing error handling, managing config\u002Fauth,\n  setting up API clients, implementing auth flows, handling file uploads,\n  adding real-time features (SSE\u002FWebSocket), hardening for production.\n  DO NOT TRIGGER when: pure frontend UI work, pure CSS\u002Fstyling, database schema only.\nlicense: MIT\nmetadata:\n  category: full-stack\n  version: \"1.0.0\"\n  sources:\n    - The Twelve-Factor App (12factor.net)\n    - Clean Architecture (Robert C. Martin)\n    - Domain-Driven Design (Eric Evans)\n    - Patterns of Enterprise Application Architecture (Martin Fowler)\n    - Martin Fowler (Testing Pyramid, Contract Tests)\n    - Google SRE Handbook (Release Engineering)\n    - ThoughtWorks Technology Radar\n---\n\n# Full-Stack Development Practices\n\n## MANDATORY WORKFLOW — Follow These Steps In Order\n\n**When this skill is triggered, you MUST follow this workflow before writing any code.**\n\n### Step 0: Gather Requirements\n\nBefore scaffolding anything, ask the user to clarify (or infer from context):\n\n1. **Stack**: Language\u002Fframework for backend and frontend (e.g., Express + React, Django + Vue, Go + HTMX)\n2. **Service type**: API-only, full-stack monolith, or microservice?\n3. **Database**: SQL (PostgreSQL, SQLite, MySQL) or NoSQL (MongoDB, Redis)?\n4. **Integration**: REST, GraphQL, tRPC, or gRPC?\n5. **Real-time**: Needed? If yes — SSE, WebSocket, or polling?\n6. **Auth**: Needed? If yes — JWT, session, OAuth, or third-party (Clerk, Auth.js)?\n\nIf the user has already specified these in their request, skip asking and proceed.\n\n### Step 1: Architectural Decisions\n\nBased on requirements, make and state these decisions before coding:\n\n| Decision | Options | Reference |\n|----------|---------|-----------|\n| Project structure | Feature-first (recommended) vs layer-first | [Section 1](#1-project-structure--layering-critical) |\n| API client approach | Typed fetch \u002F React Query \u002F tRPC \u002F OpenAPI codegen | [Section 5](#5-api-client-patterns-medium) |\n| Auth strategy | JWT + refresh \u002F session \u002F third-party | [Section 6](#6-authentication--middleware-high) |\n| Real-time method | Polling \u002F SSE \u002F WebSocket | [Section 11](#11-real-time-patterns-medium) |\n| Error handling | Typed error hierarchy + global handler | [Section 3](#3-error-handling--resilience-high) |\n\nBriefly explain each choice (1 sentence per decision).\n\n### Step 2: Scaffold with Checklist\n\nUse the appropriate checklist below. Ensure ALL checked items are implemented — do not skip any.\n\n### Step 3: Implement Following Patterns\n\nWrite code following the patterns in this document. Reference specific sections as you implement each part.\n\n### Step 4: Test & Verify\n\nAfter implementation, run these checks before claiming completion:\n\n1. **Build check**: Ensure both backend and frontend compile without errors\n   ```bash\n   # Backend\n   cd server && npm run build\n   # Frontend\n   cd client && npm run build\n   ```\n2. **Start & smoke test**: Start the server, verify key endpoints return expected responses\n   ```bash\n   # Start server, then test\n   curl http:\u002F\u002Flocalhost:3000\u002Fhealth\n   curl http:\u002F\u002Flocalhost:3000\u002Fapi\u002F\u003Cresource>\n   ```\n3. **Integration check**: Verify frontend can connect to backend (CORS, API base URL, auth flow)\n4. **Real-time check** (if applicable): Open two browser tabs, verify changes sync\n\nIf any check fails, fix the issue before proceeding.\n\n### Step 5: Handoff Summary\n\nProvide a brief summary to the user:\n\n- **What was built**: List of implemented features and endpoints\n- **How to run**: Exact commands to start backend and frontend\n- **What's missing \u002F next steps**: Any deferred items, known limitations, or recommended improvements\n- **Key files**: List the most important files the user should know about\n\n---\n\n## Scope\n\n**USE this skill when:**\n- Building a full-stack application (backend + frontend)\n- Scaffolding a new backend service or API\n- Designing service layers and module boundaries\n- Implementing database access, caching, or background jobs\n- Writing error handling, logging, or configuration management\n- Reviewing backend code for architectural issues\n- Hardening for production\n- Setting up API clients, auth flows, file uploads, or real-time features\n\n**NOT for:**\n- Pure frontend\u002FUI concerns (use your frontend framework's docs)\n- Pure database schema design without backend context\n\n---\n\n## Quick Start — New Backend Service Checklist\n\n- [ ] Project scaffolded with **feature-first** structure\n- [ ] Configuration **centralized**, env vars **validated at startup** (fail fast)\n- [ ] **Typed error hierarchy** defined (not generic `Error`)\n- [ ] **Global error handler** middleware\n- [ ] **Structured JSON logging** with request ID propagation\n- [ ] Database: **migrations** set up, **connection pooling** configured\n- [ ] **Input validation** on all endpoints (Zod \u002F Pydantic \u002F Go validator)\n- [ ] **Authentication middleware** in place\n- [ ] **Health check** endpoints (`\u002Fhealth`, `\u002Fready`)\n- [ ] **Graceful shutdown** handling (SIGTERM)\n- [ ] **CORS** configured (explicit origins, not `*`)\n- [ ] **Security headers** (helmet or equivalent)\n- [ ] `.env.example` committed (no real secrets)\n\n## Quick Start — Frontend-Backend Integration Checklist\n\n- [ ] **API client** configured (typed fetch wrapper, React Query, tRPC, or OpenAPI generated)\n- [ ] **Base URL** from environment variable (not hardcoded)\n- [ ] **Auth token** attached to requests automatically (interceptor \u002F middleware)\n- [ ] **Error handling** — API errors mapped to user-facing messages\n- [ ] **Loading states** handled (skeleton\u002Fspinner, not blank screen)\n- [ ] **Type safety** across the boundary (shared types, OpenAPI, or tRPC)\n- [ ] **CORS** configured with explicit origins (not `*` in production)\n- [ ] **Refresh token** flow implemented (httpOnly cookie + transparent retry on 401)\n\n---\n\n## Quick Navigation\n\n| Need to… | Jump to |\n|----------|---------|\n| Organize project folders | [1. Project Structure](#1-project-structure--layering-critical) |\n| Manage config + secrets | [2. Configuration](#2-configuration--environment-critical) |\n| Handle errors properly | [3. Error Handling](#3-error-handling--resilience-high) |\n| Write database code | [4. Database Access Patterns](#4-database-access-patterns-high) |\n| Set up API client from frontend | [5. API Client Patterns](#5-api-client-patterns-medium) |\n| Add auth middleware | [6. Auth & Middleware](#6-authentication--middleware-high) |\n| Set up logging | [7. Logging & Observability](#7-logging--observability-medium-high) |\n| Add background jobs | [8. Background Jobs](#8-background-jobs--async-medium) |\n| Implement caching | [9. Caching](#9-caching-patterns-medium) |\n| Upload files (presigned URL, multipart) | [10. File Upload Patterns](#10-file-upload-patterns-medium) |\n| Add real-time features (SSE, WebSocket) | [11. Real-Time Patterns](#11-real-time-patterns-medium) |\n| Handle API errors in frontend UI | [12. Cross-Boundary Error Handling](#12-cross-boundary-error-handling-medium) |\n| Harden for production | [13. Production Hardening](#13-production-hardening-medium) |\n| Design API endpoints | [API Design](references\u002Fapi-design.md) |\n| Design database schema | [Database Schema](references\u002Fdb-schema.md) |\n| Auth flow (JWT, refresh, Next.js SSR, RBAC) | [references\u002Fauth-flow.md](references\u002Fauth-flow.md) |\n| CORS, env vars, environment management | [references\u002Fenvironment-management.md](references\u002Fenvironment-management.md) |\n\n---\n\n## Core Principles (7 Iron Rules)\n\n```\n1. ✅ Organize by FEATURE, not by technical layer\n2. ✅ Controllers never contain business logic\n3. ✅ Services never import HTTP request\u002Fresponse types\n4. ✅ All config from env vars, validated at startup, fail fast\n5. ✅ Every error is typed, logged, and returns consistent format\n6. ✅ All input validated at the boundary — trust nothing from client\n7. ✅ Structured JSON logging with request ID — not console.log\n```\n\n---\n\n## 1. Project Structure & Layering (CRITICAL)\n\n### Feature-First Organization\n\n```\n✅ Feature-first                    ❌ Layer-first\nsrc\u002F                                src\u002F\n  orders\u002F                             controllers\u002F\n    order.controller.ts                 order.controller.ts\n    order.service.ts                    user.controller.ts\n    order.repository.ts               services\u002F\n    order.dto.ts                        order.service.ts\n    order.test.ts                       user.service.ts\n  users\u002F                              repositories\u002F\n    user.controller.ts                  ...\n    user.service.ts\n  shared\u002F\n    database\u002F\n    middleware\u002F\n```\n\n### Three-Layer Architecture\n\n```\nController (HTTP) → Service (Business Logic) → Repository (Data Access)\n```\n\n| Layer | Responsibility | ❌ Never |\n|-------|---------------|---------|\n| Controller | Parse request, validate, call service, format response | Business logic, DB queries |\n| Service | Business rules, orchestration, transaction mgmt | HTTP types (req\u002Fres), direct DB |\n| Repository | Database queries, external API calls | Business logic, HTTP types |\n\n### Dependency Injection (All Languages)\n\n**TypeScript:**\n```typescript\nclass OrderService {\n  constructor(\n    private readonly orderRepo: OrderRepository,    \u002F\u002F ✅ injected interface\n    private readonly emailService: EmailService,\n  ) {}\n}\n```\n\n**Python:**\n```python\nclass OrderService:\n    def __init__(self, order_repo: OrderRepository, email_service: EmailService):\n        self.order_repo = order_repo                 # ✅ injected\n        self.email_service = email_service\n```\n\n**Go:**\n```go\ntype OrderService struct {\n    orderRepo    OrderRepository                      \u002F\u002F ✅ interface\n    emailService EmailService\n}\n\nfunc NewOrderService(repo OrderRepository, email EmailService) *OrderService {\n    return &OrderService{orderRepo: repo, emailService: email}\n}\n```\n\n---\n\n## 2. Configuration & Environment (CRITICAL)\n\n### Centralized, Typed, Fail-Fast\n\n**TypeScript:**\n```typescript\nconst config = {\n  port: parseInt(process.env.PORT || '3000', 10),\n  database: { url: requiredEnv('DATABASE_URL'), poolSize: intEnv('DB_POOL_SIZE', 10) },\n  auth: { jwtSecret: requiredEnv('JWT_SECRET'), expiresIn: process.env.JWT_EXPIRES_IN || '1h' },\n} as const;\n\nfunction requiredEnv(name: string): string {\n  const value = process.env[name];\n  if (!value) throw new Error(`Missing required env var: ${name}`);  \u002F\u002F fail fast\n  return value;\n}\n```\n\n**Python:**\n```python\nfrom pydantic_settings import BaseSettings\n\nclass Settings(BaseSettings):\n    database_url: str                        # required — app won't start without it\n    jwt_secret: str                          # required\n    port: int = 3000                         # optional with default\n    db_pool_size: int = 10\n    class Config:\n        env_file = \".env\"\n\nsettings = Settings()                        # fails fast if DATABASE_URL missing\n```\n\n### Rules\n\n```\n✅ All config via environment variables (Twelve-Factor)\n✅ Validate required vars at startup — fail fast\n✅ Type-cast at config layer, not at usage sites\n✅ Commit .env.example with dummy values\n\n❌ Never hardcode secrets, URLs, or credentials\n❌ Never commit .env files\n❌ Never scatter process.env \u002F os.environ throughout code\n```\n\n---\n\n## 3. Error Handling & Resilience (HIGH)\n\n### Typed Error Hierarchy\n\n```typescript\n\u002F\u002F Base (TypeScript)\nclass AppError extends Error {\n  constructor(\n    message: string,\n    public readonly code: string,\n    public readonly statusCode: number,\n    public readonly isOperational: boolean = true,\n  ) { super(message); }\n}\nclass NotFoundError extends AppError {\n  constructor(resource: string, id: string) {\n    super(`${resource} not found: ${id}`, 'NOT_FOUND', 404);\n  }\n}\nclass ValidationError extends AppError {\n  constructor(public readonly errors: FieldError[]) {\n    super('Validation failed', 'VALIDATION_ERROR', 422);\n  }\n}\n```\n\n```python\n# Base (Python)\nclass AppError(Exception):\n    def __init__(self, message: str, code: str, status_code: int):\n        self.message, self.code, self.status_code = message, code, status_code\n\nclass NotFoundError(AppError):\n    def __init__(self, resource: str, id: str):\n        super().__init__(f\"{resource} not found: {id}\", \"NOT_FOUND\", 404)\n```\n\n### Global Error Handler\n\n```typescript\n\u002F\u002F TypeScript (Express)\napp.use((err, req, res, next) => {\n  if (err instanceof AppError && err.isOperational) {\n    return res.status(err.statusCode).json({\n      title: err.code, status: err.statusCode,\n      detail: err.message, request_id: req.id,\n    });\n  }\n  logger.error('Unexpected error', { error: err.message, stack: err.stack, request_id: req.id });\n  res.status(500).json({ title: 'Internal Error', status: 500, request_id: req.id });\n});\n```\n\n### Rules\n\n```\n✅ Typed, domain-specific error classes\n✅ Global error handler catches everything\n✅ Operational errors → structured response\n✅ Programming errors → log + generic 500\n✅ Retry transient failures with exponential backoff\n\n❌ Never catch and ignore errors silently\n❌ Never return stack traces to client\n❌ Never throw generic Error('something')\n```\n\n---\n\n## 4. Database Access Patterns (HIGH)\n\n### Migrations Always\n\n```bash\n# TypeScript (Prisma)           # Python (Alembic)              # Go (golang-migrate)\nnpx prisma migrate dev          alembic revision --autogenerate  migrate -source file:\u002F\u002Fmigrations\nnpx prisma migrate deploy       alembic upgrade head             migrate -database $DB up\n```\n\n```\n✅ Schema changes via migrations, never manual SQL\n✅ Migrations must be reversible\n✅ Review migration SQL before production\n❌ Never modify production schema manually\n```\n\n### N+1 Prevention\n\n```typescript\n\u002F\u002F ❌ N+1: 1 query + N queries\nconst orders = await db.order.findMany();\nfor (const o of orders) { o.items = await db.item.findMany({ where: { orderId: o.id } }); }\n\n\u002F\u002F ✅ Single JOIN query\nconst orders = await db.order.findMany({ include: { items: true } });\n```\n\n### Transactions for Multi-Step Writes\n\n```typescript\nawait db.$transaction(async (tx) => {\n  const order = await tx.order.create({ data: orderData });\n  await tx.inventory.decrement({ productId, quantity });\n  await tx.payment.create({ orderId: order.id, amount });\n});\n```\n\n### Connection Pooling\n\nPool size = `(CPU cores × 2) + spindle_count` (start with 10-20). Always set connection timeout. Use PgBouncer for serverless.\n\n---\n\n## 5. API Client Patterns (MEDIUM)\n\nThe \"glue layer\" between frontend and backend. Choose the approach that fits your team and stack.\n\n### Option A: Typed Fetch Wrapper (Simple, No Dependencies)\n\n```typescript\n\u002F\u002F lib\u002Fapi-client.ts\nconst BASE_URL = process.env.NEXT_PUBLIC_API_URL || 'http:\u002F\u002Flocalhost:3001';\n\nclass ApiError extends Error {\n  constructor(public status: number, public body: any) {\n    super(body?.detail || body?.message || `API error ${status}`);\n  }\n}\n\nasync function api\u003CT>(path: string, options: RequestInit = {}): Promise\u003CT> {\n  const token = getAuthToken();  \u002F\u002F from cookie \u002F memory \u002F context\n\n  const res = await fetch(`${BASE_URL}${path}`, {\n    ...options,\n    headers: {\n      'Content-Type': 'application\u002Fjson',\n      ...(token ? { Authorization: `Bearer ${token}` } : {}),\n      ...options.headers,\n    },\n  });\n\n  if (!res.ok) {\n    const body = await res.json().catch(() => null);\n    throw new ApiError(res.status, body);\n  }\n\n  if (res.status === 204) return undefined as T;\n  return res.json();\n}\n\nexport const apiClient = {\n  get: \u003CT>(path: string) => api\u003CT>(path),\n  post: \u003CT>(path: string, data: unknown) => api\u003CT>(path, { method: 'POST', body: JSON.stringify(data) }),\n  put: \u003CT>(path: string, data: unknown) => api\u003CT>(path, { method: 'PUT', body: JSON.stringify(data) }),\n  patch: \u003CT>(path: string, data: unknown) => api\u003CT>(path, { method: 'PATCH', body: JSON.stringify(data) }),\n  delete: \u003CT>(path: string) => api\u003CT>(path, { method: 'DELETE' }),\n};\n```\n\n### Option B: React Query + Typed Client (Recommended for React)\n\n```typescript\n\u002F\u002F hooks\u002Fuse-orders.ts\nimport { useQuery, useMutation, useQueryClient } from '@tanstack\u002Freact-query';\nimport { apiClient } from '@\u002Flib\u002Fapi-client';\n\ninterface Order { id: string; total: number; status: string; }\ninterface CreateOrderInput { items: { productId: string; quantity: number }[] }\n\nexport function useOrders() {\n  return useQuery({\n    queryKey: ['orders'],\n    queryFn: () => apiClient.get\u003C{ data: Order[] }>('\u002Fapi\u002Forders'),\n    staleTime: 1000 * 60,  \u002F\u002F 1 min\n  });\n}\n\nexport function useCreateOrder() {\n  const queryClient = useQueryClient();\n  return useMutation({\n    mutationFn: (data: CreateOrderInput) =>\n      apiClient.post\u003C{ data: Order }>('\u002Fapi\u002Forders', data),\n    onSuccess: () => {\n      queryClient.invalidateQueries({ queryKey: ['orders'] });\n    },\n  });\n}\n\n\u002F\u002F Usage in component:\nfunction OrdersPage() {\n  const { data, isLoading, error } = useOrders();\n  const createOrder = useCreateOrder();\n  if (isLoading) return \u003CSkeleton \u002F>;\n  if (error) return \u003CErrorBanner error={error} \u002F>;\n  \u002F\u002F ...\n}\n```\n\n### Option C: tRPC (Same Team Owns Both Sides)\n\n```typescript\n\u002F\u002F server: trpc\u002Frouter.ts\nexport const appRouter = router({\n  orders: router({\n    list: publicProcedure.query(async () => {\n      return db.order.findMany({ include: { items: true } });\n    }),\n    create: protectedProcedure\n      .input(z.object({ items: z.array(orderItemSchema) }))\n      .mutation(async ({ input, ctx }) => {\n        return orderService.create(ctx.user.id, input);\n      }),\n  }),\n});\nexport type AppRouter = typeof appRouter;\n\n\u002F\u002F client: automatic type safety, no code generation\nconst { data } = trpc.orders.list.useQuery();\nconst createOrder = trpc.orders.create.useMutation();\n```\n\n### Option D: OpenAPI Generated Client (Public \u002F Multi-Consumer APIs)\n\n```bash\nnpx openapi-typescript-codegen \\\n  --input http:\u002F\u002Flocalhost:3001\u002Fapi\u002Fopenapi.json \\\n  --output src\u002Fgenerated\u002Fapi \\\n  --client axios\n```\n\n### Decision: Which API Client?\n\n| Approach | When | Type Safety | Effort |\n|----------|------|-------------|--------|\n| Typed fetch wrapper | Simple apps, small teams | Manual types | Low |\n| React Query + fetch | React apps, server state | Manual types | Medium |\n| tRPC | Same team, TypeScript both sides | Automatic | Low |\n| OpenAPI generated | Public API, multi-consumer | Automatic | Medium |\n| GraphQL codegen | GraphQL APIs | Automatic | Medium |\n\n---\n\n## 6. Authentication & Middleware (HIGH)\n\n> **Full reference:** [references\u002Fauth-flow.md](references\u002Fauth-flow.md) — JWT bearer flow, automatic token refresh, Next.js server-side auth, RBAC pattern, backend middleware order.\n\n### Standard Middleware Order\n\n```\nRequest → 1.RequestID → 2.Logging → 3.CORS → 4.RateLimit → 5.BodyParse\n       → 6.Auth → 7.Authz → 8.Validation → 9.Handler → 10.ErrorHandler → Response\n```\n\n### JWT Rules\n\n```\n✅ Short expiry access token (15min) + refresh token (server-stored)\n✅ Minimal claims: userId, roles (not entire user object)\n✅ Rotate signing keys periodically\n\n❌ Never store tokens in localStorage (XSS risk)\n❌ Never pass tokens in URL query params\n```\n\n### RBAC Pattern\n\n```typescript\nfunction authorize(...roles: Role[]) {\n  return (req, res, next) => {\n    if (!req.user) throw new UnauthorizedError();\n    if (!roles.some(r => req.user.roles.includes(r))) throw new ForbiddenError();\n    next();\n  };\n}\nrouter.delete('\u002Fusers\u002F:id', authenticate, authorize('admin'), deleteUser);\n```\n\n### Auth Token Automatic Refresh\n\n```typescript\n\u002F\u002F lib\u002Fapi-client.ts — transparent refresh on 401\nasync function apiWithRefresh\u003CT>(path: string, options: RequestInit = {}): Promise\u003CT> {\n  try {\n    return await api\u003CT>(path, options);\n  } catch (err) {\n    if (err instanceof ApiError && err.status === 401) {\n      const refreshed = await api\u003C{ accessToken: string }>('\u002Fapi\u002Fauth\u002Frefresh', {\n        method: 'POST',\n        credentials: 'include',  \u002F\u002F send httpOnly cookie\n      });\n      setAuthToken(refreshed.accessToken);\n      return api\u003CT>(path, options);  \u002F\u002F retry\n    }\n    throw err;\n  }\n}\n```\n\n---\n\n## 7. Logging & Observability (MEDIUM-HIGH)\n\n### Structured JSON Logging\n\n```typescript\n\u002F\u002F ✅ Structured — parseable, filterable, alertable\nlogger.info('Order created', {\n  orderId: order.id, userId: user.id, total: order.total,\n  items: order.items.length, duration_ms: Date.now() - startTime,\n});\n\u002F\u002F Output: {\"level\":\"info\",\"msg\":\"Order created\",\"orderId\":\"ord_123\",...}\n\n\u002F\u002F ❌ Unstructured — useless at scale\nconsole.log(`Order created for user ${user.id} with total ${order.total}`);\n```\n\n### Log Levels\n\n| Level | When | Production? |\n|-------|------|------------|\n| error | Requires immediate attention | ✅ Always |\n| warn | Unexpected but handled | ✅ Always |\n| info | Normal operations, audit trail | ✅ Always |\n| debug | Dev troubleshooting | ❌ Dev only |\n\n### Rules\n\n```\n✅ Request ID in every log entry (propagated via middleware)\n✅ Log at layer boundaries (request in, response out, external call)\n❌ Never log passwords, tokens, PII, or secrets\n❌ Never use console.log in production code\n```\n\n---\n\n## 8. Background Jobs & Async (MEDIUM)\n\n### Rules\n\n```\n✅ All jobs must be IDEMPOTENT (same job running twice = same result)\n✅ Failed jobs → retry (max 3) → dead letter queue → alert\n✅ Workers run as SEPARATE processes (not threads in API server)\n\n❌ Never put long-running tasks in request handlers\n❌ Never assume job runs exactly once\n```\n\n### Idempotent Job Pattern\n\n```typescript\nasync function processPayment(data: { orderId: string }) {\n  const order = await orderRepo.findById(data.orderId);\n  if (order.paymentStatus === 'completed') return;  \u002F\u002F already processed\n  await paymentGateway.charge(order);\n  await orderRepo.updatePaymentStatus(order.id, 'completed');\n}\n```\n\n---\n\n## 9. Caching Patterns (MEDIUM)\n\n### Cache-Aside (Lazy Loading)\n\n```typescript\nasync function getUser(id: string): Promise\u003CUser> {\n  const cached = await redis.get(`user:${id}`);\n  if (cached) return JSON.parse(cached);\n\n  const user = await userRepo.findById(id);\n  if (!user) throw new NotFoundError('User', id);\n\n  await redis.set(`user:${id}`, JSON.stringify(user), 'EX', 900);  \u002F\u002F 15min TTL\n  return user;\n}\n```\n\n### Rules\n\n```\n✅ ALWAYS set TTL — never cache without expiry\n✅ Invalidate on write (delete cache key after update)\n✅ Use cache for reads, never for authoritative state\n\n❌ Never cache without TTL (stale data is worse than slow data)\n```\n\n| Data Type | Suggested TTL |\n|-----------|---------------|\n| User profile | 5-15 min |\n| Product catalog | 1-5 min |\n| Config \u002F feature flags | 30-60 sec |\n| Session | Match session duration |\n\n---\n\n## 10. File Upload Patterns (MEDIUM)\n\n### Option A: Presigned URL (Recommended for Large Files)\n\n```\nClient → GET \u002Fapi\u002Fuploads\u002Fpresign?filename=photo.jpg&type=image\u002Fjpeg\nServer → { uploadUrl: \"https:\u002F\u002Fs3...\u002Fpresigned\", fileKey: \"uploads\u002Fabc123.jpg\" }\nClient → PUT uploadUrl (direct to S3, bypasses your server)\nClient → POST \u002Fapi\u002Fphotos { fileKey: \"uploads\u002Fabc123.jpg\" }  (save reference)\n```\n\n**Backend:**\n```typescript\napp.get('\u002Fapi\u002Fuploads\u002Fpresign', authenticate, async (req, res) => {\n  const { filename, type } = req.query;\n  const key = `uploads\u002F${crypto.randomUUID()}-${filename}`;\n  const url = await s3.getSignedUrl('putObject', {\n    Bucket: process.env.S3_BUCKET, Key: key,\n    ContentType: type, Expires: 300,  \u002F\u002F 5 min\n  });\n  res.json({ uploadUrl: url, fileKey: key });\n});\n```\n\n**Frontend:**\n```typescript\nasync function uploadFile(file: File) {\n  const { uploadUrl, fileKey } = await apiClient.get\u003CPresignResponse>(\n    `\u002Fapi\u002Fuploads\u002Fpresign?filename=${file.name}&type=${file.type}`\n  );\n  await fetch(uploadUrl, { method: 'PUT', body: file, headers: { 'Content-Type': file.type } });\n  return apiClient.post('\u002Fapi\u002Fphotos', { fileKey });\n}\n```\n\n### Option B: Multipart (Small Files \u003C 10MB)\n\n```typescript\n\u002F\u002F Frontend\nconst formData = new FormData();\nformData.append('file', file);\nformData.append('description', 'Profile photo');\nconst res = await fetch('\u002Fapi\u002Fupload', { method: 'POST', body: formData });\n\u002F\u002F Note: do NOT set Content-Type header — browser sets boundary automatically\n```\n\n### Decision\n\n| Method | File Size | Server Load | Complexity |\n|--------|-----------|-------------|------------|\n| Presigned URL | Any (recommended > 5MB) | None (direct to storage) | Medium |\n| Multipart | \u003C 10MB | High (streams through server) | Low |\n| Chunked \u002F Resumable | > 100MB | Medium | High |\n\n---\n\n## 11. Real-Time Patterns (MEDIUM)\n\n### Option A: Server-Sent Events (SSE) — One-Way Server → Client\n\nBest for: notifications, live feeds, streaming AI responses.\n\n**Backend (Express):**\n```typescript\napp.get('\u002Fapi\u002Fevents', authenticate, (req, res) => {\n  res.writeHead(200, {\n    'Content-Type': 'text\u002Fevent-stream',\n    'Cache-Control': 'no-cache',\n    Connection: 'keep-alive',\n  });\n  const send = (event: string, data: unknown) => {\n    res.write(`event: ${event}\\ndata: ${JSON.stringify(data)}\\n\\n`);\n  };\n  const unsubscribe = eventBus.subscribe(req.user.id, (event) => {\n    send(event.type, event.payload);\n  });\n  req.on('close', () => unsubscribe());\n});\n```\n\n**Frontend:**\n```typescript\nfunction useServerEvents(userId: string) {\n  useEffect(() => {\n    const source = new EventSource(`\u002Fapi\u002Fevents?userId=${userId}`);\n    source.addEventListener('notification', (e) => {\n      showToast(JSON.parse(e.data).message);\n    });\n    source.onerror = () => { source.close(); setTimeout(() => \u002F* reconnect *\u002F, 3000); };\n    return () => source.close();\n  }, [userId]);\n}\n```\n\n### Option B: WebSocket — Bidirectional\n\nBest for: chat, collaborative editing, gaming.\n\n**Backend (ws library):**\n```typescript\nimport { WebSocketServer } from 'ws';\nconst wss = new WebSocketServer({ server: httpServer, path: '\u002Fws' });\nwss.on('connection', (ws, req) => {\n  const userId = authenticateWs(req);\n  if (!userId) { ws.close(4001, 'Unauthorized'); return; }\n  ws.on('message', (raw) => handleMessage(userId, JSON.parse(raw.toString())));\n  ws.on('close', () => cleanupUser(userId));\n  const interval = setInterval(() => ws.ping(), 30000);\n  ws.on('pong', () => { \u002F* alive *\u002F });\n  ws.on('close', () => clearInterval(interval));\n});\n```\n\n**Frontend:**\n```typescript\nfunction useWebSocket(url: string) {\n  const [ws, setWs] = useState\u003CWebSocket | null>(null);\n  useEffect(() => {\n    const socket = new WebSocket(url);\n    socket.onopen = () => setWs(socket);\n    socket.onclose = () => setTimeout(() => \u002F* reconnect *\u002F, 3000);\n    return () => socket.close();\n  }, [url]);\n  const send = useCallback((data: unknown) => ws?.send(JSON.stringify(data)), [ws]);\n  return { ws, send };\n}\n```\n\n### Option C: Polling (Simplest, No Infrastructure)\n\n```typescript\nfunction useOrderStatus(orderId: string) {\n  return useQuery({\n    queryKey: ['order-status', orderId],\n    queryFn: () => apiClient.get\u003COrder>(`\u002Fapi\u002Forders\u002F${orderId}`),\n    refetchInterval: (query) => {\n      if (query.state.data?.status === 'completed') return false;\n      return 5000;\n    },\n  });\n}\n```\n\n### Decision\n\n| Method | Direction | Complexity | When |\n|--------|-----------|------------|------|\n| Polling | Client → Server | Low | Simple status checks, \u003C 10 clients |\n| SSE | Server → Client | Medium | Notifications, feeds, AI streaming |\n| WebSocket | Bidirectional | High | Chat, collaboration, gaming |\n\n---\n\n## 12. Cross-Boundary Error Handling (MEDIUM)\n\n### API Error → User-Facing Message\n\n```typescript\n\u002F\u002F lib\u002Ferror-handler.ts\nexport function getErrorMessage(error: unknown): string {\n  if (error instanceof ApiError) {\n    switch (error.status) {\n      case 401: return 'Please log in to continue.';\n      case 403: return 'You don\\'t have permission to do this.';\n      case 404: return 'The item you\\'re looking for doesn\\'t exist.';\n      case 409: return 'This conflicts with an existing item.';\n      case 422:\n        const fields = error.body?.errors;\n        if (fields?.length) return fields.map((f: any) => f.message).join('. ');\n        return 'Please check your input.';\n      case 429: return 'Too many requests. Please wait a moment.';\n      default: return 'Something went wrong. Please try again.';\n    }\n  }\n  if (error instanceof TypeError && error.message === 'Failed to fetch') {\n    return 'Cannot connect to server. Check your internet connection.';\n  }\n  return 'An unexpected error occurred.';\n}\n```\n\n### React Query Global Error Handler\n\n```typescript\nconst queryClient = new QueryClient({\n  defaultOptions: {\n    mutations: { onError: (error) => toast.error(getErrorMessage(error)) },\n    queries: {\n      retry: (failureCount, error) => {\n        if (error instanceof ApiError && error.status \u003C 500) return false;\n        return failureCount \u003C 3;\n      },\n    },\n  },\n});\n```\n\n### Rules\n\n```\n✅ Map every API error code to a human-readable message\n✅ Show field-level validation errors next to form inputs\n✅ Auto-retry on 5xx (max 3, with backoff), never on 4xx\n✅ Redirect to login on 401 (after refresh attempt fails)\n✅ Show \"offline\" banner when fetch fails with TypeError\n\n❌ Never show raw API error messages to users (\"NullPointerException\")\n❌ Never silently swallow errors (show toast or log)\n❌ Never retry 4xx errors (client is wrong, retrying won't help)\n```\n\n### Integration Decision Tree\n\n```\nSame team owns frontend + backend?\n│\n├─ YES, both TypeScript\n│   └─ tRPC (end-to-end type safety, zero codegen)\n│\n├─ YES, different languages\n│   └─ OpenAPI spec → generated client (type safety via codegen)\n│\n├─ NO, public API\n│   └─ REST + OpenAPI → generated SDKs for consumers\n│\n└─ Complex data needs, multiple frontends\n    └─ GraphQL + codegen (flexible queries per client)\n\nReal-time needed?\n│\n├─ Server → Client only (notifications, feeds, AI streaming)\n│   └─ SSE (simplest, auto-reconnect, works through proxies)\n│\n├─ Bidirectional (chat, collaboration)\n│   └─ WebSocket (need heartbeat + reconnection logic)\n│\n└─ Simple status polling (\u003C 10 clients)\n    └─ React Query refetchInterval (no infrastructure needed)\n```\n\n---\n\n## 13. Production Hardening (MEDIUM)\n\n### Health Checks\n\n```typescript\napp.get('\u002Fhealth', (req, res) => res.json({ status: 'ok' }));           \u002F\u002F liveness\napp.get('\u002Fready', async (req, res) => {                                   \u002F\u002F readiness\n  const checks = {\n    database: await checkDb(), redis: await checkRedis(), \n  };\n  const ok = Object.values(checks).every(c => c.status === 'ok');\n  res.status(ok ? 200 : 503).json({ status: ok ? 'ok' : 'degraded', checks });\n});\n```\n\n### Graceful Shutdown\n\n```typescript\nprocess.on('SIGTERM', async () => {\n  logger.info('SIGTERM received');\n  server.close();              \u002F\u002F stop new connections\n  await drainConnections();    \u002F\u002F finish in-flight\n  await closeDatabase();\n  process.exit(0);\n});\n```\n\n### Security Checklist\n\n```\n✅ CORS: explicit origins (never '*' in production)\n✅ Security headers (helmet \u002F equivalent)\n✅ Rate limiting on public endpoints\n✅ Input validation on ALL endpoints (trust nothing)\n✅ HTTPS enforced\n❌ Never expose internal errors to clients\n```\n\n---\n\n## Anti-Patterns\n\n| # | ❌ Don't | ✅ Do Instead |\n|---|---------|--------------|\n| 1 | Business logic in routes\u002Fcontrollers | Move to service layer |\n| 2 | `process.env` scattered everywhere | Centralized typed config |\n| 3 | `console.log` for logging | Structured JSON logger |\n| 4 | Generic `Error('oops')` | Typed error hierarchy |\n| 5 | Direct DB calls in controllers | Repository pattern |\n| 6 | No input validation | Validate at boundary (Zod\u002FPydantic) |\n| 7 | Catching errors silently | Log + rethrow or return error |\n| 8 | No health check endpoints | `\u002Fhealth` + `\u002Fready` |\n| 9 | Hardcoded config\u002Fsecrets | Environment variables |\n| 10 | No graceful shutdown | Handle SIGTERM properly |\n| 11 | Hardcode API URL in frontend | Environment variable (`NEXT_PUBLIC_API_URL`) |\n| 12 | Store JWT in localStorage | Memory + httpOnly refresh cookie |\n| 13 | Show raw API errors to users | Map to human-readable messages |\n| 14 | Retry 4xx errors | Only retry 5xx (server failures) |\n| 15 | Skip loading states | Skeleton\u002Fspinner while fetching |\n| 16 | Upload large files through API server | Presigned URL → direct to S3 |\n| 17 | Poll for real-time data | SSE or WebSocket |\n| 18 | Duplicate types frontend + backend | Shared types, tRPC, or OpenAPI codegen |\n\n---\n\n## Common Issues\n\n### Issue 1: \"Where does this business rule go?\"\n\n**Rule:** If it involves HTTP (request parsing, status codes, headers) → controller. If it involves business decisions (pricing, permissions, rules) → service. If it touches the database → repository.\n\n### Issue 2: \"Service is getting too big\"\n\n**Symptom:** One service file > 500 lines with 20+ methods.\n\n**Fix:** Split by sub-domain. `OrderService` → `OrderCreationService` + `OrderFulfillmentService` + `OrderQueryService`. Each focused on one workflow.\n\n### Issue 3: \"Tests are slow because they hit the database\"\n\n**Fix:** Unit tests mock the repository layer (fast). Integration tests use test containers or transaction rollback (real DB, still fast). Never mock the service layer in integration tests.\n\n---\n\n## Reference Documents\n\nThis skill includes deep-dive references for specialized topics. Read the relevant reference when you need detailed guidance.\n\n| Need to… | Reference |\n|----------|-----------|\n| Write backend tests (unit, integration, e2e, contract, performance) | [references\u002Ftesting-strategy.md](references\u002Ftesting-strategy.md) |\n| Validate a release before deployment (6-gate checklist) | [references\u002Frelease-checklist.md](references\u002Frelease-checklist.md) |\n| Choose a tech stack (language, framework, database, infra) | [references\u002Ftechnology-selection.md](references\u002Ftechnology-selection.md) |\n| Build with Django \u002F DRF (models, views, serializers, admin) | [references\u002Fdjango-best-practices.md](references\u002Fdjango-best-practices.md) |\n| Design REST\u002FGraphQL\u002FgRPC endpoints (URLs, status codes, pagination) | [references\u002Fapi-design.md](references\u002Fapi-design.md) |\n| Design database schema, indexes, migrations, multi-tenancy | [references\u002Fdb-schema.md](references\u002Fdb-schema.md) |\n| Auth flow (JWT bearer, token refresh, Next.js SSR, RBAC, middleware order) | [references\u002Fauth-flow.md](references\u002Fauth-flow.md) |\n| CORS config, env vars per environment, common CORS issues | [references\u002Fenvironment-management.md](references\u002Fenvironment-management.md) |\n",{"data":41,"body":52},{"name":4,"description":6,"license":32,"metadata":42},{"category":19,"version":43,"sources":44},"1.0.0",[45,46,47,48,49,50,51],"The Twelve-Factor App (12factor.net)","Clean Architecture (Robert C. Martin)","Domain-Driven Design (Eric Evans)","Patterns of Enterprise Application Architecture (Martin Fowler)","Martin Fowler (Testing Pyramid, Contract Tests)","Google SRE Handbook (Release Engineering)","ThoughtWorks Technology Radar",{"type":53,"children":54},"root",[55,64,71,81,88,93,158,163,169,174,318,323,329,334,340,345,351,356,560,565,571,576,620,624,630,638,681,689,702,705,711,964,970,1099,1102,1108,1412,1415,1421,1431,1434,1440,1446,1455,1461,1470,1551,1557,1565,1698,1706,1747,1755,1828,1831,1837,1843,1850,2404,2411,2504,2510,2519,2522,2528,2534,3063,3133,3139,3725,3730,3739,3742,3748,3754,3877,3886,3892,4204,4210,4500,4506,4519,4522,4528,4533,4539,6144,6150,7182,7188,7811,7817,7888,7894,8035,8038,8044,8063,8069,8078,8084,8093,8099,8466,8472,8989,8992,8998,9004,9340,9346,9440,9445,9454,9457,9463,9468,9477,9483,9761,9764,9770,9776,10221,10226,10235,10309,10312,10318,10324,10333,10341,10795,10803,11180,11186,11442,11447,11545,11548,11554,11560,11565,11573,12183,12190,12612,12618,12623,12631,13335,13342,13841,13847,14181,14186,14280,14283,14289,14295,15011,15017,15328,15333,15342,15348,15357,15360,15366,15372,15896,15902,16125,16131,16140,16143,16149,16534,16537,16543,16549,16559,16565,16575,16615,16621,16630,16633,16639,16644,16788],{"type":56,"tag":57,"props":58,"children":60},"element","h1",{"id":59},"full-stack-development-practices",[61],{"type":62,"value":63},"text","Full-Stack Development Practices",{"type":56,"tag":65,"props":66,"children":68},"h2",{"id":67},"mandatory-workflow-follow-these-steps-in-order",[69],{"type":62,"value":70},"MANDATORY WORKFLOW — Follow These Steps In Order",{"type":56,"tag":72,"props":73,"children":74},"p",{},[75],{"type":56,"tag":76,"props":77,"children":78},"strong",{},[79],{"type":62,"value":80},"When this skill is triggered, you MUST follow this workflow before writing any code.",{"type":56,"tag":82,"props":83,"children":85},"h3",{"id":84},"step-0-gather-requirements",[86],{"type":62,"value":87},"Step 0: Gather Requirements",{"type":56,"tag":72,"props":89,"children":90},{},[91],{"type":62,"value":92},"Before scaffolding anything, ask the user to clarify (or infer from context):",{"type":56,"tag":94,"props":95,"children":96},"ol",{},[97,108,118,128,138,148],{"type":56,"tag":98,"props":99,"children":100},"li",{},[101,106],{"type":56,"tag":76,"props":102,"children":103},{},[104],{"type":62,"value":105},"Stack",{"type":62,"value":107},": Language\u002Fframework for backend and frontend (e.g., Express + React, Django + Vue, Go + HTMX)",{"type":56,"tag":98,"props":109,"children":110},{},[111,116],{"type":56,"tag":76,"props":112,"children":113},{},[114],{"type":62,"value":115},"Service type",{"type":62,"value":117},": API-only, full-stack monolith, or microservice?",{"type":56,"tag":98,"props":119,"children":120},{},[121,126],{"type":56,"tag":76,"props":122,"children":123},{},[124],{"type":62,"value":125},"Database",{"type":62,"value":127},": SQL (PostgreSQL, SQLite, MySQL) or NoSQL (MongoDB, Redis)?",{"type":56,"tag":98,"props":129,"children":130},{},[131,136],{"type":56,"tag":76,"props":132,"children":133},{},[134],{"type":62,"value":135},"Integration",{"type":62,"value":137},": REST, GraphQL, tRPC, or gRPC?",{"type":56,"tag":98,"props":139,"children":140},{},[141,146],{"type":56,"tag":76,"props":142,"children":143},{},[144],{"type":62,"value":145},"Real-time",{"type":62,"value":147},": Needed? If yes — SSE, WebSocket, or polling?",{"type":56,"tag":98,"props":149,"children":150},{},[151,156],{"type":56,"tag":76,"props":152,"children":153},{},[154],{"type":62,"value":155},"Auth",{"type":62,"value":157},": Needed? If yes — JWT, session, OAuth, or third-party (Clerk, Auth.js)?",{"type":56,"tag":72,"props":159,"children":160},{},[161],{"type":62,"value":162},"If the user has already specified these in their request, skip asking and proceed.",{"type":56,"tag":82,"props":164,"children":166},{"id":165},"step-1-architectural-decisions",[167],{"type":62,"value":168},"Step 1: Architectural Decisions",{"type":56,"tag":72,"props":170,"children":171},{},[172],{"type":62,"value":173},"Based on requirements, make and state these decisions before coding:",{"type":56,"tag":175,"props":176,"children":177},"table",{},[178,202],{"type":56,"tag":179,"props":180,"children":181},"thead",{},[182],{"type":56,"tag":183,"props":184,"children":185},"tr",{},[186,192,197],{"type":56,"tag":187,"props":188,"children":189},"th",{},[190],{"type":62,"value":191},"Decision",{"type":56,"tag":187,"props":193,"children":194},{},[195],{"type":62,"value":196},"Options",{"type":56,"tag":187,"props":198,"children":199},{},[200],{"type":62,"value":201},"Reference",{"type":56,"tag":203,"props":204,"children":205},"tbody",{},[206,230,252,274,296],{"type":56,"tag":183,"props":207,"children":208},{},[209,215,220],{"type":56,"tag":210,"props":211,"children":212},"td",{},[213],{"type":62,"value":214},"Project structure",{"type":56,"tag":210,"props":216,"children":217},{},[218],{"type":62,"value":219},"Feature-first (recommended) vs layer-first",{"type":56,"tag":210,"props":221,"children":222},{},[223],{"type":56,"tag":224,"props":225,"children":227},"a",{"href":226},"#1-project-structure--layering-critical",[228],{"type":62,"value":229},"Section 1",{"type":56,"tag":183,"props":231,"children":232},{},[233,238,243],{"type":56,"tag":210,"props":234,"children":235},{},[236],{"type":62,"value":237},"API client approach",{"type":56,"tag":210,"props":239,"children":240},{},[241],{"type":62,"value":242},"Typed fetch \u002F React Query \u002F tRPC \u002F OpenAPI codegen",{"type":56,"tag":210,"props":244,"children":245},{},[246],{"type":56,"tag":224,"props":247,"children":249},{"href":248},"#5-api-client-patterns-medium",[250],{"type":62,"value":251},"Section 5",{"type":56,"tag":183,"props":253,"children":254},{},[255,260,265],{"type":56,"tag":210,"props":256,"children":257},{},[258],{"type":62,"value":259},"Auth strategy",{"type":56,"tag":210,"props":261,"children":262},{},[263],{"type":62,"value":264},"JWT + refresh \u002F session \u002F third-party",{"type":56,"tag":210,"props":266,"children":267},{},[268],{"type":56,"tag":224,"props":269,"children":271},{"href":270},"#6-authentication--middleware-high",[272],{"type":62,"value":273},"Section 6",{"type":56,"tag":183,"props":275,"children":276},{},[277,282,287],{"type":56,"tag":210,"props":278,"children":279},{},[280],{"type":62,"value":281},"Real-time method",{"type":56,"tag":210,"props":283,"children":284},{},[285],{"type":62,"value":286},"Polling \u002F SSE \u002F WebSocket",{"type":56,"tag":210,"props":288,"children":289},{},[290],{"type":56,"tag":224,"props":291,"children":293},{"href":292},"#11-real-time-patterns-medium",[294],{"type":62,"value":295},"Section 11",{"type":56,"tag":183,"props":297,"children":298},{},[299,304,309],{"type":56,"tag":210,"props":300,"children":301},{},[302],{"type":62,"value":303},"Error handling",{"type":56,"tag":210,"props":305,"children":306},{},[307],{"type":62,"value":308},"Typed error hierarchy + global handler",{"type":56,"tag":210,"props":310,"children":311},{},[312],{"type":56,"tag":224,"props":313,"children":315},{"href":314},"#3-error-handling--resilience-high",[316],{"type":62,"value":317},"Section 3",{"type":56,"tag":72,"props":319,"children":320},{},[321],{"type":62,"value":322},"Briefly explain each choice (1 sentence per decision).",{"type":56,"tag":82,"props":324,"children":326},{"id":325},"step-2-scaffold-with-checklist",[327],{"type":62,"value":328},"Step 2: Scaffold with Checklist",{"type":56,"tag":72,"props":330,"children":331},{},[332],{"type":62,"value":333},"Use the appropriate checklist below. Ensure ALL checked items are implemented — do not skip any.",{"type":56,"tag":82,"props":335,"children":337},{"id":336},"step-3-implement-following-patterns",[338],{"type":62,"value":339},"Step 3: Implement Following Patterns",{"type":56,"tag":72,"props":341,"children":342},{},[343],{"type":62,"value":344},"Write code following the patterns in this document. Reference specific sections as you implement each part.",{"type":56,"tag":82,"props":346,"children":348},{"id":347},"step-4-test-verify",[349],{"type":62,"value":350},"Step 4: Test & Verify",{"type":56,"tag":72,"props":352,"children":353},{},[354],{"type":62,"value":355},"After implementation, run these checks before claiming completion:",{"type":56,"tag":94,"props":357,"children":358},{},[359,469,540,550],{"type":56,"tag":98,"props":360,"children":361},{},[362,367,369],{"type":56,"tag":76,"props":363,"children":364},{},[365],{"type":62,"value":366},"Build check",{"type":62,"value":368},": Ensure both backend and frontend compile without errors\n",{"type":56,"tag":370,"props":371,"children":376},"pre",{"className":372,"code":373,"language":374,"meta":375,"style":375},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","# Backend\ncd server && npm run build\n# Frontend\ncd client && npm run build\n","bash","",[377],{"type":56,"tag":378,"props":379,"children":380},"code",{"__ignoreMap":375},[381,393,431,440],{"type":56,"tag":382,"props":383,"children":386},"span",{"class":384,"line":385},"line",1,[387],{"type":56,"tag":382,"props":388,"children":390},{"style":389},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[391],{"type":62,"value":392},"# Backend\n",{"type":56,"tag":382,"props":394,"children":396},{"class":384,"line":395},2,[397,403,409,415,421,426],{"type":56,"tag":382,"props":398,"children":400},{"style":399},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[401],{"type":62,"value":402},"cd",{"type":56,"tag":382,"props":404,"children":406},{"style":405},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[407],{"type":62,"value":408}," server",{"type":56,"tag":382,"props":410,"children":412},{"style":411},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[413],{"type":62,"value":414}," &&",{"type":56,"tag":382,"props":416,"children":418},{"style":417},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[419],{"type":62,"value":420}," npm",{"type":56,"tag":382,"props":422,"children":423},{"style":405},[424],{"type":62,"value":425}," run",{"type":56,"tag":382,"props":427,"children":428},{"style":405},[429],{"type":62,"value":430}," build\n",{"type":56,"tag":382,"props":432,"children":434},{"class":384,"line":433},3,[435],{"type":56,"tag":382,"props":436,"children":437},{"style":389},[438],{"type":62,"value":439},"# Frontend\n",{"type":56,"tag":382,"props":441,"children":443},{"class":384,"line":442},4,[444,448,453,457,461,465],{"type":56,"tag":382,"props":445,"children":446},{"style":399},[447],{"type":62,"value":402},{"type":56,"tag":382,"props":449,"children":450},{"style":405},[451],{"type":62,"value":452}," client",{"type":56,"tag":382,"props":454,"children":455},{"style":411},[456],{"type":62,"value":414},{"type":56,"tag":382,"props":458,"children":459},{"style":417},[460],{"type":62,"value":420},{"type":56,"tag":382,"props":462,"children":463},{"style":405},[464],{"type":62,"value":425},{"type":56,"tag":382,"props":466,"children":467},{"style":405},[468],{"type":62,"value":430},{"type":56,"tag":98,"props":470,"children":471},{},[472,477,479],{"type":56,"tag":76,"props":473,"children":474},{},[475],{"type":62,"value":476},"Start & smoke test",{"type":62,"value":478},": Start the server, verify key endpoints return expected responses\n",{"type":56,"tag":370,"props":480,"children":482},{"className":372,"code":481,"language":374,"meta":375,"style":375},"# Start server, then test\ncurl http:\u002F\u002Flocalhost:3000\u002Fhealth\ncurl http:\u002F\u002Flocalhost:3000\u002Fapi\u002F\u003Cresource>\n",[483],{"type":56,"tag":378,"props":484,"children":485},{"__ignoreMap":375},[486,494,507],{"type":56,"tag":382,"props":487,"children":488},{"class":384,"line":385},[489],{"type":56,"tag":382,"props":490,"children":491},{"style":389},[492],{"type":62,"value":493},"# Start server, then test\n",{"type":56,"tag":382,"props":495,"children":496},{"class":384,"line":395},[497,502],{"type":56,"tag":382,"props":498,"children":499},{"style":417},[500],{"type":62,"value":501},"curl",{"type":56,"tag":382,"props":503,"children":504},{"style":405},[505],{"type":62,"value":506}," http:\u002F\u002Flocalhost:3000\u002Fhealth\n",{"type":56,"tag":382,"props":508,"children":509},{"class":384,"line":433},[510,514,519,524,529,535],{"type":56,"tag":382,"props":511,"children":512},{"style":417},[513],{"type":62,"value":501},{"type":56,"tag":382,"props":515,"children":516},{"style":405},[517],{"type":62,"value":518}," http:\u002F\u002Flocalhost:3000\u002Fapi\u002F",{"type":56,"tag":382,"props":520,"children":521},{"style":411},[522],{"type":62,"value":523},"\u003C",{"type":56,"tag":382,"props":525,"children":526},{"style":405},[527],{"type":62,"value":528},"resourc",{"type":56,"tag":382,"props":530,"children":532},{"style":531},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[533],{"type":62,"value":534},"e",{"type":56,"tag":382,"props":536,"children":537},{"style":411},[538],{"type":62,"value":539},">\n",{"type":56,"tag":98,"props":541,"children":542},{},[543,548],{"type":56,"tag":76,"props":544,"children":545},{},[546],{"type":62,"value":547},"Integration check",{"type":62,"value":549},": Verify frontend can connect to backend (CORS, API base URL, auth flow)",{"type":56,"tag":98,"props":551,"children":552},{},[553,558],{"type":56,"tag":76,"props":554,"children":555},{},[556],{"type":62,"value":557},"Real-time check",{"type":62,"value":559}," (if applicable): Open two browser tabs, verify changes sync",{"type":56,"tag":72,"props":561,"children":562},{},[563],{"type":62,"value":564},"If any check fails, fix the issue before proceeding.",{"type":56,"tag":82,"props":566,"children":568},{"id":567},"step-5-handoff-summary",[569],{"type":62,"value":570},"Step 5: Handoff Summary",{"type":56,"tag":72,"props":572,"children":573},{},[574],{"type":62,"value":575},"Provide a brief summary to the user:",{"type":56,"tag":577,"props":578,"children":579},"ul",{},[580,590,600,610],{"type":56,"tag":98,"props":581,"children":582},{},[583,588],{"type":56,"tag":76,"props":584,"children":585},{},[586],{"type":62,"value":587},"What was built",{"type":62,"value":589},": List of implemented features and endpoints",{"type":56,"tag":98,"props":591,"children":592},{},[593,598],{"type":56,"tag":76,"props":594,"children":595},{},[596],{"type":62,"value":597},"How to run",{"type":62,"value":599},": Exact commands to start backend and frontend",{"type":56,"tag":98,"props":601,"children":602},{},[603,608],{"type":56,"tag":76,"props":604,"children":605},{},[606],{"type":62,"value":607},"What's missing \u002F next steps",{"type":62,"value":609},": Any deferred items, known limitations, or recommended improvements",{"type":56,"tag":98,"props":611,"children":612},{},[613,618],{"type":56,"tag":76,"props":614,"children":615},{},[616],{"type":62,"value":617},"Key files",{"type":62,"value":619},": List the most important files the user should know about",{"type":56,"tag":621,"props":622,"children":623},"hr",{},[],{"type":56,"tag":65,"props":625,"children":627},{"id":626},"scope",[628],{"type":62,"value":629},"Scope",{"type":56,"tag":72,"props":631,"children":632},{},[633],{"type":56,"tag":76,"props":634,"children":635},{},[636],{"type":62,"value":637},"USE this skill when:",{"type":56,"tag":577,"props":639,"children":640},{},[641,646,651,656,661,666,671,676],{"type":56,"tag":98,"props":642,"children":643},{},[644],{"type":62,"value":645},"Building a full-stack application (backend + frontend)",{"type":56,"tag":98,"props":647,"children":648},{},[649],{"type":62,"value":650},"Scaffolding a new backend service or API",{"type":56,"tag":98,"props":652,"children":653},{},[654],{"type":62,"value":655},"Designing service layers and module boundaries",{"type":56,"tag":98,"props":657,"children":658},{},[659],{"type":62,"value":660},"Implementing database access, caching, or background jobs",{"type":56,"tag":98,"props":662,"children":663},{},[664],{"type":62,"value":665},"Writing error handling, logging, or configuration management",{"type":56,"tag":98,"props":667,"children":668},{},[669],{"type":62,"value":670},"Reviewing backend code for architectural issues",{"type":56,"tag":98,"props":672,"children":673},{},[674],{"type":62,"value":675},"Hardening for production",{"type":56,"tag":98,"props":677,"children":678},{},[679],{"type":62,"value":680},"Setting up API clients, auth flows, file uploads, or real-time features",{"type":56,"tag":72,"props":682,"children":683},{},[684],{"type":56,"tag":76,"props":685,"children":686},{},[687],{"type":62,"value":688},"NOT for:",{"type":56,"tag":577,"props":690,"children":691},{},[692,697],{"type":56,"tag":98,"props":693,"children":694},{},[695],{"type":62,"value":696},"Pure frontend\u002FUI concerns (use your frontend framework's docs)",{"type":56,"tag":98,"props":698,"children":699},{},[700],{"type":62,"value":701},"Pure database schema design without backend context",{"type":56,"tag":621,"props":703,"children":704},{},[],{"type":56,"tag":65,"props":706,"children":708},{"id":707},"quick-start-new-backend-service-checklist",[709],{"type":62,"value":710},"Quick Start — New Backend Service Checklist",{"type":56,"tag":577,"props":712,"children":715},{"className":713},[714],"contains-task-list",[716,736,759,783,798,813,836,851,866,896,911,933,948],{"type":56,"tag":98,"props":717,"children":720},{"className":718},[719],"task-list-item",[721,727,729,734],{"type":56,"tag":722,"props":723,"children":726},"input",{"disabled":724,"type":725},true,"checkbox",[],{"type":62,"value":728}," Project scaffolded with ",{"type":56,"tag":76,"props":730,"children":731},{},[732],{"type":62,"value":733},"feature-first",{"type":62,"value":735}," structure",{"type":56,"tag":98,"props":737,"children":739},{"className":738},[719],[740,743,745,750,752,757],{"type":56,"tag":722,"props":741,"children":742},{"disabled":724,"type":725},[],{"type":62,"value":744}," Configuration ",{"type":56,"tag":76,"props":746,"children":747},{},[748],{"type":62,"value":749},"centralized",{"type":62,"value":751},", env vars ",{"type":56,"tag":76,"props":753,"children":754},{},[755],{"type":62,"value":756},"validated at startup",{"type":62,"value":758}," (fail fast)",{"type":56,"tag":98,"props":760,"children":762},{"className":761},[719],[763,766,768,773,775,781],{"type":56,"tag":722,"props":764,"children":765},{"disabled":724,"type":725},[],{"type":62,"value":767}," ",{"type":56,"tag":76,"props":769,"children":770},{},[771],{"type":62,"value":772},"Typed error hierarchy",{"type":62,"value":774}," defined (not generic ",{"type":56,"tag":378,"props":776,"children":778},{"className":777},[],[779],{"type":62,"value":780},"Error",{"type":62,"value":782},")",{"type":56,"tag":98,"props":784,"children":786},{"className":785},[719],[787,790,791,796],{"type":56,"tag":722,"props":788,"children":789},{"disabled":724,"type":725},[],{"type":62,"value":767},{"type":56,"tag":76,"props":792,"children":793},{},[794],{"type":62,"value":795},"Global error handler",{"type":62,"value":797}," middleware",{"type":56,"tag":98,"props":799,"children":801},{"className":800},[719],[802,805,806,811],{"type":56,"tag":722,"props":803,"children":804},{"disabled":724,"type":725},[],{"type":62,"value":767},{"type":56,"tag":76,"props":807,"children":808},{},[809],{"type":62,"value":810},"Structured JSON logging",{"type":62,"value":812}," with request ID propagation",{"type":56,"tag":98,"props":814,"children":816},{"className":815},[719],[817,820,822,827,829,834],{"type":56,"tag":722,"props":818,"children":819},{"disabled":724,"type":725},[],{"type":62,"value":821}," Database: ",{"type":56,"tag":76,"props":823,"children":824},{},[825],{"type":62,"value":826},"migrations",{"type":62,"value":828}," set up, ",{"type":56,"tag":76,"props":830,"children":831},{},[832],{"type":62,"value":833},"connection pooling",{"type":62,"value":835}," configured",{"type":56,"tag":98,"props":837,"children":839},{"className":838},[719],[840,843,844,849],{"type":56,"tag":722,"props":841,"children":842},{"disabled":724,"type":725},[],{"type":62,"value":767},{"type":56,"tag":76,"props":845,"children":846},{},[847],{"type":62,"value":848},"Input validation",{"type":62,"value":850}," on all endpoints (Zod \u002F Pydantic \u002F Go validator)",{"type":56,"tag":98,"props":852,"children":854},{"className":853},[719],[855,858,859,864],{"type":56,"tag":722,"props":856,"children":857},{"disabled":724,"type":725},[],{"type":62,"value":767},{"type":56,"tag":76,"props":860,"children":861},{},[862],{"type":62,"value":863},"Authentication middleware",{"type":62,"value":865}," in place",{"type":56,"tag":98,"props":867,"children":869},{"className":868},[719],[870,873,874,879,881,887,889,895],{"type":56,"tag":722,"props":871,"children":872},{"disabled":724,"type":725},[],{"type":62,"value":767},{"type":56,"tag":76,"props":875,"children":876},{},[877],{"type":62,"value":878},"Health check",{"type":62,"value":880}," endpoints (",{"type":56,"tag":378,"props":882,"children":884},{"className":883},[],[885],{"type":62,"value":886},"\u002Fhealth",{"type":62,"value":888},", ",{"type":56,"tag":378,"props":890,"children":892},{"className":891},[],[893],{"type":62,"value":894},"\u002Fready",{"type":62,"value":782},{"type":56,"tag":98,"props":897,"children":899},{"className":898},[719],[900,903,904,909],{"type":56,"tag":722,"props":901,"children":902},{"disabled":724,"type":725},[],{"type":62,"value":767},{"type":56,"tag":76,"props":905,"children":906},{},[907],{"type":62,"value":908},"Graceful shutdown",{"type":62,"value":910}," handling (SIGTERM)",{"type":56,"tag":98,"props":912,"children":914},{"className":913},[719],[915,918,919,924,926,932],{"type":56,"tag":722,"props":916,"children":917},{"disabled":724,"type":725},[],{"type":62,"value":767},{"type":56,"tag":76,"props":920,"children":921},{},[922],{"type":62,"value":923},"CORS",{"type":62,"value":925}," configured (explicit origins, not ",{"type":56,"tag":378,"props":927,"children":929},{"className":928},[],[930],{"type":62,"value":931},"*",{"type":62,"value":782},{"type":56,"tag":98,"props":934,"children":936},{"className":935},[719],[937,940,941,946],{"type":56,"tag":722,"props":938,"children":939},{"disabled":724,"type":725},[],{"type":62,"value":767},{"type":56,"tag":76,"props":942,"children":943},{},[944],{"type":62,"value":945},"Security headers",{"type":62,"value":947}," (helmet or equivalent)",{"type":56,"tag":98,"props":949,"children":951},{"className":950},[719],[952,955,956,962],{"type":56,"tag":722,"props":953,"children":954},{"disabled":724,"type":725},[],{"type":62,"value":767},{"type":56,"tag":378,"props":957,"children":959},{"className":958},[],[960],{"type":62,"value":961},".env.example",{"type":62,"value":963}," committed (no real secrets)",{"type":56,"tag":65,"props":965,"children":967},{"id":966},"quick-start-frontend-backend-integration-checklist",[968],{"type":62,"value":969},"Quick Start — Frontend-Backend Integration Checklist",{"type":56,"tag":577,"props":971,"children":973},{"className":972},[714],[974,989,1004,1019,1033,1048,1063,1084],{"type":56,"tag":98,"props":975,"children":977},{"className":976},[719],[978,981,982,987],{"type":56,"tag":722,"props":979,"children":980},{"disabled":724,"type":725},[],{"type":62,"value":767},{"type":56,"tag":76,"props":983,"children":984},{},[985],{"type":62,"value":986},"API client",{"type":62,"value":988}," configured (typed fetch wrapper, React Query, tRPC, or OpenAPI generated)",{"type":56,"tag":98,"props":990,"children":992},{"className":991},[719],[993,996,997,1002],{"type":56,"tag":722,"props":994,"children":995},{"disabled":724,"type":725},[],{"type":62,"value":767},{"type":56,"tag":76,"props":998,"children":999},{},[1000],{"type":62,"value":1001},"Base URL",{"type":62,"value":1003}," from environment variable (not hardcoded)",{"type":56,"tag":98,"props":1005,"children":1007},{"className":1006},[719],[1008,1011,1012,1017],{"type":56,"tag":722,"props":1009,"children":1010},{"disabled":724,"type":725},[],{"type":62,"value":767},{"type":56,"tag":76,"props":1013,"children":1014},{},[1015],{"type":62,"value":1016},"Auth token",{"type":62,"value":1018}," attached to requests automatically (interceptor \u002F middleware)",{"type":56,"tag":98,"props":1020,"children":1022},{"className":1021},[719],[1023,1026,1027,1031],{"type":56,"tag":722,"props":1024,"children":1025},{"disabled":724,"type":725},[],{"type":62,"value":767},{"type":56,"tag":76,"props":1028,"children":1029},{},[1030],{"type":62,"value":303},{"type":62,"value":1032}," — API errors mapped to user-facing messages",{"type":56,"tag":98,"props":1034,"children":1036},{"className":1035},[719],[1037,1040,1041,1046],{"type":56,"tag":722,"props":1038,"children":1039},{"disabled":724,"type":725},[],{"type":62,"value":767},{"type":56,"tag":76,"props":1042,"children":1043},{},[1044],{"type":62,"value":1045},"Loading states",{"type":62,"value":1047}," handled (skeleton\u002Fspinner, not blank screen)",{"type":56,"tag":98,"props":1049,"children":1051},{"className":1050},[719],[1052,1055,1056,1061],{"type":56,"tag":722,"props":1053,"children":1054},{"disabled":724,"type":725},[],{"type":62,"value":767},{"type":56,"tag":76,"props":1057,"children":1058},{},[1059],{"type":62,"value":1060},"Type safety",{"type":62,"value":1062}," across the boundary (shared types, OpenAPI, or tRPC)",{"type":56,"tag":98,"props":1064,"children":1066},{"className":1065},[719],[1067,1070,1071,1075,1077,1082],{"type":56,"tag":722,"props":1068,"children":1069},{"disabled":724,"type":725},[],{"type":62,"value":767},{"type":56,"tag":76,"props":1072,"children":1073},{},[1074],{"type":62,"value":923},{"type":62,"value":1076}," configured with explicit origins (not ",{"type":56,"tag":378,"props":1078,"children":1080},{"className":1079},[],[1081],{"type":62,"value":931},{"type":62,"value":1083}," in production)",{"type":56,"tag":98,"props":1085,"children":1087},{"className":1086},[719],[1088,1091,1092,1097],{"type":56,"tag":722,"props":1089,"children":1090},{"disabled":724,"type":725},[],{"type":62,"value":767},{"type":56,"tag":76,"props":1093,"children":1094},{},[1095],{"type":62,"value":1096},"Refresh token",{"type":62,"value":1098}," flow implemented (httpOnly cookie + transparent retry on 401)",{"type":56,"tag":621,"props":1100,"children":1101},{},[],{"type":56,"tag":65,"props":1103,"children":1105},{"id":1104},"quick-navigation",[1106],{"type":62,"value":1107},"Quick Navigation",{"type":56,"tag":175,"props":1109,"children":1110},{},[1111,1127],{"type":56,"tag":179,"props":1112,"children":1113},{},[1114],{"type":56,"tag":183,"props":1115,"children":1116},{},[1117,1122],{"type":56,"tag":187,"props":1118,"children":1119},{},[1120],{"type":62,"value":1121},"Need to…",{"type":56,"tag":187,"props":1123,"children":1124},{},[1125],{"type":62,"value":1126},"Jump to",{"type":56,"tag":203,"props":1128,"children":1129},{},[1130,1146,1163,1179,1196,1212,1228,1245,1262,1279,1296,1312,1329,1346,1363,1380,1396],{"type":56,"tag":183,"props":1131,"children":1132},{},[1133,1138],{"type":56,"tag":210,"props":1134,"children":1135},{},[1136],{"type":62,"value":1137},"Organize project folders",{"type":56,"tag":210,"props":1139,"children":1140},{},[1141],{"type":56,"tag":224,"props":1142,"children":1143},{"href":226},[1144],{"type":62,"value":1145},"1. Project Structure",{"type":56,"tag":183,"props":1147,"children":1148},{},[1149,1154],{"type":56,"tag":210,"props":1150,"children":1151},{},[1152],{"type":62,"value":1153},"Manage config + secrets",{"type":56,"tag":210,"props":1155,"children":1156},{},[1157],{"type":56,"tag":224,"props":1158,"children":1160},{"href":1159},"#2-configuration--environment-critical",[1161],{"type":62,"value":1162},"2. Configuration",{"type":56,"tag":183,"props":1164,"children":1165},{},[1166,1171],{"type":56,"tag":210,"props":1167,"children":1168},{},[1169],{"type":62,"value":1170},"Handle errors properly",{"type":56,"tag":210,"props":1172,"children":1173},{},[1174],{"type":56,"tag":224,"props":1175,"children":1176},{"href":314},[1177],{"type":62,"value":1178},"3. Error Handling",{"type":56,"tag":183,"props":1180,"children":1181},{},[1182,1187],{"type":56,"tag":210,"props":1183,"children":1184},{},[1185],{"type":62,"value":1186},"Write database code",{"type":56,"tag":210,"props":1188,"children":1189},{},[1190],{"type":56,"tag":224,"props":1191,"children":1193},{"href":1192},"#4-database-access-patterns-high",[1194],{"type":62,"value":1195},"4. Database Access Patterns",{"type":56,"tag":183,"props":1197,"children":1198},{},[1199,1204],{"type":56,"tag":210,"props":1200,"children":1201},{},[1202],{"type":62,"value":1203},"Set up API client from frontend",{"type":56,"tag":210,"props":1205,"children":1206},{},[1207],{"type":56,"tag":224,"props":1208,"children":1209},{"href":248},[1210],{"type":62,"value":1211},"5. API Client Patterns",{"type":56,"tag":183,"props":1213,"children":1214},{},[1215,1220],{"type":56,"tag":210,"props":1216,"children":1217},{},[1218],{"type":62,"value":1219},"Add auth middleware",{"type":56,"tag":210,"props":1221,"children":1222},{},[1223],{"type":56,"tag":224,"props":1224,"children":1225},{"href":270},[1226],{"type":62,"value":1227},"6. Auth & Middleware",{"type":56,"tag":183,"props":1229,"children":1230},{},[1231,1236],{"type":56,"tag":210,"props":1232,"children":1233},{},[1234],{"type":62,"value":1235},"Set up logging",{"type":56,"tag":210,"props":1237,"children":1238},{},[1239],{"type":56,"tag":224,"props":1240,"children":1242},{"href":1241},"#7-logging--observability-medium-high",[1243],{"type":62,"value":1244},"7. Logging & Observability",{"type":56,"tag":183,"props":1246,"children":1247},{},[1248,1253],{"type":56,"tag":210,"props":1249,"children":1250},{},[1251],{"type":62,"value":1252},"Add background jobs",{"type":56,"tag":210,"props":1254,"children":1255},{},[1256],{"type":56,"tag":224,"props":1257,"children":1259},{"href":1258},"#8-background-jobs--async-medium",[1260],{"type":62,"value":1261},"8. Background Jobs",{"type":56,"tag":183,"props":1263,"children":1264},{},[1265,1270],{"type":56,"tag":210,"props":1266,"children":1267},{},[1268],{"type":62,"value":1269},"Implement caching",{"type":56,"tag":210,"props":1271,"children":1272},{},[1273],{"type":56,"tag":224,"props":1274,"children":1276},{"href":1275},"#9-caching-patterns-medium",[1277],{"type":62,"value":1278},"9. Caching",{"type":56,"tag":183,"props":1280,"children":1281},{},[1282,1287],{"type":56,"tag":210,"props":1283,"children":1284},{},[1285],{"type":62,"value":1286},"Upload files (presigned URL, multipart)",{"type":56,"tag":210,"props":1288,"children":1289},{},[1290],{"type":56,"tag":224,"props":1291,"children":1293},{"href":1292},"#10-file-upload-patterns-medium",[1294],{"type":62,"value":1295},"10. File Upload Patterns",{"type":56,"tag":183,"props":1297,"children":1298},{},[1299,1304],{"type":56,"tag":210,"props":1300,"children":1301},{},[1302],{"type":62,"value":1303},"Add real-time features (SSE, WebSocket)",{"type":56,"tag":210,"props":1305,"children":1306},{},[1307],{"type":56,"tag":224,"props":1308,"children":1309},{"href":292},[1310],{"type":62,"value":1311},"11. Real-Time Patterns",{"type":56,"tag":183,"props":1313,"children":1314},{},[1315,1320],{"type":56,"tag":210,"props":1316,"children":1317},{},[1318],{"type":62,"value":1319},"Handle API errors in frontend UI",{"type":56,"tag":210,"props":1321,"children":1322},{},[1323],{"type":56,"tag":224,"props":1324,"children":1326},{"href":1325},"#12-cross-boundary-error-handling-medium",[1327],{"type":62,"value":1328},"12. Cross-Boundary Error Handling",{"type":56,"tag":183,"props":1330,"children":1331},{},[1332,1337],{"type":56,"tag":210,"props":1333,"children":1334},{},[1335],{"type":62,"value":1336},"Harden for production",{"type":56,"tag":210,"props":1338,"children":1339},{},[1340],{"type":56,"tag":224,"props":1341,"children":1343},{"href":1342},"#13-production-hardening-medium",[1344],{"type":62,"value":1345},"13. Production Hardening",{"type":56,"tag":183,"props":1347,"children":1348},{},[1349,1354],{"type":56,"tag":210,"props":1350,"children":1351},{},[1352],{"type":62,"value":1353},"Design API endpoints",{"type":56,"tag":210,"props":1355,"children":1356},{},[1357],{"type":56,"tag":224,"props":1358,"children":1360},{"href":1359},"references\u002Fapi-design.md",[1361],{"type":62,"value":1362},"API Design",{"type":56,"tag":183,"props":1364,"children":1365},{},[1366,1371],{"type":56,"tag":210,"props":1367,"children":1368},{},[1369],{"type":62,"value":1370},"Design database schema",{"type":56,"tag":210,"props":1372,"children":1373},{},[1374],{"type":56,"tag":224,"props":1375,"children":1377},{"href":1376},"references\u002Fdb-schema.md",[1378],{"type":62,"value":1379},"Database Schema",{"type":56,"tag":183,"props":1381,"children":1382},{},[1383,1388],{"type":56,"tag":210,"props":1384,"children":1385},{},[1386],{"type":62,"value":1387},"Auth flow (JWT, refresh, Next.js SSR, RBAC)",{"type":56,"tag":210,"props":1389,"children":1390},{},[1391],{"type":56,"tag":224,"props":1392,"children":1394},{"href":1393},"references\u002Fauth-flow.md",[1395],{"type":62,"value":1393},{"type":56,"tag":183,"props":1397,"children":1398},{},[1399,1404],{"type":56,"tag":210,"props":1400,"children":1401},{},[1402],{"type":62,"value":1403},"CORS, env vars, environment management",{"type":56,"tag":210,"props":1405,"children":1406},{},[1407],{"type":56,"tag":224,"props":1408,"children":1410},{"href":1409},"references\u002Fenvironment-management.md",[1411],{"type":62,"value":1409},{"type":56,"tag":621,"props":1413,"children":1414},{},[],{"type":56,"tag":65,"props":1416,"children":1418},{"id":1417},"core-principles-7-iron-rules",[1419],{"type":62,"value":1420},"Core Principles (7 Iron Rules)",{"type":56,"tag":370,"props":1422,"children":1426},{"className":1423,"code":1425,"language":62},[1424],"language-text","1. ✅ Organize by FEATURE, not by technical layer\n2. ✅ Controllers never contain business logic\n3. ✅ Services never import HTTP request\u002Fresponse types\n4. ✅ All config from env vars, validated at startup, fail fast\n5. ✅ Every error is typed, logged, and returns consistent format\n6. ✅ All input validated at the boundary — trust nothing from client\n7. ✅ Structured JSON logging with request ID — not console.log\n",[1427],{"type":56,"tag":378,"props":1428,"children":1429},{"__ignoreMap":375},[1430],{"type":62,"value":1425},{"type":56,"tag":621,"props":1432,"children":1433},{},[],{"type":56,"tag":65,"props":1435,"children":1437},{"id":1436},"_1-project-structure-layering-critical",[1438],{"type":62,"value":1439},"1. Project Structure & Layering (CRITICAL)",{"type":56,"tag":82,"props":1441,"children":1443},{"id":1442},"feature-first-organization",[1444],{"type":62,"value":1445},"Feature-First Organization",{"type":56,"tag":370,"props":1447,"children":1450},{"className":1448,"code":1449,"language":62},[1424],"✅ Feature-first                    ❌ Layer-first\nsrc\u002F                                src\u002F\n  orders\u002F                             controllers\u002F\n    order.controller.ts                 order.controller.ts\n    order.service.ts                    user.controller.ts\n    order.repository.ts               services\u002F\n    order.dto.ts                        order.service.ts\n    order.test.ts                       user.service.ts\n  users\u002F                              repositories\u002F\n    user.controller.ts                  ...\n    user.service.ts\n  shared\u002F\n    database\u002F\n    middleware\u002F\n",[1451],{"type":56,"tag":378,"props":1452,"children":1453},{"__ignoreMap":375},[1454],{"type":62,"value":1449},{"type":56,"tag":82,"props":1456,"children":1458},{"id":1457},"three-layer-architecture",[1459],{"type":62,"value":1460},"Three-Layer Architecture",{"type":56,"tag":370,"props":1462,"children":1465},{"className":1463,"code":1464,"language":62},[1424],"Controller (HTTP) → Service (Business Logic) → Repository (Data Access)\n",[1466],{"type":56,"tag":378,"props":1467,"children":1468},{"__ignoreMap":375},[1469],{"type":62,"value":1464},{"type":56,"tag":175,"props":1471,"children":1472},{},[1473,1494],{"type":56,"tag":179,"props":1474,"children":1475},{},[1476],{"type":56,"tag":183,"props":1477,"children":1478},{},[1479,1484,1489],{"type":56,"tag":187,"props":1480,"children":1481},{},[1482],{"type":62,"value":1483},"Layer",{"type":56,"tag":187,"props":1485,"children":1486},{},[1487],{"type":62,"value":1488},"Responsibility",{"type":56,"tag":187,"props":1490,"children":1491},{},[1492],{"type":62,"value":1493},"❌ Never",{"type":56,"tag":203,"props":1495,"children":1496},{},[1497,1515,1533],{"type":56,"tag":183,"props":1498,"children":1499},{},[1500,1505,1510],{"type":56,"tag":210,"props":1501,"children":1502},{},[1503],{"type":62,"value":1504},"Controller",{"type":56,"tag":210,"props":1506,"children":1507},{},[1508],{"type":62,"value":1509},"Parse request, validate, call service, format response",{"type":56,"tag":210,"props":1511,"children":1512},{},[1513],{"type":62,"value":1514},"Business logic, DB queries",{"type":56,"tag":183,"props":1516,"children":1517},{},[1518,1523,1528],{"type":56,"tag":210,"props":1519,"children":1520},{},[1521],{"type":62,"value":1522},"Service",{"type":56,"tag":210,"props":1524,"children":1525},{},[1526],{"type":62,"value":1527},"Business rules, orchestration, transaction mgmt",{"type":56,"tag":210,"props":1529,"children":1530},{},[1531],{"type":62,"value":1532},"HTTP types (req\u002Fres), direct DB",{"type":56,"tag":183,"props":1534,"children":1535},{},[1536,1541,1546],{"type":56,"tag":210,"props":1537,"children":1538},{},[1539],{"type":62,"value":1540},"Repository",{"type":56,"tag":210,"props":1542,"children":1543},{},[1544],{"type":62,"value":1545},"Database queries, external API calls",{"type":56,"tag":210,"props":1547,"children":1548},{},[1549],{"type":62,"value":1550},"Business logic, HTTP types",{"type":56,"tag":82,"props":1552,"children":1554},{"id":1553},"dependency-injection-all-languages",[1555],{"type":62,"value":1556},"Dependency Injection (All Languages)",{"type":56,"tag":72,"props":1558,"children":1559},{},[1560],{"type":56,"tag":76,"props":1561,"children":1562},{},[1563],{"type":62,"value":1564},"TypeScript:",{"type":56,"tag":370,"props":1566,"children":1570},{"className":1567,"code":1568,"language":1569,"meta":375,"style":375},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","class OrderService {\n  constructor(\n    private readonly orderRepo: OrderRepository,    \u002F\u002F ✅ injected interface\n    private readonly emailService: EmailService,\n  ) {}\n}\n","typescript",[1571],{"type":56,"tag":378,"props":1572,"children":1573},{"__ignoreMap":375},[1574,1593,1606,1645,1675,1689],{"type":56,"tag":382,"props":1575,"children":1576},{"class":384,"line":385},[1577,1583,1588],{"type":56,"tag":382,"props":1578,"children":1580},{"style":1579},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[1581],{"type":62,"value":1582},"class",{"type":56,"tag":382,"props":1584,"children":1585},{"style":417},[1586],{"type":62,"value":1587}," OrderService",{"type":56,"tag":382,"props":1589,"children":1590},{"style":411},[1591],{"type":62,"value":1592}," {\n",{"type":56,"tag":382,"props":1594,"children":1595},{"class":384,"line":395},[1596,1601],{"type":56,"tag":382,"props":1597,"children":1598},{"style":1579},[1599],{"type":62,"value":1600},"  constructor",{"type":56,"tag":382,"props":1602,"children":1603},{"style":411},[1604],{"type":62,"value":1605},"(\n",{"type":56,"tag":382,"props":1607,"children":1608},{"class":384,"line":433},[1609,1614,1619,1625,1630,1635,1640],{"type":56,"tag":382,"props":1610,"children":1611},{"style":1579},[1612],{"type":62,"value":1613},"    private",{"type":56,"tag":382,"props":1615,"children":1616},{"style":1579},[1617],{"type":62,"value":1618}," readonly",{"type":56,"tag":382,"props":1620,"children":1622},{"style":1621},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[1623],{"type":62,"value":1624}," orderRepo",{"type":56,"tag":382,"props":1626,"children":1627},{"style":411},[1628],{"type":62,"value":1629},":",{"type":56,"tag":382,"props":1631,"children":1632},{"style":417},[1633],{"type":62,"value":1634}," OrderRepository",{"type":56,"tag":382,"props":1636,"children":1637},{"style":411},[1638],{"type":62,"value":1639},",",{"type":56,"tag":382,"props":1641,"children":1642},{"style":389},[1643],{"type":62,"value":1644},"    \u002F\u002F ✅ injected interface\n",{"type":56,"tag":382,"props":1646,"children":1647},{"class":384,"line":442},[1648,1652,1656,1661,1665,1670],{"type":56,"tag":382,"props":1649,"children":1650},{"style":1579},[1651],{"type":62,"value":1613},{"type":56,"tag":382,"props":1653,"children":1654},{"style":1579},[1655],{"type":62,"value":1618},{"type":56,"tag":382,"props":1657,"children":1658},{"style":1621},[1659],{"type":62,"value":1660}," emailService",{"type":56,"tag":382,"props":1662,"children":1663},{"style":411},[1664],{"type":62,"value":1629},{"type":56,"tag":382,"props":1666,"children":1667},{"style":417},[1668],{"type":62,"value":1669}," EmailService",{"type":56,"tag":382,"props":1671,"children":1672},{"style":411},[1673],{"type":62,"value":1674},",\n",{"type":56,"tag":382,"props":1676,"children":1678},{"class":384,"line":1677},5,[1679,1684],{"type":56,"tag":382,"props":1680,"children":1681},{"style":411},[1682],{"type":62,"value":1683},"  )",{"type":56,"tag":382,"props":1685,"children":1686},{"style":411},[1687],{"type":62,"value":1688}," {}\n",{"type":56,"tag":382,"props":1690,"children":1692},{"class":384,"line":1691},6,[1693],{"type":56,"tag":382,"props":1694,"children":1695},{"style":411},[1696],{"type":62,"value":1697},"}\n",{"type":56,"tag":72,"props":1699,"children":1700},{},[1701],{"type":56,"tag":76,"props":1702,"children":1703},{},[1704],{"type":62,"value":1705},"Python:",{"type":56,"tag":370,"props":1707,"children":1711},{"className":1708,"code":1709,"language":1710,"meta":375,"style":375},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","class OrderService:\n    def __init__(self, order_repo: OrderRepository, email_service: EmailService):\n        self.order_repo = order_repo                 # ✅ injected\n        self.email_service = email_service\n","python",[1712],{"type":56,"tag":378,"props":1713,"children":1714},{"__ignoreMap":375},[1715,1723,1731,1739],{"type":56,"tag":382,"props":1716,"children":1717},{"class":384,"line":385},[1718],{"type":56,"tag":382,"props":1719,"children":1720},{},[1721],{"type":62,"value":1722},"class OrderService:\n",{"type":56,"tag":382,"props":1724,"children":1725},{"class":384,"line":395},[1726],{"type":56,"tag":382,"props":1727,"children":1728},{},[1729],{"type":62,"value":1730},"    def __init__(self, order_repo: OrderRepository, email_service: EmailService):\n",{"type":56,"tag":382,"props":1732,"children":1733},{"class":384,"line":433},[1734],{"type":56,"tag":382,"props":1735,"children":1736},{},[1737],{"type":62,"value":1738},"        self.order_repo = order_repo                 # ✅ injected\n",{"type":56,"tag":382,"props":1740,"children":1741},{"class":384,"line":442},[1742],{"type":56,"tag":382,"props":1743,"children":1744},{},[1745],{"type":62,"value":1746},"        self.email_service = email_service\n",{"type":56,"tag":72,"props":1748,"children":1749},{},[1750],{"type":56,"tag":76,"props":1751,"children":1752},{},[1753],{"type":62,"value":1754},"Go:",{"type":56,"tag":370,"props":1756,"children":1760},{"className":1757,"code":1758,"language":1759,"meta":375,"style":375},"language-go shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","type OrderService struct {\n    orderRepo    OrderRepository                      \u002F\u002F ✅ interface\n    emailService EmailService\n}\n\nfunc NewOrderService(repo OrderRepository, email EmailService) *OrderService {\n    return &OrderService{orderRepo: repo, emailService: email}\n}\n","go",[1761],{"type":56,"tag":378,"props":1762,"children":1763},{"__ignoreMap":375},[1764,1772,1780,1788,1795,1803,1811,1820],{"type":56,"tag":382,"props":1765,"children":1766},{"class":384,"line":385},[1767],{"type":56,"tag":382,"props":1768,"children":1769},{},[1770],{"type":62,"value":1771},"type OrderService struct {\n",{"type":56,"tag":382,"props":1773,"children":1774},{"class":384,"line":395},[1775],{"type":56,"tag":382,"props":1776,"children":1777},{},[1778],{"type":62,"value":1779},"    orderRepo    OrderRepository                      \u002F\u002F ✅ interface\n",{"type":56,"tag":382,"props":1781,"children":1782},{"class":384,"line":433},[1783],{"type":56,"tag":382,"props":1784,"children":1785},{},[1786],{"type":62,"value":1787},"    emailService EmailService\n",{"type":56,"tag":382,"props":1789,"children":1790},{"class":384,"line":442},[1791],{"type":56,"tag":382,"props":1792,"children":1793},{},[1794],{"type":62,"value":1697},{"type":56,"tag":382,"props":1796,"children":1797},{"class":384,"line":1677},[1798],{"type":56,"tag":382,"props":1799,"children":1800},{"emptyLinePlaceholder":724},[1801],{"type":62,"value":1802},"\n",{"type":56,"tag":382,"props":1804,"children":1805},{"class":384,"line":1691},[1806],{"type":56,"tag":382,"props":1807,"children":1808},{},[1809],{"type":62,"value":1810},"func NewOrderService(repo OrderRepository, email EmailService) *OrderService {\n",{"type":56,"tag":382,"props":1812,"children":1814},{"class":384,"line":1813},7,[1815],{"type":56,"tag":382,"props":1816,"children":1817},{},[1818],{"type":62,"value":1819},"    return &OrderService{orderRepo: repo, emailService: email}\n",{"type":56,"tag":382,"props":1821,"children":1823},{"class":384,"line":1822},8,[1824],{"type":56,"tag":382,"props":1825,"children":1826},{},[1827],{"type":62,"value":1697},{"type":56,"tag":621,"props":1829,"children":1830},{},[],{"type":56,"tag":65,"props":1832,"children":1834},{"id":1833},"_2-configuration-environment-critical",[1835],{"type":62,"value":1836},"2. Configuration & Environment (CRITICAL)",{"type":56,"tag":82,"props":1838,"children":1840},{"id":1839},"centralized-typed-fail-fast",[1841],{"type":62,"value":1842},"Centralized, Typed, Fail-Fast",{"type":56,"tag":72,"props":1844,"children":1845},{},[1846],{"type":56,"tag":76,"props":1847,"children":1848},{},[1849],{"type":62,"value":1564},{"type":56,"tag":370,"props":1851,"children":1853},{"className":1567,"code":1852,"language":1569,"meta":375,"style":375},"const config = {\n  port: parseInt(process.env.PORT || '3000', 10),\n  database: { url: requiredEnv('DATABASE_URL'), poolSize: intEnv('DB_POOL_SIZE', 10) },\n  auth: { jwtSecret: requiredEnv('JWT_SECRET'), expiresIn: process.env.JWT_EXPIRES_IN || '1h' },\n} as const;\n\nfunction requiredEnv(name: string): string {\n  const value = process.env[name];\n  if (!value) throw new Error(`Missing required env var: ${name}`);  \u002F\u002F fail fast\n  return value;\n}\n",[1854],{"type":56,"tag":378,"props":1855,"children":1856},{"__ignoreMap":375},[1857,1879,1959,2065,2172,2196,2203,2246,2294,2379,2396],{"type":56,"tag":382,"props":1858,"children":1859},{"class":384,"line":385},[1860,1865,1870,1875],{"type":56,"tag":382,"props":1861,"children":1862},{"style":1579},[1863],{"type":62,"value":1864},"const",{"type":56,"tag":382,"props":1866,"children":1867},{"style":531},[1868],{"type":62,"value":1869}," config ",{"type":56,"tag":382,"props":1871,"children":1872},{"style":411},[1873],{"type":62,"value":1874},"=",{"type":56,"tag":382,"props":1876,"children":1877},{"style":411},[1878],{"type":62,"value":1592},{"type":56,"tag":382,"props":1880,"children":1881},{"class":384,"line":395},[1882,1888,1892,1897,1902,1907,1912,1916,1921,1926,1931,1936,1941,1945,1951,1955],{"type":56,"tag":382,"props":1883,"children":1885},{"style":1884},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[1886],{"type":62,"value":1887},"  port",{"type":56,"tag":382,"props":1889,"children":1890},{"style":411},[1891],{"type":62,"value":1629},{"type":56,"tag":382,"props":1893,"children":1894},{"style":399},[1895],{"type":62,"value":1896}," parseInt",{"type":56,"tag":382,"props":1898,"children":1899},{"style":531},[1900],{"type":62,"value":1901},"(process",{"type":56,"tag":382,"props":1903,"children":1904},{"style":411},[1905],{"type":62,"value":1906},".",{"type":56,"tag":382,"props":1908,"children":1909},{"style":531},[1910],{"type":62,"value":1911},"env",{"type":56,"tag":382,"props":1913,"children":1914},{"style":411},[1915],{"type":62,"value":1906},{"type":56,"tag":382,"props":1917,"children":1918},{"style":531},[1919],{"type":62,"value":1920},"PORT ",{"type":56,"tag":382,"props":1922,"children":1923},{"style":411},[1924],{"type":62,"value":1925},"||",{"type":56,"tag":382,"props":1927,"children":1928},{"style":411},[1929],{"type":62,"value":1930}," '",{"type":56,"tag":382,"props":1932,"children":1933},{"style":405},[1934],{"type":62,"value":1935},"3000",{"type":56,"tag":382,"props":1937,"children":1938},{"style":411},[1939],{"type":62,"value":1940},"'",{"type":56,"tag":382,"props":1942,"children":1943},{"style":411},[1944],{"type":62,"value":1639},{"type":56,"tag":382,"props":1946,"children":1948},{"style":1947},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[1949],{"type":62,"value":1950}," 10",{"type":56,"tag":382,"props":1952,"children":1953},{"style":531},[1954],{"type":62,"value":782},{"type":56,"tag":382,"props":1956,"children":1957},{"style":411},[1958],{"type":62,"value":1674},{"type":56,"tag":382,"props":1960,"children":1961},{"class":384,"line":433},[1962,1967,1971,1976,1981,1985,1990,1995,1999,2004,2008,2012,2016,2021,2025,2030,2034,2038,2043,2047,2051,2055,2060],{"type":56,"tag":382,"props":1963,"children":1964},{"style":1884},[1965],{"type":62,"value":1966},"  database",{"type":56,"tag":382,"props":1968,"children":1969},{"style":411},[1970],{"type":62,"value":1629},{"type":56,"tag":382,"props":1972,"children":1973},{"style":411},[1974],{"type":62,"value":1975}," {",{"type":56,"tag":382,"props":1977,"children":1978},{"style":1884},[1979],{"type":62,"value":1980}," url",{"type":56,"tag":382,"props":1982,"children":1983},{"style":411},[1984],{"type":62,"value":1629},{"type":56,"tag":382,"props":1986,"children":1987},{"style":399},[1988],{"type":62,"value":1989}," requiredEnv",{"type":56,"tag":382,"props":1991,"children":1992},{"style":531},[1993],{"type":62,"value":1994},"(",{"type":56,"tag":382,"props":1996,"children":1997},{"style":411},[1998],{"type":62,"value":1940},{"type":56,"tag":382,"props":2000,"children":2001},{"style":405},[2002],{"type":62,"value":2003},"DATABASE_URL",{"type":56,"tag":382,"props":2005,"children":2006},{"style":411},[2007],{"type":62,"value":1940},{"type":56,"tag":382,"props":2009,"children":2010},{"style":531},[2011],{"type":62,"value":782},{"type":56,"tag":382,"props":2013,"children":2014},{"style":411},[2015],{"type":62,"value":1639},{"type":56,"tag":382,"props":2017,"children":2018},{"style":1884},[2019],{"type":62,"value":2020}," poolSize",{"type":56,"tag":382,"props":2022,"children":2023},{"style":411},[2024],{"type":62,"value":1629},{"type":56,"tag":382,"props":2026,"children":2027},{"style":399},[2028],{"type":62,"value":2029}," intEnv",{"type":56,"tag":382,"props":2031,"children":2032},{"style":531},[2033],{"type":62,"value":1994},{"type":56,"tag":382,"props":2035,"children":2036},{"style":411},[2037],{"type":62,"value":1940},{"type":56,"tag":382,"props":2039,"children":2040},{"style":405},[2041],{"type":62,"value":2042},"DB_POOL_SIZE",{"type":56,"tag":382,"props":2044,"children":2045},{"style":411},[2046],{"type":62,"value":1940},{"type":56,"tag":382,"props":2048,"children":2049},{"style":411},[2050],{"type":62,"value":1639},{"type":56,"tag":382,"props":2052,"children":2053},{"style":1947},[2054],{"type":62,"value":1950},{"type":56,"tag":382,"props":2056,"children":2057},{"style":531},[2058],{"type":62,"value":2059},") ",{"type":56,"tag":382,"props":2061,"children":2062},{"style":411},[2063],{"type":62,"value":2064},"},\n",{"type":56,"tag":382,"props":2066,"children":2067},{"class":384,"line":442},[2068,2073,2077,2081,2086,2090,2094,2098,2102,2107,2111,2115,2119,2124,2128,2133,2137,2141,2145,2150,2154,2158,2163,2167],{"type":56,"tag":382,"props":2069,"children":2070},{"style":1884},[2071],{"type":62,"value":2072},"  auth",{"type":56,"tag":382,"props":2074,"children":2075},{"style":411},[2076],{"type":62,"value":1629},{"type":56,"tag":382,"props":2078,"children":2079},{"style":411},[2080],{"type":62,"value":1975},{"type":56,"tag":382,"props":2082,"children":2083},{"style":1884},[2084],{"type":62,"value":2085}," jwtSecret",{"type":56,"tag":382,"props":2087,"children":2088},{"style":411},[2089],{"type":62,"value":1629},{"type":56,"tag":382,"props":2091,"children":2092},{"style":399},[2093],{"type":62,"value":1989},{"type":56,"tag":382,"props":2095,"children":2096},{"style":531},[2097],{"type":62,"value":1994},{"type":56,"tag":382,"props":2099,"children":2100},{"style":411},[2101],{"type":62,"value":1940},{"type":56,"tag":382,"props":2103,"children":2104},{"style":405},[2105],{"type":62,"value":2106},"JWT_SECRET",{"type":56,"tag":382,"props":2108,"children":2109},{"style":411},[2110],{"type":62,"value":1940},{"type":56,"tag":382,"props":2112,"children":2113},{"style":531},[2114],{"type":62,"value":782},{"type":56,"tag":382,"props":2116,"children":2117},{"style":411},[2118],{"type":62,"value":1639},{"type":56,"tag":382,"props":2120,"children":2121},{"style":1884},[2122],{"type":62,"value":2123}," expiresIn",{"type":56,"tag":382,"props":2125,"children":2126},{"style":411},[2127],{"type":62,"value":1629},{"type":56,"tag":382,"props":2129,"children":2130},{"style":531},[2131],{"type":62,"value":2132}," process",{"type":56,"tag":382,"props":2134,"children":2135},{"style":411},[2136],{"type":62,"value":1906},{"type":56,"tag":382,"props":2138,"children":2139},{"style":531},[2140],{"type":62,"value":1911},{"type":56,"tag":382,"props":2142,"children":2143},{"style":411},[2144],{"type":62,"value":1906},{"type":56,"tag":382,"props":2146,"children":2147},{"style":531},[2148],{"type":62,"value":2149},"JWT_EXPIRES_IN ",{"type":56,"tag":382,"props":2151,"children":2152},{"style":411},[2153],{"type":62,"value":1925},{"type":56,"tag":382,"props":2155,"children":2156},{"style":411},[2157],{"type":62,"value":1930},{"type":56,"tag":382,"props":2159,"children":2160},{"style":405},[2161],{"type":62,"value":2162},"1h",{"type":56,"tag":382,"props":2164,"children":2165},{"style":411},[2166],{"type":62,"value":1940},{"type":56,"tag":382,"props":2168,"children":2169},{"style":411},[2170],{"type":62,"value":2171}," },\n",{"type":56,"tag":382,"props":2173,"children":2174},{"class":384,"line":1677},[2175,2180,2186,2191],{"type":56,"tag":382,"props":2176,"children":2177},{"style":411},[2178],{"type":62,"value":2179},"}",{"type":56,"tag":382,"props":2181,"children":2183},{"style":2182},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[2184],{"type":62,"value":2185}," as",{"type":56,"tag":382,"props":2187,"children":2188},{"style":1579},[2189],{"type":62,"value":2190}," const",{"type":56,"tag":382,"props":2192,"children":2193},{"style":411},[2194],{"type":62,"value":2195},";\n",{"type":56,"tag":382,"props":2197,"children":2198},{"class":384,"line":1691},[2199],{"type":56,"tag":382,"props":2200,"children":2201},{"emptyLinePlaceholder":724},[2202],{"type":62,"value":1802},{"type":56,"tag":382,"props":2204,"children":2205},{"class":384,"line":1813},[2206,2211,2215,2219,2224,2228,2233,2238,2242],{"type":56,"tag":382,"props":2207,"children":2208},{"style":1579},[2209],{"type":62,"value":2210},"function",{"type":56,"tag":382,"props":2212,"children":2213},{"style":399},[2214],{"type":62,"value":1989},{"type":56,"tag":382,"props":2216,"children":2217},{"style":411},[2218],{"type":62,"value":1994},{"type":56,"tag":382,"props":2220,"children":2221},{"style":1621},[2222],{"type":62,"value":2223},"name",{"type":56,"tag":382,"props":2225,"children":2226},{"style":411},[2227],{"type":62,"value":1629},{"type":56,"tag":382,"props":2229,"children":2230},{"style":417},[2231],{"type":62,"value":2232}," string",{"type":56,"tag":382,"props":2234,"children":2235},{"style":411},[2236],{"type":62,"value":2237},"):",{"type":56,"tag":382,"props":2239,"children":2240},{"style":417},[2241],{"type":62,"value":2232},{"type":56,"tag":382,"props":2243,"children":2244},{"style":411},[2245],{"type":62,"value":1592},{"type":56,"tag":382,"props":2247,"children":2248},{"class":384,"line":1822},[2249,2254,2259,2264,2268,2272,2276,2281,2285,2290],{"type":56,"tag":382,"props":2250,"children":2251},{"style":1579},[2252],{"type":62,"value":2253},"  const",{"type":56,"tag":382,"props":2255,"children":2256},{"style":531},[2257],{"type":62,"value":2258}," value",{"type":56,"tag":382,"props":2260,"children":2261},{"style":411},[2262],{"type":62,"value":2263}," =",{"type":56,"tag":382,"props":2265,"children":2266},{"style":531},[2267],{"type":62,"value":2132},{"type":56,"tag":382,"props":2269,"children":2270},{"style":411},[2271],{"type":62,"value":1906},{"type":56,"tag":382,"props":2273,"children":2274},{"style":531},[2275],{"type":62,"value":1911},{"type":56,"tag":382,"props":2277,"children":2278},{"style":1884},[2279],{"type":62,"value":2280},"[",{"type":56,"tag":382,"props":2282,"children":2283},{"style":531},[2284],{"type":62,"value":2223},{"type":56,"tag":382,"props":2286,"children":2287},{"style":1884},[2288],{"type":62,"value":2289},"]",{"type":56,"tag":382,"props":2291,"children":2292},{"style":411},[2293],{"type":62,"value":2195},{"type":56,"tag":382,"props":2295,"children":2297},{"class":384,"line":2296},9,[2298,2303,2308,2313,2318,2322,2327,2332,2337,2341,2346,2351,2356,2360,2365,2369,2374],{"type":56,"tag":382,"props":2299,"children":2300},{"style":2182},[2301],{"type":62,"value":2302},"  if",{"type":56,"tag":382,"props":2304,"children":2305},{"style":1884},[2306],{"type":62,"value":2307}," (",{"type":56,"tag":382,"props":2309,"children":2310},{"style":411},[2311],{"type":62,"value":2312},"!",{"type":56,"tag":382,"props":2314,"children":2315},{"style":531},[2316],{"type":62,"value":2317},"value",{"type":56,"tag":382,"props":2319,"children":2320},{"style":1884},[2321],{"type":62,"value":2059},{"type":56,"tag":382,"props":2323,"children":2324},{"style":2182},[2325],{"type":62,"value":2326},"throw",{"type":56,"tag":382,"props":2328,"children":2329},{"style":411},[2330],{"type":62,"value":2331}," new",{"type":56,"tag":382,"props":2333,"children":2334},{"style":399},[2335],{"type":62,"value":2336}," Error",{"type":56,"tag":382,"props":2338,"children":2339},{"style":1884},[2340],{"type":62,"value":1994},{"type":56,"tag":382,"props":2342,"children":2343},{"style":411},[2344],{"type":62,"value":2345},"`",{"type":56,"tag":382,"props":2347,"children":2348},{"style":405},[2349],{"type":62,"value":2350},"Missing required env var: ",{"type":56,"tag":382,"props":2352,"children":2353},{"style":411},[2354],{"type":62,"value":2355},"${",{"type":56,"tag":382,"props":2357,"children":2358},{"style":531},[2359],{"type":62,"value":2223},{"type":56,"tag":382,"props":2361,"children":2362},{"style":411},[2363],{"type":62,"value":2364},"}`",{"type":56,"tag":382,"props":2366,"children":2367},{"style":1884},[2368],{"type":62,"value":782},{"type":56,"tag":382,"props":2370,"children":2371},{"style":411},[2372],{"type":62,"value":2373},";",{"type":56,"tag":382,"props":2375,"children":2376},{"style":389},[2377],{"type":62,"value":2378},"  \u002F\u002F fail fast\n",{"type":56,"tag":382,"props":2380,"children":2382},{"class":384,"line":2381},10,[2383,2388,2392],{"type":56,"tag":382,"props":2384,"children":2385},{"style":2182},[2386],{"type":62,"value":2387},"  return",{"type":56,"tag":382,"props":2389,"children":2390},{"style":531},[2391],{"type":62,"value":2258},{"type":56,"tag":382,"props":2393,"children":2394},{"style":411},[2395],{"type":62,"value":2195},{"type":56,"tag":382,"props":2397,"children":2399},{"class":384,"line":2398},11,[2400],{"type":56,"tag":382,"props":2401,"children":2402},{"style":411},[2403],{"type":62,"value":1697},{"type":56,"tag":72,"props":2405,"children":2406},{},[2407],{"type":56,"tag":76,"props":2408,"children":2409},{},[2410],{"type":62,"value":1705},{"type":56,"tag":370,"props":2412,"children":2414},{"className":1708,"code":2413,"language":1710,"meta":375,"style":375},"from pydantic_settings import BaseSettings\n\nclass Settings(BaseSettings):\n    database_url: str                        # required — app won't start without it\n    jwt_secret: str                          # required\n    port: int = 3000                         # optional with default\n    db_pool_size: int = 10\n    class Config:\n        env_file = \".env\"\n\nsettings = Settings()                        # fails fast if DATABASE_URL missing\n",[2415],{"type":56,"tag":378,"props":2416,"children":2417},{"__ignoreMap":375},[2418,2426,2433,2441,2449,2457,2465,2473,2481,2489,2496],{"type":56,"tag":382,"props":2419,"children":2420},{"class":384,"line":385},[2421],{"type":56,"tag":382,"props":2422,"children":2423},{},[2424],{"type":62,"value":2425},"from pydantic_settings import BaseSettings\n",{"type":56,"tag":382,"props":2427,"children":2428},{"class":384,"line":395},[2429],{"type":56,"tag":382,"props":2430,"children":2431},{"emptyLinePlaceholder":724},[2432],{"type":62,"value":1802},{"type":56,"tag":382,"props":2434,"children":2435},{"class":384,"line":433},[2436],{"type":56,"tag":382,"props":2437,"children":2438},{},[2439],{"type":62,"value":2440},"class Settings(BaseSettings):\n",{"type":56,"tag":382,"props":2442,"children":2443},{"class":384,"line":442},[2444],{"type":56,"tag":382,"props":2445,"children":2446},{},[2447],{"type":62,"value":2448},"    database_url: str                        # required — app won't start without it\n",{"type":56,"tag":382,"props":2450,"children":2451},{"class":384,"line":1677},[2452],{"type":56,"tag":382,"props":2453,"children":2454},{},[2455],{"type":62,"value":2456},"    jwt_secret: str                          # required\n",{"type":56,"tag":382,"props":2458,"children":2459},{"class":384,"line":1691},[2460],{"type":56,"tag":382,"props":2461,"children":2462},{},[2463],{"type":62,"value":2464},"    port: int = 3000                         # optional with default\n",{"type":56,"tag":382,"props":2466,"children":2467},{"class":384,"line":1813},[2468],{"type":56,"tag":382,"props":2469,"children":2470},{},[2471],{"type":62,"value":2472},"    db_pool_size: int = 10\n",{"type":56,"tag":382,"props":2474,"children":2475},{"class":384,"line":1822},[2476],{"type":56,"tag":382,"props":2477,"children":2478},{},[2479],{"type":62,"value":2480},"    class Config:\n",{"type":56,"tag":382,"props":2482,"children":2483},{"class":384,"line":2296},[2484],{"type":56,"tag":382,"props":2485,"children":2486},{},[2487],{"type":62,"value":2488},"        env_file = \".env\"\n",{"type":56,"tag":382,"props":2490,"children":2491},{"class":384,"line":2381},[2492],{"type":56,"tag":382,"props":2493,"children":2494},{"emptyLinePlaceholder":724},[2495],{"type":62,"value":1802},{"type":56,"tag":382,"props":2497,"children":2498},{"class":384,"line":2398},[2499],{"type":56,"tag":382,"props":2500,"children":2501},{},[2502],{"type":62,"value":2503},"settings = Settings()                        # fails fast if DATABASE_URL missing\n",{"type":56,"tag":82,"props":2505,"children":2507},{"id":2506},"rules",[2508],{"type":62,"value":2509},"Rules",{"type":56,"tag":370,"props":2511,"children":2514},{"className":2512,"code":2513,"language":62},[1424],"✅ All config via environment variables (Twelve-Factor)\n✅ Validate required vars at startup — fail fast\n✅ Type-cast at config layer, not at usage sites\n✅ Commit .env.example with dummy values\n\n❌ Never hardcode secrets, URLs, or credentials\n❌ Never commit .env files\n❌ Never scatter process.env \u002F os.environ throughout code\n",[2515],{"type":56,"tag":378,"props":2516,"children":2517},{"__ignoreMap":375},[2518],{"type":62,"value":2513},{"type":56,"tag":621,"props":2520,"children":2521},{},[],{"type":56,"tag":65,"props":2523,"children":2525},{"id":2524},"_3-error-handling-resilience-high",[2526],{"type":62,"value":2527},"3. Error Handling & Resilience (HIGH)",{"type":56,"tag":82,"props":2529,"children":2531},{"id":2530},"typed-error-hierarchy",[2532],{"type":62,"value":2533},"Typed Error Hierarchy",{"type":56,"tag":370,"props":2535,"children":2537},{"className":1567,"code":2536,"language":1569,"meta":375,"style":375},"\u002F\u002F Base (TypeScript)\nclass AppError extends Error {\n  constructor(\n    message: string,\n    public readonly code: string,\n    public readonly statusCode: number,\n    public readonly isOperational: boolean = true,\n  ) { super(message); }\n}\nclass NotFoundError extends AppError {\n  constructor(resource: string, id: string) {\n    super(`${resource} not found: ${id}`, 'NOT_FOUND', 404);\n  }\n}\nclass ValidationError extends AppError {\n  constructor(public readonly errors: FieldError[]) {\n    super('Validation failed', 'VALIDATION_ERROR', 422);\n  }\n}\n",[2538],{"type":56,"tag":378,"props":2539,"children":2540},{"__ignoreMap":375},[2541,2549,2574,2585,2605,2634,2663,2702,2740,2747,2771,2820,2898,2907,2915,2940,2988,3047,3055],{"type":56,"tag":382,"props":2542,"children":2543},{"class":384,"line":385},[2544],{"type":56,"tag":382,"props":2545,"children":2546},{"style":389},[2547],{"type":62,"value":2548},"\u002F\u002F Base (TypeScript)\n",{"type":56,"tag":382,"props":2550,"children":2551},{"class":384,"line":395},[2552,2556,2561,2566,2570],{"type":56,"tag":382,"props":2553,"children":2554},{"style":1579},[2555],{"type":62,"value":1582},{"type":56,"tag":382,"props":2557,"children":2558},{"style":417},[2559],{"type":62,"value":2560}," AppError",{"type":56,"tag":382,"props":2562,"children":2563},{"style":1579},[2564],{"type":62,"value":2565}," extends",{"type":56,"tag":382,"props":2567,"children":2568},{"style":417},[2569],{"type":62,"value":2336},{"type":56,"tag":382,"props":2571,"children":2572},{"style":411},[2573],{"type":62,"value":1592},{"type":56,"tag":382,"props":2575,"children":2576},{"class":384,"line":433},[2577,2581],{"type":56,"tag":382,"props":2578,"children":2579},{"style":1579},[2580],{"type":62,"value":1600},{"type":56,"tag":382,"props":2582,"children":2583},{"style":411},[2584],{"type":62,"value":1605},{"type":56,"tag":382,"props":2586,"children":2587},{"class":384,"line":442},[2588,2593,2597,2601],{"type":56,"tag":382,"props":2589,"children":2590},{"style":1621},[2591],{"type":62,"value":2592},"    message",{"type":56,"tag":382,"props":2594,"children":2595},{"style":411},[2596],{"type":62,"value":1629},{"type":56,"tag":382,"props":2598,"children":2599},{"style":417},[2600],{"type":62,"value":2232},{"type":56,"tag":382,"props":2602,"children":2603},{"style":411},[2604],{"type":62,"value":1674},{"type":56,"tag":382,"props":2606,"children":2607},{"class":384,"line":1677},[2608,2613,2617,2622,2626,2630],{"type":56,"tag":382,"props":2609,"children":2610},{"style":1579},[2611],{"type":62,"value":2612},"    public",{"type":56,"tag":382,"props":2614,"children":2615},{"style":1579},[2616],{"type":62,"value":1618},{"type":56,"tag":382,"props":2618,"children":2619},{"style":1621},[2620],{"type":62,"value":2621}," code",{"type":56,"tag":382,"props":2623,"children":2624},{"style":411},[2625],{"type":62,"value":1629},{"type":56,"tag":382,"props":2627,"children":2628},{"style":417},[2629],{"type":62,"value":2232},{"type":56,"tag":382,"props":2631,"children":2632},{"style":411},[2633],{"type":62,"value":1674},{"type":56,"tag":382,"props":2635,"children":2636},{"class":384,"line":1691},[2637,2641,2645,2650,2654,2659],{"type":56,"tag":382,"props":2638,"children":2639},{"style":1579},[2640],{"type":62,"value":2612},{"type":56,"tag":382,"props":2642,"children":2643},{"style":1579},[2644],{"type":62,"value":1618},{"type":56,"tag":382,"props":2646,"children":2647},{"style":1621},[2648],{"type":62,"value":2649}," statusCode",{"type":56,"tag":382,"props":2651,"children":2652},{"style":411},[2653],{"type":62,"value":1629},{"type":56,"tag":382,"props":2655,"children":2656},{"style":417},[2657],{"type":62,"value":2658}," number",{"type":56,"tag":382,"props":2660,"children":2661},{"style":411},[2662],{"type":62,"value":1674},{"type":56,"tag":382,"props":2664,"children":2665},{"class":384,"line":1813},[2666,2670,2674,2679,2683,2688,2692,2698],{"type":56,"tag":382,"props":2667,"children":2668},{"style":1579},[2669],{"type":62,"value":2612},{"type":56,"tag":382,"props":2671,"children":2672},{"style":1579},[2673],{"type":62,"value":1618},{"type":56,"tag":382,"props":2675,"children":2676},{"style":1621},[2677],{"type":62,"value":2678}," isOperational",{"type":56,"tag":382,"props":2680,"children":2681},{"style":411},[2682],{"type":62,"value":1629},{"type":56,"tag":382,"props":2684,"children":2685},{"style":417},[2686],{"type":62,"value":2687}," boolean",{"type":56,"tag":382,"props":2689,"children":2690},{"style":411},[2691],{"type":62,"value":2263},{"type":56,"tag":382,"props":2693,"children":2695},{"style":2694},"--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC",[2696],{"type":62,"value":2697}," true",{"type":56,"tag":382,"props":2699,"children":2700},{"style":411},[2701],{"type":62,"value":1674},{"type":56,"tag":382,"props":2703,"children":2704},{"class":384,"line":1822},[2705,2709,2713,2718,2722,2727,2731,2735],{"type":56,"tag":382,"props":2706,"children":2707},{"style":411},[2708],{"type":62,"value":1683},{"type":56,"tag":382,"props":2710,"children":2711},{"style":411},[2712],{"type":62,"value":1975},{"type":56,"tag":382,"props":2714,"children":2715},{"style":531},[2716],{"type":62,"value":2717}," super",{"type":56,"tag":382,"props":2719,"children":2720},{"style":1884},[2721],{"type":62,"value":1994},{"type":56,"tag":382,"props":2723,"children":2724},{"style":531},[2725],{"type":62,"value":2726},"message",{"type":56,"tag":382,"props":2728,"children":2729},{"style":1884},[2730],{"type":62,"value":782},{"type":56,"tag":382,"props":2732,"children":2733},{"style":411},[2734],{"type":62,"value":2373},{"type":56,"tag":382,"props":2736,"children":2737},{"style":411},[2738],{"type":62,"value":2739}," }\n",{"type":56,"tag":382,"props":2741,"children":2742},{"class":384,"line":2296},[2743],{"type":56,"tag":382,"props":2744,"children":2745},{"style":411},[2746],{"type":62,"value":1697},{"type":56,"tag":382,"props":2748,"children":2749},{"class":384,"line":2381},[2750,2754,2759,2763,2767],{"type":56,"tag":382,"props":2751,"children":2752},{"style":1579},[2753],{"type":62,"value":1582},{"type":56,"tag":382,"props":2755,"children":2756},{"style":417},[2757],{"type":62,"value":2758}," NotFoundError",{"type":56,"tag":382,"props":2760,"children":2761},{"style":1579},[2762],{"type":62,"value":2565},{"type":56,"tag":382,"props":2764,"children":2765},{"style":417},[2766],{"type":62,"value":2560},{"type":56,"tag":382,"props":2768,"children":2769},{"style":411},[2770],{"type":62,"value":1592},{"type":56,"tag":382,"props":2772,"children":2773},{"class":384,"line":2398},[2774,2778,2782,2787,2791,2795,2799,2804,2808,2812,2816],{"type":56,"tag":382,"props":2775,"children":2776},{"style":1579},[2777],{"type":62,"value":1600},{"type":56,"tag":382,"props":2779,"children":2780},{"style":411},[2781],{"type":62,"value":1994},{"type":56,"tag":382,"props":2783,"children":2784},{"style":1621},[2785],{"type":62,"value":2786},"resource",{"type":56,"tag":382,"props":2788,"children":2789},{"style":411},[2790],{"type":62,"value":1629},{"type":56,"tag":382,"props":2792,"children":2793},{"style":417},[2794],{"type":62,"value":2232},{"type":56,"tag":382,"props":2796,"children":2797},{"style":411},[2798],{"type":62,"value":1639},{"type":56,"tag":382,"props":2800,"children":2801},{"style":1621},[2802],{"type":62,"value":2803}," id",{"type":56,"tag":382,"props":2805,"children":2806},{"style":411},[2807],{"type":62,"value":1629},{"type":56,"tag":382,"props":2809,"children":2810},{"style":417},[2811],{"type":62,"value":2232},{"type":56,"tag":382,"props":2813,"children":2814},{"style":411},[2815],{"type":62,"value":782},{"type":56,"tag":382,"props":2817,"children":2818},{"style":411},[2819],{"type":62,"value":1592},{"type":56,"tag":382,"props":2821,"children":2823},{"class":384,"line":2822},12,[2824,2829,2833,2838,2842,2846,2851,2855,2860,2864,2868,2872,2877,2881,2885,2890,2894],{"type":56,"tag":382,"props":2825,"children":2826},{"style":531},[2827],{"type":62,"value":2828},"    super",{"type":56,"tag":382,"props":2830,"children":2831},{"style":1884},[2832],{"type":62,"value":1994},{"type":56,"tag":382,"props":2834,"children":2835},{"style":411},[2836],{"type":62,"value":2837},"`${",{"type":56,"tag":382,"props":2839,"children":2840},{"style":531},[2841],{"type":62,"value":2786},{"type":56,"tag":382,"props":2843,"children":2844},{"style":411},[2845],{"type":62,"value":2179},{"type":56,"tag":382,"props":2847,"children":2848},{"style":405},[2849],{"type":62,"value":2850}," not found: ",{"type":56,"tag":382,"props":2852,"children":2853},{"style":411},[2854],{"type":62,"value":2355},{"type":56,"tag":382,"props":2856,"children":2857},{"style":531},[2858],{"type":62,"value":2859},"id",{"type":56,"tag":382,"props":2861,"children":2862},{"style":411},[2863],{"type":62,"value":2364},{"type":56,"tag":382,"props":2865,"children":2866},{"style":411},[2867],{"type":62,"value":1639},{"type":56,"tag":382,"props":2869,"children":2870},{"style":411},[2871],{"type":62,"value":1930},{"type":56,"tag":382,"props":2873,"children":2874},{"style":405},[2875],{"type":62,"value":2876},"NOT_FOUND",{"type":56,"tag":382,"props":2878,"children":2879},{"style":411},[2880],{"type":62,"value":1940},{"type":56,"tag":382,"props":2882,"children":2883},{"style":411},[2884],{"type":62,"value":1639},{"type":56,"tag":382,"props":2886,"children":2887},{"style":1947},[2888],{"type":62,"value":2889}," 404",{"type":56,"tag":382,"props":2891,"children":2892},{"style":1884},[2893],{"type":62,"value":782},{"type":56,"tag":382,"props":2895,"children":2896},{"style":411},[2897],{"type":62,"value":2195},{"type":56,"tag":382,"props":2899,"children":2901},{"class":384,"line":2900},13,[2902],{"type":56,"tag":382,"props":2903,"children":2904},{"style":411},[2905],{"type":62,"value":2906},"  }\n",{"type":56,"tag":382,"props":2908,"children":2910},{"class":384,"line":2909},14,[2911],{"type":56,"tag":382,"props":2912,"children":2913},{"style":411},[2914],{"type":62,"value":1697},{"type":56,"tag":382,"props":2916,"children":2918},{"class":384,"line":2917},15,[2919,2923,2928,2932,2936],{"type":56,"tag":382,"props":2920,"children":2921},{"style":1579},[2922],{"type":62,"value":1582},{"type":56,"tag":382,"props":2924,"children":2925},{"style":417},[2926],{"type":62,"value":2927}," ValidationError",{"type":56,"tag":382,"props":2929,"children":2930},{"style":1579},[2931],{"type":62,"value":2565},{"type":56,"tag":382,"props":2933,"children":2934},{"style":417},[2935],{"type":62,"value":2560},{"type":56,"tag":382,"props":2937,"children":2938},{"style":411},[2939],{"type":62,"value":1592},{"type":56,"tag":382,"props":2941,"children":2943},{"class":384,"line":2942},16,[2944,2948,2952,2957,2961,2966,2970,2975,2980,2984],{"type":56,"tag":382,"props":2945,"children":2946},{"style":1579},[2947],{"type":62,"value":1600},{"type":56,"tag":382,"props":2949,"children":2950},{"style":411},[2951],{"type":62,"value":1994},{"type":56,"tag":382,"props":2953,"children":2954},{"style":1579},[2955],{"type":62,"value":2956},"public",{"type":56,"tag":382,"props":2958,"children":2959},{"style":1579},[2960],{"type":62,"value":1618},{"type":56,"tag":382,"props":2962,"children":2963},{"style":1621},[2964],{"type":62,"value":2965}," errors",{"type":56,"tag":382,"props":2967,"children":2968},{"style":411},[2969],{"type":62,"value":1629},{"type":56,"tag":382,"props":2971,"children":2972},{"style":417},[2973],{"type":62,"value":2974}," FieldError",{"type":56,"tag":382,"props":2976,"children":2977},{"style":531},[2978],{"type":62,"value":2979},"[]",{"type":56,"tag":382,"props":2981,"children":2982},{"style":411},[2983],{"type":62,"value":782},{"type":56,"tag":382,"props":2985,"children":2986},{"style":411},[2987],{"type":62,"value":1592},{"type":56,"tag":382,"props":2989,"children":2991},{"class":384,"line":2990},17,[2992,2996,3000,3004,3009,3013,3017,3021,3026,3030,3034,3039,3043],{"type":56,"tag":382,"props":2993,"children":2994},{"style":531},[2995],{"type":62,"value":2828},{"type":56,"tag":382,"props":2997,"children":2998},{"style":1884},[2999],{"type":62,"value":1994},{"type":56,"tag":382,"props":3001,"children":3002},{"style":411},[3003],{"type":62,"value":1940},{"type":56,"tag":382,"props":3005,"children":3006},{"style":405},[3007],{"type":62,"value":3008},"Validation failed",{"type":56,"tag":382,"props":3010,"children":3011},{"style":411},[3012],{"type":62,"value":1940},{"type":56,"tag":382,"props":3014,"children":3015},{"style":411},[3016],{"type":62,"value":1639},{"type":56,"tag":382,"props":3018,"children":3019},{"style":411},[3020],{"type":62,"value":1930},{"type":56,"tag":382,"props":3022,"children":3023},{"style":405},[3024],{"type":62,"value":3025},"VALIDATION_ERROR",{"type":56,"tag":382,"props":3027,"children":3028},{"style":411},[3029],{"type":62,"value":1940},{"type":56,"tag":382,"props":3031,"children":3032},{"style":411},[3033],{"type":62,"value":1639},{"type":56,"tag":382,"props":3035,"children":3036},{"style":1947},[3037],{"type":62,"value":3038}," 422",{"type":56,"tag":382,"props":3040,"children":3041},{"style":1884},[3042],{"type":62,"value":782},{"type":56,"tag":382,"props":3044,"children":3045},{"style":411},[3046],{"type":62,"value":2195},{"type":56,"tag":382,"props":3048,"children":3050},{"class":384,"line":3049},18,[3051],{"type":56,"tag":382,"props":3052,"children":3053},{"style":411},[3054],{"type":62,"value":2906},{"type":56,"tag":382,"props":3056,"children":3058},{"class":384,"line":3057},19,[3059],{"type":56,"tag":382,"props":3060,"children":3061},{"style":411},[3062],{"type":62,"value":1697},{"type":56,"tag":370,"props":3064,"children":3066},{"className":1708,"code":3065,"language":1710,"meta":375,"style":375},"# Base (Python)\nclass AppError(Exception):\n    def __init__(self, message: str, code: str, status_code: int):\n        self.message, self.code, self.status_code = message, code, status_code\n\nclass NotFoundError(AppError):\n    def __init__(self, resource: str, id: str):\n        super().__init__(f\"{resource} not found: {id}\", \"NOT_FOUND\", 404)\n",[3067],{"type":56,"tag":378,"props":3068,"children":3069},{"__ignoreMap":375},[3070,3078,3086,3094,3102,3109,3117,3125],{"type":56,"tag":382,"props":3071,"children":3072},{"class":384,"line":385},[3073],{"type":56,"tag":382,"props":3074,"children":3075},{},[3076],{"type":62,"value":3077},"# Base (Python)\n",{"type":56,"tag":382,"props":3079,"children":3080},{"class":384,"line":395},[3081],{"type":56,"tag":382,"props":3082,"children":3083},{},[3084],{"type":62,"value":3085},"class AppError(Exception):\n",{"type":56,"tag":382,"props":3087,"children":3088},{"class":384,"line":433},[3089],{"type":56,"tag":382,"props":3090,"children":3091},{},[3092],{"type":62,"value":3093},"    def __init__(self, message: str, code: str, status_code: int):\n",{"type":56,"tag":382,"props":3095,"children":3096},{"class":384,"line":442},[3097],{"type":56,"tag":382,"props":3098,"children":3099},{},[3100],{"type":62,"value":3101},"        self.message, self.code, self.status_code = message, code, status_code\n",{"type":56,"tag":382,"props":3103,"children":3104},{"class":384,"line":1677},[3105],{"type":56,"tag":382,"props":3106,"children":3107},{"emptyLinePlaceholder":724},[3108],{"type":62,"value":1802},{"type":56,"tag":382,"props":3110,"children":3111},{"class":384,"line":1691},[3112],{"type":56,"tag":382,"props":3113,"children":3114},{},[3115],{"type":62,"value":3116},"class NotFoundError(AppError):\n",{"type":56,"tag":382,"props":3118,"children":3119},{"class":384,"line":1813},[3120],{"type":56,"tag":382,"props":3121,"children":3122},{},[3123],{"type":62,"value":3124},"    def __init__(self, resource: str, id: str):\n",{"type":56,"tag":382,"props":3126,"children":3127},{"class":384,"line":1822},[3128],{"type":56,"tag":382,"props":3129,"children":3130},{},[3131],{"type":62,"value":3132},"        super().__init__(f\"{resource} not found: {id}\", \"NOT_FOUND\", 404)\n",{"type":56,"tag":82,"props":3134,"children":3136},{"id":3135},"global-error-handler",[3137],{"type":62,"value":3138},"Global Error Handler",{"type":56,"tag":370,"props":3140,"children":3142},{"className":1567,"code":3141,"language":1569,"meta":375,"style":375},"\u002F\u002F TypeScript (Express)\napp.use((err, req, res, next) => {\n  if (err instanceof AppError && err.isOperational) {\n    return res.status(err.statusCode).json({\n      title: err.code, status: err.statusCode,\n      detail: err.message, request_id: req.id,\n    });\n  }\n  logger.error('Unexpected error', { error: err.message, stack: err.stack, request_id: req.id });\n  res.status(500).json({ title: 'Internal Error', status: 500, request_id: req.id });\n});\n",[3143],{"type":56,"tag":378,"props":3144,"children":3145},{"__ignoreMap":375},[3146,3154,3224,3275,3334,3387,3440,3456,3463,3589,3710],{"type":56,"tag":382,"props":3147,"children":3148},{"class":384,"line":385},[3149],{"type":56,"tag":382,"props":3150,"children":3151},{"style":389},[3152],{"type":62,"value":3153},"\u002F\u002F TypeScript (Express)\n",{"type":56,"tag":382,"props":3155,"children":3156},{"class":384,"line":395},[3157,3162,3166,3171,3175,3179,3184,3188,3193,3197,3202,3206,3211,3215,3220],{"type":56,"tag":382,"props":3158,"children":3159},{"style":531},[3160],{"type":62,"value":3161},"app",{"type":56,"tag":382,"props":3163,"children":3164},{"style":411},[3165],{"type":62,"value":1906},{"type":56,"tag":382,"props":3167,"children":3168},{"style":399},[3169],{"type":62,"value":3170},"use",{"type":56,"tag":382,"props":3172,"children":3173},{"style":531},[3174],{"type":62,"value":1994},{"type":56,"tag":382,"props":3176,"children":3177},{"style":411},[3178],{"type":62,"value":1994},{"type":56,"tag":382,"props":3180,"children":3181},{"style":1621},[3182],{"type":62,"value":3183},"err",{"type":56,"tag":382,"props":3185,"children":3186},{"style":411},[3187],{"type":62,"value":1639},{"type":56,"tag":382,"props":3189,"children":3190},{"style":1621},[3191],{"type":62,"value":3192}," req",{"type":56,"tag":382,"props":3194,"children":3195},{"style":411},[3196],{"type":62,"value":1639},{"type":56,"tag":382,"props":3198,"children":3199},{"style":1621},[3200],{"type":62,"value":3201}," res",{"type":56,"tag":382,"props":3203,"children":3204},{"style":411},[3205],{"type":62,"value":1639},{"type":56,"tag":382,"props":3207,"children":3208},{"style":1621},[3209],{"type":62,"value":3210}," next",{"type":56,"tag":382,"props":3212,"children":3213},{"style":411},[3214],{"type":62,"value":782},{"type":56,"tag":382,"props":3216,"children":3217},{"style":1579},[3218],{"type":62,"value":3219}," =>",{"type":56,"tag":382,"props":3221,"children":3222},{"style":411},[3223],{"type":62,"value":1592},{"type":56,"tag":382,"props":3225,"children":3226},{"class":384,"line":433},[3227,3231,3235,3239,3244,3248,3252,3257,3261,3266,3270],{"type":56,"tag":382,"props":3228,"children":3229},{"style":2182},[3230],{"type":62,"value":2302},{"type":56,"tag":382,"props":3232,"children":3233},{"style":1884},[3234],{"type":62,"value":2307},{"type":56,"tag":382,"props":3236,"children":3237},{"style":531},[3238],{"type":62,"value":3183},{"type":56,"tag":382,"props":3240,"children":3241},{"style":411},[3242],{"type":62,"value":3243}," instanceof",{"type":56,"tag":382,"props":3245,"children":3246},{"style":417},[3247],{"type":62,"value":2560},{"type":56,"tag":382,"props":3249,"children":3250},{"style":411},[3251],{"type":62,"value":414},{"type":56,"tag":382,"props":3253,"children":3254},{"style":531},[3255],{"type":62,"value":3256}," err",{"type":56,"tag":382,"props":3258,"children":3259},{"style":411},[3260],{"type":62,"value":1906},{"type":56,"tag":382,"props":3262,"children":3263},{"style":531},[3264],{"type":62,"value":3265},"isOperational",{"type":56,"tag":382,"props":3267,"children":3268},{"style":1884},[3269],{"type":62,"value":2059},{"type":56,"tag":382,"props":3271,"children":3272},{"style":411},[3273],{"type":62,"value":3274},"{\n",{"type":56,"tag":382,"props":3276,"children":3277},{"class":384,"line":442},[3278,3283,3287,3291,3296,3300,3304,3308,3313,3317,3321,3326,3330],{"type":56,"tag":382,"props":3279,"children":3280},{"style":2182},[3281],{"type":62,"value":3282},"    return",{"type":56,"tag":382,"props":3284,"children":3285},{"style":531},[3286],{"type":62,"value":3201},{"type":56,"tag":382,"props":3288,"children":3289},{"style":411},[3290],{"type":62,"value":1906},{"type":56,"tag":382,"props":3292,"children":3293},{"style":399},[3294],{"type":62,"value":3295},"status",{"type":56,"tag":382,"props":3297,"children":3298},{"style":1884},[3299],{"type":62,"value":1994},{"type":56,"tag":382,"props":3301,"children":3302},{"style":531},[3303],{"type":62,"value":3183},{"type":56,"tag":382,"props":3305,"children":3306},{"style":411},[3307],{"type":62,"value":1906},{"type":56,"tag":382,"props":3309,"children":3310},{"style":531},[3311],{"type":62,"value":3312},"statusCode",{"type":56,"tag":382,"props":3314,"children":3315},{"style":1884},[3316],{"type":62,"value":782},{"type":56,"tag":382,"props":3318,"children":3319},{"style":411},[3320],{"type":62,"value":1906},{"type":56,"tag":382,"props":3322,"children":3323},{"style":399},[3324],{"type":62,"value":3325},"json",{"type":56,"tag":382,"props":3327,"children":3328},{"style":1884},[3329],{"type":62,"value":1994},{"type":56,"tag":382,"props":3331,"children":3332},{"style":411},[3333],{"type":62,"value":3274},{"type":56,"tag":382,"props":3335,"children":3336},{"class":384,"line":1677},[3337,3342,3346,3350,3354,3358,3362,3367,3371,3375,3379,3383],{"type":56,"tag":382,"props":3338,"children":3339},{"style":1884},[3340],{"type":62,"value":3341},"      title",{"type":56,"tag":382,"props":3343,"children":3344},{"style":411},[3345],{"type":62,"value":1629},{"type":56,"tag":382,"props":3347,"children":3348},{"style":531},[3349],{"type":62,"value":3256},{"type":56,"tag":382,"props":3351,"children":3352},{"style":411},[3353],{"type":62,"value":1906},{"type":56,"tag":382,"props":3355,"children":3356},{"style":531},[3357],{"type":62,"value":378},{"type":56,"tag":382,"props":3359,"children":3360},{"style":411},[3361],{"type":62,"value":1639},{"type":56,"tag":382,"props":3363,"children":3364},{"style":1884},[3365],{"type":62,"value":3366}," status",{"type":56,"tag":382,"props":3368,"children":3369},{"style":411},[3370],{"type":62,"value":1629},{"type":56,"tag":382,"props":3372,"children":3373},{"style":531},[3374],{"type":62,"value":3256},{"type":56,"tag":382,"props":3376,"children":3377},{"style":411},[3378],{"type":62,"value":1906},{"type":56,"tag":382,"props":3380,"children":3381},{"style":531},[3382],{"type":62,"value":3312},{"type":56,"tag":382,"props":3384,"children":3385},{"style":411},[3386],{"type":62,"value":1674},{"type":56,"tag":382,"props":3388,"children":3389},{"class":384,"line":1691},[3390,3395,3399,3403,3407,3411,3415,3420,3424,3428,3432,3436],{"type":56,"tag":382,"props":3391,"children":3392},{"style":1884},[3393],{"type":62,"value":3394},"      detail",{"type":56,"tag":382,"props":3396,"children":3397},{"style":411},[3398],{"type":62,"value":1629},{"type":56,"tag":382,"props":3400,"children":3401},{"style":531},[3402],{"type":62,"value":3256},{"type":56,"tag":382,"props":3404,"children":3405},{"style":411},[3406],{"type":62,"value":1906},{"type":56,"tag":382,"props":3408,"children":3409},{"style":531},[3410],{"type":62,"value":2726},{"type":56,"tag":382,"props":3412,"children":3413},{"style":411},[3414],{"type":62,"value":1639},{"type":56,"tag":382,"props":3416,"children":3417},{"style":1884},[3418],{"type":62,"value":3419}," request_id",{"type":56,"tag":382,"props":3421,"children":3422},{"style":411},[3423],{"type":62,"value":1629},{"type":56,"tag":382,"props":3425,"children":3426},{"style":531},[3427],{"type":62,"value":3192},{"type":56,"tag":382,"props":3429,"children":3430},{"style":411},[3431],{"type":62,"value":1906},{"type":56,"tag":382,"props":3433,"children":3434},{"style":531},[3435],{"type":62,"value":2859},{"type":56,"tag":382,"props":3437,"children":3438},{"style":411},[3439],{"type":62,"value":1674},{"type":56,"tag":382,"props":3441,"children":3442},{"class":384,"line":1813},[3443,3448,3452],{"type":56,"tag":382,"props":3444,"children":3445},{"style":411},[3446],{"type":62,"value":3447},"    }",{"type":56,"tag":382,"props":3449,"children":3450},{"style":1884},[3451],{"type":62,"value":782},{"type":56,"tag":382,"props":3453,"children":3454},{"style":411},[3455],{"type":62,"value":2195},{"type":56,"tag":382,"props":3457,"children":3458},{"class":384,"line":1822},[3459],{"type":56,"tag":382,"props":3460,"children":3461},{"style":411},[3462],{"type":62,"value":2906},{"type":56,"tag":382,"props":3464,"children":3465},{"class":384,"line":2296},[3466,3471,3475,3480,3484,3488,3493,3497,3501,3505,3510,3514,3518,3522,3526,3530,3535,3539,3543,3547,3552,3556,3560,3564,3568,3572,3576,3581,3585],{"type":56,"tag":382,"props":3467,"children":3468},{"style":531},[3469],{"type":62,"value":3470},"  logger",{"type":56,"tag":382,"props":3472,"children":3473},{"style":411},[3474],{"type":62,"value":1906},{"type":56,"tag":382,"props":3476,"children":3477},{"style":399},[3478],{"type":62,"value":3479},"error",{"type":56,"tag":382,"props":3481,"children":3482},{"style":1884},[3483],{"type":62,"value":1994},{"type":56,"tag":382,"props":3485,"children":3486},{"style":411},[3487],{"type":62,"value":1940},{"type":56,"tag":382,"props":3489,"children":3490},{"style":405},[3491],{"type":62,"value":3492},"Unexpected error",{"type":56,"tag":382,"props":3494,"children":3495},{"style":411},[3496],{"type":62,"value":1940},{"type":56,"tag":382,"props":3498,"children":3499},{"style":411},[3500],{"type":62,"value":1639},{"type":56,"tag":382,"props":3502,"children":3503},{"style":411},[3504],{"type":62,"value":1975},{"type":56,"tag":382,"props":3506,"children":3507},{"style":1884},[3508],{"type":62,"value":3509}," error",{"type":56,"tag":382,"props":3511,"children":3512},{"style":411},[3513],{"type":62,"value":1629},{"type":56,"tag":382,"props":3515,"children":3516},{"style":531},[3517],{"type":62,"value":3256},{"type":56,"tag":382,"props":3519,"children":3520},{"style":411},[3521],{"type":62,"value":1906},{"type":56,"tag":382,"props":3523,"children":3524},{"style":531},[3525],{"type":62,"value":2726},{"type":56,"tag":382,"props":3527,"children":3528},{"style":411},[3529],{"type":62,"value":1639},{"type":56,"tag":382,"props":3531,"children":3532},{"style":1884},[3533],{"type":62,"value":3534}," stack",{"type":56,"tag":382,"props":3536,"children":3537},{"style":411},[3538],{"type":62,"value":1629},{"type":56,"tag":382,"props":3540,"children":3541},{"style":531},[3542],{"type":62,"value":3256},{"type":56,"tag":382,"props":3544,"children":3545},{"style":411},[3546],{"type":62,"value":1906},{"type":56,"tag":382,"props":3548,"children":3549},{"style":531},[3550],{"type":62,"value":3551},"stack",{"type":56,"tag":382,"props":3553,"children":3554},{"style":411},[3555],{"type":62,"value":1639},{"type":56,"tag":382,"props":3557,"children":3558},{"style":1884},[3559],{"type":62,"value":3419},{"type":56,"tag":382,"props":3561,"children":3562},{"style":411},[3563],{"type":62,"value":1629},{"type":56,"tag":382,"props":3565,"children":3566},{"style":531},[3567],{"type":62,"value":3192},{"type":56,"tag":382,"props":3569,"children":3570},{"style":411},[3571],{"type":62,"value":1906},{"type":56,"tag":382,"props":3573,"children":3574},{"style":531},[3575],{"type":62,"value":2859},{"type":56,"tag":382,"props":3577,"children":3578},{"style":411},[3579],{"type":62,"value":3580}," }",{"type":56,"tag":382,"props":3582,"children":3583},{"style":1884},[3584],{"type":62,"value":782},{"type":56,"tag":382,"props":3586,"children":3587},{"style":411},[3588],{"type":62,"value":2195},{"type":56,"tag":382,"props":3590,"children":3591},{"class":384,"line":2381},[3592,3597,3601,3605,3609,3614,3618,3622,3626,3630,3635,3640,3644,3648,3653,3657,3661,3665,3669,3674,3678,3682,3686,3690,3694,3698,3702,3706],{"type":56,"tag":382,"props":3593,"children":3594},{"style":531},[3595],{"type":62,"value":3596},"  res",{"type":56,"tag":382,"props":3598,"children":3599},{"style":411},[3600],{"type":62,"value":1906},{"type":56,"tag":382,"props":3602,"children":3603},{"style":399},[3604],{"type":62,"value":3295},{"type":56,"tag":382,"props":3606,"children":3607},{"style":1884},[3608],{"type":62,"value":1994},{"type":56,"tag":382,"props":3610,"children":3611},{"style":1947},[3612],{"type":62,"value":3613},"500",{"type":56,"tag":382,"props":3615,"children":3616},{"style":1884},[3617],{"type":62,"value":782},{"type":56,"tag":382,"props":3619,"children":3620},{"style":411},[3621],{"type":62,"value":1906},{"type":56,"tag":382,"props":3623,"children":3624},{"style":399},[3625],{"type":62,"value":3325},{"type":56,"tag":382,"props":3627,"children":3628},{"style":1884},[3629],{"type":62,"value":1994},{"type":56,"tag":382,"props":3631,"children":3632},{"style":411},[3633],{"type":62,"value":3634},"{",{"type":56,"tag":382,"props":3636,"children":3637},{"style":1884},[3638],{"type":62,"value":3639}," title",{"type":56,"tag":382,"props":3641,"children":3642},{"style":411},[3643],{"type":62,"value":1629},{"type":56,"tag":382,"props":3645,"children":3646},{"style":411},[3647],{"type":62,"value":1930},{"type":56,"tag":382,"props":3649,"children":3650},{"style":405},[3651],{"type":62,"value":3652},"Internal Error",{"type":56,"tag":382,"props":3654,"children":3655},{"style":411},[3656],{"type":62,"value":1940},{"type":56,"tag":382,"props":3658,"children":3659},{"style":411},[3660],{"type":62,"value":1639},{"type":56,"tag":382,"props":3662,"children":3663},{"style":1884},[3664],{"type":62,"value":3366},{"type":56,"tag":382,"props":3666,"children":3667},{"style":411},[3668],{"type":62,"value":1629},{"type":56,"tag":382,"props":3670,"children":3671},{"style":1947},[3672],{"type":62,"value":3673}," 500",{"type":56,"tag":382,"props":3675,"children":3676},{"style":411},[3677],{"type":62,"value":1639},{"type":56,"tag":382,"props":3679,"children":3680},{"style":1884},[3681],{"type":62,"value":3419},{"type":56,"tag":382,"props":3683,"children":3684},{"style":411},[3685],{"type":62,"value":1629},{"type":56,"tag":382,"props":3687,"children":3688},{"style":531},[3689],{"type":62,"value":3192},{"type":56,"tag":382,"props":3691,"children":3692},{"style":411},[3693],{"type":62,"value":1906},{"type":56,"tag":382,"props":3695,"children":3696},{"style":531},[3697],{"type":62,"value":2859},{"type":56,"tag":382,"props":3699,"children":3700},{"style":411},[3701],{"type":62,"value":3580},{"type":56,"tag":382,"props":3703,"children":3704},{"style":1884},[3705],{"type":62,"value":782},{"type":56,"tag":382,"props":3707,"children":3708},{"style":411},[3709],{"type":62,"value":2195},{"type":56,"tag":382,"props":3711,"children":3712},{"class":384,"line":2398},[3713,3717,3721],{"type":56,"tag":382,"props":3714,"children":3715},{"style":411},[3716],{"type":62,"value":2179},{"type":56,"tag":382,"props":3718,"children":3719},{"style":531},[3720],{"type":62,"value":782},{"type":56,"tag":382,"props":3722,"children":3723},{"style":411},[3724],{"type":62,"value":2195},{"type":56,"tag":82,"props":3726,"children":3728},{"id":3727},"rules-1",[3729],{"type":62,"value":2509},{"type":56,"tag":370,"props":3731,"children":3734},{"className":3732,"code":3733,"language":62},[1424],"✅ Typed, domain-specific error classes\n✅ Global error handler catches everything\n✅ Operational errors → structured response\n✅ Programming errors → log + generic 500\n✅ Retry transient failures with exponential backoff\n\n❌ Never catch and ignore errors silently\n❌ Never return stack traces to client\n❌ Never throw generic Error('something')\n",[3735],{"type":56,"tag":378,"props":3736,"children":3737},{"__ignoreMap":375},[3738],{"type":62,"value":3733},{"type":56,"tag":621,"props":3740,"children":3741},{},[],{"type":56,"tag":65,"props":3743,"children":3745},{"id":3744},"_4-database-access-patterns-high",[3746],{"type":62,"value":3747},"4. Database Access Patterns (HIGH)",{"type":56,"tag":82,"props":3749,"children":3751},{"id":3750},"migrations-always",[3752],{"type":62,"value":3753},"Migrations Always",{"type":56,"tag":370,"props":3755,"children":3757},{"className":372,"code":3756,"language":374,"meta":375,"style":375},"# TypeScript (Prisma)           # Python (Alembic)              # Go (golang-migrate)\nnpx prisma migrate dev          alembic revision --autogenerate  migrate -source file:\u002F\u002Fmigrations\nnpx prisma migrate deploy       alembic upgrade head             migrate -database $DB up\n",[3758],{"type":56,"tag":378,"props":3759,"children":3760},{"__ignoreMap":375},[3761,3769,3822],{"type":56,"tag":382,"props":3762,"children":3763},{"class":384,"line":385},[3764],{"type":56,"tag":382,"props":3765,"children":3766},{"style":389},[3767],{"type":62,"value":3768},"# TypeScript (Prisma)           # Python (Alembic)              # Go (golang-migrate)\n",{"type":56,"tag":382,"props":3770,"children":3771},{"class":384,"line":395},[3772,3777,3782,3787,3792,3797,3802,3807,3812,3817],{"type":56,"tag":382,"props":3773,"children":3774},{"style":417},[3775],{"type":62,"value":3776},"npx",{"type":56,"tag":382,"props":3778,"children":3779},{"style":405},[3780],{"type":62,"value":3781}," prisma",{"type":56,"tag":382,"props":3783,"children":3784},{"style":405},[3785],{"type":62,"value":3786}," migrate",{"type":56,"tag":382,"props":3788,"children":3789},{"style":405},[3790],{"type":62,"value":3791}," dev",{"type":56,"tag":382,"props":3793,"children":3794},{"style":405},[3795],{"type":62,"value":3796},"          alembic",{"type":56,"tag":382,"props":3798,"children":3799},{"style":405},[3800],{"type":62,"value":3801}," revision",{"type":56,"tag":382,"props":3803,"children":3804},{"style":405},[3805],{"type":62,"value":3806}," --autogenerate",{"type":56,"tag":382,"props":3808,"children":3809},{"style":405},[3810],{"type":62,"value":3811},"  migrate",{"type":56,"tag":382,"props":3813,"children":3814},{"style":405},[3815],{"type":62,"value":3816}," -source",{"type":56,"tag":382,"props":3818,"children":3819},{"style":405},[3820],{"type":62,"value":3821}," file:\u002F\u002Fmigrations\n",{"type":56,"tag":382,"props":3823,"children":3824},{"class":384,"line":433},[3825,3829,3833,3837,3842,3847,3852,3857,3862,3867,3872],{"type":56,"tag":382,"props":3826,"children":3827},{"style":417},[3828],{"type":62,"value":3776},{"type":56,"tag":382,"props":3830,"children":3831},{"style":405},[3832],{"type":62,"value":3781},{"type":56,"tag":382,"props":3834,"children":3835},{"style":405},[3836],{"type":62,"value":3786},{"type":56,"tag":382,"props":3838,"children":3839},{"style":405},[3840],{"type":62,"value":3841}," deploy",{"type":56,"tag":382,"props":3843,"children":3844},{"style":405},[3845],{"type":62,"value":3846},"       alembic",{"type":56,"tag":382,"props":3848,"children":3849},{"style":405},[3850],{"type":62,"value":3851}," upgrade",{"type":56,"tag":382,"props":3853,"children":3854},{"style":405},[3855],{"type":62,"value":3856}," head",{"type":56,"tag":382,"props":3858,"children":3859},{"style":405},[3860],{"type":62,"value":3861},"             migrate",{"type":56,"tag":382,"props":3863,"children":3864},{"style":405},[3865],{"type":62,"value":3866}," -database",{"type":56,"tag":382,"props":3868,"children":3869},{"style":531},[3870],{"type":62,"value":3871}," $DB ",{"type":56,"tag":382,"props":3873,"children":3874},{"style":405},[3875],{"type":62,"value":3876},"up\n",{"type":56,"tag":370,"props":3878,"children":3881},{"className":3879,"code":3880,"language":62},[1424],"✅ Schema changes via migrations, never manual SQL\n✅ Migrations must be reversible\n✅ Review migration SQL before production\n❌ Never modify production schema manually\n",[3882],{"type":56,"tag":378,"props":3883,"children":3884},{"__ignoreMap":375},[3885],{"type":62,"value":3880},{"type":56,"tag":82,"props":3887,"children":3889},{"id":3888},"n1-prevention",[3890],{"type":62,"value":3891},"N+1 Prevention",{"type":56,"tag":370,"props":3893,"children":3895},{"className":1567,"code":3894,"language":1569,"meta":375,"style":375},"\u002F\u002F ❌ N+1: 1 query + N queries\nconst orders = await db.order.findMany();\nfor (const o of orders) { o.items = await db.item.findMany({ where: { orderId: o.id } }); }\n\n\u002F\u002F ✅ Single JOIN query\nconst orders = await db.order.findMany({ include: { items: true } });\n",[3896],{"type":56,"tag":378,"props":3897,"children":3898},{"__ignoreMap":375},[3899,3907,3960,4100,4107,4115],{"type":56,"tag":382,"props":3900,"children":3901},{"class":384,"line":385},[3902],{"type":56,"tag":382,"props":3903,"children":3904},{"style":389},[3905],{"type":62,"value":3906},"\u002F\u002F ❌ N+1: 1 query + N queries\n",{"type":56,"tag":382,"props":3908,"children":3909},{"class":384,"line":395},[3910,3914,3919,3923,3928,3933,3937,3942,3946,3951,3956],{"type":56,"tag":382,"props":3911,"children":3912},{"style":1579},[3913],{"type":62,"value":1864},{"type":56,"tag":382,"props":3915,"children":3916},{"style":531},[3917],{"type":62,"value":3918}," orders ",{"type":56,"tag":382,"props":3920,"children":3921},{"style":411},[3922],{"type":62,"value":1874},{"type":56,"tag":382,"props":3924,"children":3925},{"style":2182},[3926],{"type":62,"value":3927}," await",{"type":56,"tag":382,"props":3929,"children":3930},{"style":531},[3931],{"type":62,"value":3932}," db",{"type":56,"tag":382,"props":3934,"children":3935},{"style":411},[3936],{"type":62,"value":1906},{"type":56,"tag":382,"props":3938,"children":3939},{"style":531},[3940],{"type":62,"value":3941},"order",{"type":56,"tag":382,"props":3943,"children":3944},{"style":411},[3945],{"type":62,"value":1906},{"type":56,"tag":382,"props":3947,"children":3948},{"style":399},[3949],{"type":62,"value":3950},"findMany",{"type":56,"tag":382,"props":3952,"children":3953},{"style":531},[3954],{"type":62,"value":3955},"()",{"type":56,"tag":382,"props":3957,"children":3958},{"style":411},[3959],{"type":62,"value":2195},{"type":56,"tag":382,"props":3961,"children":3962},{"class":384,"line":433},[3963,3968,3972,3976,3981,3986,3991,3995,4000,4004,4009,4013,4017,4021,4025,4030,4034,4038,4042,4046,4051,4055,4059,4064,4068,4072,4076,4080,4084,4088,4092,4096],{"type":56,"tag":382,"props":3964,"children":3965},{"style":2182},[3966],{"type":62,"value":3967},"for",{"type":56,"tag":382,"props":3969,"children":3970},{"style":531},[3971],{"type":62,"value":2307},{"type":56,"tag":382,"props":3973,"children":3974},{"style":1579},[3975],{"type":62,"value":1864},{"type":56,"tag":382,"props":3977,"children":3978},{"style":531},[3979],{"type":62,"value":3980}," o ",{"type":56,"tag":382,"props":3982,"children":3983},{"style":411},[3984],{"type":62,"value":3985},"of",{"type":56,"tag":382,"props":3987,"children":3988},{"style":531},[3989],{"type":62,"value":3990}," orders) ",{"type":56,"tag":382,"props":3992,"children":3993},{"style":411},[3994],{"type":62,"value":3634},{"type":56,"tag":382,"props":3996,"children":3997},{"style":531},[3998],{"type":62,"value":3999}," o",{"type":56,"tag":382,"props":4001,"children":4002},{"style":411},[4003],{"type":62,"value":1906},{"type":56,"tag":382,"props":4005,"children":4006},{"style":531},[4007],{"type":62,"value":4008},"items",{"type":56,"tag":382,"props":4010,"children":4011},{"style":411},[4012],{"type":62,"value":2263},{"type":56,"tag":382,"props":4014,"children":4015},{"style":2182},[4016],{"type":62,"value":3927},{"type":56,"tag":382,"props":4018,"children":4019},{"style":531},[4020],{"type":62,"value":3932},{"type":56,"tag":382,"props":4022,"children":4023},{"style":411},[4024],{"type":62,"value":1906},{"type":56,"tag":382,"props":4026,"children":4027},{"style":531},[4028],{"type":62,"value":4029},"item",{"type":56,"tag":382,"props":4031,"children":4032},{"style":411},[4033],{"type":62,"value":1906},{"type":56,"tag":382,"props":4035,"children":4036},{"style":399},[4037],{"type":62,"value":3950},{"type":56,"tag":382,"props":4039,"children":4040},{"style":1884},[4041],{"type":62,"value":1994},{"type":56,"tag":382,"props":4043,"children":4044},{"style":411},[4045],{"type":62,"value":3634},{"type":56,"tag":382,"props":4047,"children":4048},{"style":1884},[4049],{"type":62,"value":4050}," where",{"type":56,"tag":382,"props":4052,"children":4053},{"style":411},[4054],{"type":62,"value":1629},{"type":56,"tag":382,"props":4056,"children":4057},{"style":411},[4058],{"type":62,"value":1975},{"type":56,"tag":382,"props":4060,"children":4061},{"style":1884},[4062],{"type":62,"value":4063}," orderId",{"type":56,"tag":382,"props":4065,"children":4066},{"style":411},[4067],{"type":62,"value":1629},{"type":56,"tag":382,"props":4069,"children":4070},{"style":531},[4071],{"type":62,"value":3999},{"type":56,"tag":382,"props":4073,"children":4074},{"style":411},[4075],{"type":62,"value":1906},{"type":56,"tag":382,"props":4077,"children":4078},{"style":531},[4079],{"type":62,"value":2859},{"type":56,"tag":382,"props":4081,"children":4082},{"style":411},[4083],{"type":62,"value":3580},{"type":56,"tag":382,"props":4085,"children":4086},{"style":411},[4087],{"type":62,"value":3580},{"type":56,"tag":382,"props":4089,"children":4090},{"style":1884},[4091],{"type":62,"value":782},{"type":56,"tag":382,"props":4093,"children":4094},{"style":411},[4095],{"type":62,"value":2373},{"type":56,"tag":382,"props":4097,"children":4098},{"style":411},[4099],{"type":62,"value":2739},{"type":56,"tag":382,"props":4101,"children":4102},{"class":384,"line":442},[4103],{"type":56,"tag":382,"props":4104,"children":4105},{"emptyLinePlaceholder":724},[4106],{"type":62,"value":1802},{"type":56,"tag":382,"props":4108,"children":4109},{"class":384,"line":1677},[4110],{"type":56,"tag":382,"props":4111,"children":4112},{"style":389},[4113],{"type":62,"value":4114},"\u002F\u002F ✅ Single JOIN query\n",{"type":56,"tag":382,"props":4116,"children":4117},{"class":384,"line":1691},[4118,4122,4126,4130,4134,4138,4142,4146,4150,4154,4158,4162,4167,4171,4175,4180,4184,4188,4192,4196,4200],{"type":56,"tag":382,"props":4119,"children":4120},{"style":1579},[4121],{"type":62,"value":1864},{"type":56,"tag":382,"props":4123,"children":4124},{"style":531},[4125],{"type":62,"value":3918},{"type":56,"tag":382,"props":4127,"children":4128},{"style":411},[4129],{"type":62,"value":1874},{"type":56,"tag":382,"props":4131,"children":4132},{"style":2182},[4133],{"type":62,"value":3927},{"type":56,"tag":382,"props":4135,"children":4136},{"style":531},[4137],{"type":62,"value":3932},{"type":56,"tag":382,"props":4139,"children":4140},{"style":411},[4141],{"type":62,"value":1906},{"type":56,"tag":382,"props":4143,"children":4144},{"style":531},[4145],{"type":62,"value":3941},{"type":56,"tag":382,"props":4147,"children":4148},{"style":411},[4149],{"type":62,"value":1906},{"type":56,"tag":382,"props":4151,"children":4152},{"style":399},[4153],{"type":62,"value":3950},{"type":56,"tag":382,"props":4155,"children":4156},{"style":531},[4157],{"type":62,"value":1994},{"type":56,"tag":382,"props":4159,"children":4160},{"style":411},[4161],{"type":62,"value":3634},{"type":56,"tag":382,"props":4163,"children":4164},{"style":1884},[4165],{"type":62,"value":4166}," include",{"type":56,"tag":382,"props":4168,"children":4169},{"style":411},[4170],{"type":62,"value":1629},{"type":56,"tag":382,"props":4172,"children":4173},{"style":411},[4174],{"type":62,"value":1975},{"type":56,"tag":382,"props":4176,"children":4177},{"style":1884},[4178],{"type":62,"value":4179}," items",{"type":56,"tag":382,"props":4181,"children":4182},{"style":411},[4183],{"type":62,"value":1629},{"type":56,"tag":382,"props":4185,"children":4186},{"style":2694},[4187],{"type":62,"value":2697},{"type":56,"tag":382,"props":4189,"children":4190},{"style":411},[4191],{"type":62,"value":3580},{"type":56,"tag":382,"props":4193,"children":4194},{"style":411},[4195],{"type":62,"value":3580},{"type":56,"tag":382,"props":4197,"children":4198},{"style":531},[4199],{"type":62,"value":782},{"type":56,"tag":382,"props":4201,"children":4202},{"style":411},[4203],{"type":62,"value":2195},{"type":56,"tag":82,"props":4205,"children":4207},{"id":4206},"transactions-for-multi-step-writes",[4208],{"type":62,"value":4209},"Transactions for Multi-Step Writes",{"type":56,"tag":370,"props":4211,"children":4213},{"className":1567,"code":4212,"language":1569,"meta":375,"style":375},"await db.$transaction(async (tx) => {\n  const order = await tx.order.create({ data: orderData });\n  await tx.inventory.decrement({ productId, quantity });\n  await tx.payment.create({ orderId: order.id, amount });\n});\n",[4214],{"type":56,"tag":378,"props":4215,"children":4216},{"__ignoreMap":375},[4217,4268,4344,4408,4485],{"type":56,"tag":382,"props":4218,"children":4219},{"class":384,"line":385},[4220,4225,4229,4233,4238,4242,4247,4251,4256,4260,4264],{"type":56,"tag":382,"props":4221,"children":4222},{"style":2182},[4223],{"type":62,"value":4224},"await",{"type":56,"tag":382,"props":4226,"children":4227},{"style":531},[4228],{"type":62,"value":3932},{"type":56,"tag":382,"props":4230,"children":4231},{"style":411},[4232],{"type":62,"value":1906},{"type":56,"tag":382,"props":4234,"children":4235},{"style":399},[4236],{"type":62,"value":4237},"$transaction",{"type":56,"tag":382,"props":4239,"children":4240},{"style":531},[4241],{"type":62,"value":1994},{"type":56,"tag":382,"props":4243,"children":4244},{"style":1579},[4245],{"type":62,"value":4246},"async",{"type":56,"tag":382,"props":4248,"children":4249},{"style":411},[4250],{"type":62,"value":2307},{"type":56,"tag":382,"props":4252,"children":4253},{"style":1621},[4254],{"type":62,"value":4255},"tx",{"type":56,"tag":382,"props":4257,"children":4258},{"style":411},[4259],{"type":62,"value":782},{"type":56,"tag":382,"props":4261,"children":4262},{"style":1579},[4263],{"type":62,"value":3219},{"type":56,"tag":382,"props":4265,"children":4266},{"style":411},[4267],{"type":62,"value":1592},{"type":56,"tag":382,"props":4269,"children":4270},{"class":384,"line":395},[4271,4275,4280,4284,4288,4293,4297,4301,4305,4310,4314,4318,4323,4327,4332,4336,4340],{"type":56,"tag":382,"props":4272,"children":4273},{"style":1579},[4274],{"type":62,"value":2253},{"type":56,"tag":382,"props":4276,"children":4277},{"style":531},[4278],{"type":62,"value":4279}," order",{"type":56,"tag":382,"props":4281,"children":4282},{"style":411},[4283],{"type":62,"value":2263},{"type":56,"tag":382,"props":4285,"children":4286},{"style":2182},[4287],{"type":62,"value":3927},{"type":56,"tag":382,"props":4289,"children":4290},{"style":531},[4291],{"type":62,"value":4292}," tx",{"type":56,"tag":382,"props":4294,"children":4295},{"style":411},[4296],{"type":62,"value":1906},{"type":56,"tag":382,"props":4298,"children":4299},{"style":531},[4300],{"type":62,"value":3941},{"type":56,"tag":382,"props":4302,"children":4303},{"style":411},[4304],{"type":62,"value":1906},{"type":56,"tag":382,"props":4306,"children":4307},{"style":399},[4308],{"type":62,"value":4309},"create",{"type":56,"tag":382,"props":4311,"children":4312},{"style":1884},[4313],{"type":62,"value":1994},{"type":56,"tag":382,"props":4315,"children":4316},{"style":411},[4317],{"type":62,"value":3634},{"type":56,"tag":382,"props":4319,"children":4320},{"style":1884},[4321],{"type":62,"value":4322}," data",{"type":56,"tag":382,"props":4324,"children":4325},{"style":411},[4326],{"type":62,"value":1629},{"type":56,"tag":382,"props":4328,"children":4329},{"style":531},[4330],{"type":62,"value":4331}," orderData",{"type":56,"tag":382,"props":4333,"children":4334},{"style":411},[4335],{"type":62,"value":3580},{"type":56,"tag":382,"props":4337,"children":4338},{"style":1884},[4339],{"type":62,"value":782},{"type":56,"tag":382,"props":4341,"children":4342},{"style":411},[4343],{"type":62,"value":2195},{"type":56,"tag":382,"props":4345,"children":4346},{"class":384,"line":433},[4347,4352,4356,4360,4365,4369,4374,4378,4382,4387,4391,4396,4400,4404],{"type":56,"tag":382,"props":4348,"children":4349},{"style":2182},[4350],{"type":62,"value":4351},"  await",{"type":56,"tag":382,"props":4353,"children":4354},{"style":531},[4355],{"type":62,"value":4292},{"type":56,"tag":382,"props":4357,"children":4358},{"style":411},[4359],{"type":62,"value":1906},{"type":56,"tag":382,"props":4361,"children":4362},{"style":531},[4363],{"type":62,"value":4364},"inventory",{"type":56,"tag":382,"props":4366,"children":4367},{"style":411},[4368],{"type":62,"value":1906},{"type":56,"tag":382,"props":4370,"children":4371},{"style":399},[4372],{"type":62,"value":4373},"decrement",{"type":56,"tag":382,"props":4375,"children":4376},{"style":1884},[4377],{"type":62,"value":1994},{"type":56,"tag":382,"props":4379,"children":4380},{"style":411},[4381],{"type":62,"value":3634},{"type":56,"tag":382,"props":4383,"children":4384},{"style":531},[4385],{"type":62,"value":4386}," productId",{"type":56,"tag":382,"props":4388,"children":4389},{"style":411},[4390],{"type":62,"value":1639},{"type":56,"tag":382,"props":4392,"children":4393},{"style":531},[4394],{"type":62,"value":4395}," quantity",{"type":56,"tag":382,"props":4397,"children":4398},{"style":411},[4399],{"type":62,"value":3580},{"type":56,"tag":382,"props":4401,"children":4402},{"style":1884},[4403],{"type":62,"value":782},{"type":56,"tag":382,"props":4405,"children":4406},{"style":411},[4407],{"type":62,"value":2195},{"type":56,"tag":382,"props":4409,"children":4410},{"class":384,"line":442},[4411,4415,4419,4423,4428,4432,4436,4440,4444,4448,4452,4456,4460,4464,4468,4473,4477,4481],{"type":56,"tag":382,"props":4412,"children":4413},{"style":2182},[4414],{"type":62,"value":4351},{"type":56,"tag":382,"props":4416,"children":4417},{"style":531},[4418],{"type":62,"value":4292},{"type":56,"tag":382,"props":4420,"children":4421},{"style":411},[4422],{"type":62,"value":1906},{"type":56,"tag":382,"props":4424,"children":4425},{"style":531},[4426],{"type":62,"value":4427},"payment",{"type":56,"tag":382,"props":4429,"children":4430},{"style":411},[4431],{"type":62,"value":1906},{"type":56,"tag":382,"props":4433,"children":4434},{"style":399},[4435],{"type":62,"value":4309},{"type":56,"tag":382,"props":4437,"children":4438},{"style":1884},[4439],{"type":62,"value":1994},{"type":56,"tag":382,"props":4441,"children":4442},{"style":411},[4443],{"type":62,"value":3634},{"type":56,"tag":382,"props":4445,"children":4446},{"style":1884},[4447],{"type":62,"value":4063},{"type":56,"tag":382,"props":4449,"children":4450},{"style":411},[4451],{"type":62,"value":1629},{"type":56,"tag":382,"props":4453,"children":4454},{"style":531},[4455],{"type":62,"value":4279},{"type":56,"tag":382,"props":4457,"children":4458},{"style":411},[4459],{"type":62,"value":1906},{"type":56,"tag":382,"props":4461,"children":4462},{"style":531},[4463],{"type":62,"value":2859},{"type":56,"tag":382,"props":4465,"children":4466},{"style":411},[4467],{"type":62,"value":1639},{"type":56,"tag":382,"props":4469,"children":4470},{"style":531},[4471],{"type":62,"value":4472}," amount",{"type":56,"tag":382,"props":4474,"children":4475},{"style":411},[4476],{"type":62,"value":3580},{"type":56,"tag":382,"props":4478,"children":4479},{"style":1884},[4480],{"type":62,"value":782},{"type":56,"tag":382,"props":4482,"children":4483},{"style":411},[4484],{"type":62,"value":2195},{"type":56,"tag":382,"props":4486,"children":4487},{"class":384,"line":1677},[4488,4492,4496],{"type":56,"tag":382,"props":4489,"children":4490},{"style":411},[4491],{"type":62,"value":2179},{"type":56,"tag":382,"props":4493,"children":4494},{"style":531},[4495],{"type":62,"value":782},{"type":56,"tag":382,"props":4497,"children":4498},{"style":411},[4499],{"type":62,"value":2195},{"type":56,"tag":82,"props":4501,"children":4503},{"id":4502},"connection-pooling",[4504],{"type":62,"value":4505},"Connection Pooling",{"type":56,"tag":72,"props":4507,"children":4508},{},[4509,4511,4517],{"type":62,"value":4510},"Pool size = ",{"type":56,"tag":378,"props":4512,"children":4514},{"className":4513},[],[4515],{"type":62,"value":4516},"(CPU cores × 2) + spindle_count",{"type":62,"value":4518}," (start with 10-20). Always set connection timeout. Use PgBouncer for serverless.",{"type":56,"tag":621,"props":4520,"children":4521},{},[],{"type":56,"tag":65,"props":4523,"children":4525},{"id":4524},"_5-api-client-patterns-medium",[4526],{"type":62,"value":4527},"5. API Client Patterns (MEDIUM)",{"type":56,"tag":72,"props":4529,"children":4530},{},[4531],{"type":62,"value":4532},"The \"glue layer\" between frontend and backend. Choose the approach that fits your team and stack.",{"type":56,"tag":82,"props":4534,"children":4536},{"id":4535},"option-a-typed-fetch-wrapper-simple-no-dependencies",[4537],{"type":62,"value":4538},"Option A: Typed Fetch Wrapper (Simple, No Dependencies)",{"type":56,"tag":370,"props":4540,"children":4542},{"className":1567,"code":4541,"language":1569,"meta":375,"style":375},"\u002F\u002F lib\u002Fapi-client.ts\nconst BASE_URL = process.env.NEXT_PUBLIC_API_URL || 'http:\u002F\u002Flocalhost:3001';\n\nclass ApiError extends Error {\n  constructor(public status: number, public body: any) {\n    super(body?.detail || body?.message || `API error ${status}`);\n  }\n}\n\nasync function api\u003CT>(path: string, options: RequestInit = {}): Promise\u003CT> {\n  const token = getAuthToken();  \u002F\u002F from cookie \u002F memory \u002F context\n\n  const res = await fetch(`${BASE_URL}${path}`, {\n    ...options,\n    headers: {\n      'Content-Type': 'application\u002Fjson',\n      ...(token ? { Authorization: `Bearer ${token}` } : {}),\n      ...options.headers,\n    },\n  });\n\n  if (!res.ok) {\n    const body = await res.json().catch(() => null);\n    throw new ApiError(res.status, body);\n  }\n\n  if (res.status === 204) return undefined as T;\n  return res.json();\n}\n\nexport const apiClient = {\n  get: \u003CT>(path: string) => api\u003CT>(path),\n  post: \u003CT>(path: string, data: unknown) => api\u003CT>(path, { method: 'POST', body: JSON.stringify(data) }),\n  put: \u003CT>(path: string, data: unknown) => api\u003CT>(path, { method: 'PUT', body: JSON.stringify(data) }),\n  patch: \u003CT>(path: string, data: unknown) => api\u003CT>(path, { method: 'PATCH', body: JSON.stringify(data) }),\n  delete: \u003CT>(path: string) => api\u003CT>(path, { method: 'DELETE' }),\n};\n",[4543],{"type":56,"tag":378,"props":4544,"children":4545},{"__ignoreMap":375},[4546,4554,4612,4619,4643,4701,4778,4785,4792,4799,4892,4926,4933,4991,5008,5024,5062,5140,5164,5172,5189,5197,5235,5306,5355,5363,5371,5432,5460,5468,5476,5502,5573,5729,5879,6029,6135],{"type":56,"tag":382,"props":4547,"children":4548},{"class":384,"line":385},[4549],{"type":56,"tag":382,"props":4550,"children":4551},{"style":389},[4552],{"type":62,"value":4553},"\u002F\u002F lib\u002Fapi-client.ts\n",{"type":56,"tag":382,"props":4555,"children":4556},{"class":384,"line":395},[4557,4561,4566,4570,4574,4578,4582,4586,4591,4595,4599,4604,4608],{"type":56,"tag":382,"props":4558,"children":4559},{"style":1579},[4560],{"type":62,"value":1864},{"type":56,"tag":382,"props":4562,"children":4563},{"style":531},[4564],{"type":62,"value":4565}," BASE_URL ",{"type":56,"tag":382,"props":4567,"children":4568},{"style":411},[4569],{"type":62,"value":1874},{"type":56,"tag":382,"props":4571,"children":4572},{"style":531},[4573],{"type":62,"value":2132},{"type":56,"tag":382,"props":4575,"children":4576},{"style":411},[4577],{"type":62,"value":1906},{"type":56,"tag":382,"props":4579,"children":4580},{"style":531},[4581],{"type":62,"value":1911},{"type":56,"tag":382,"props":4583,"children":4584},{"style":411},[4585],{"type":62,"value":1906},{"type":56,"tag":382,"props":4587,"children":4588},{"style":531},[4589],{"type":62,"value":4590},"NEXT_PUBLIC_API_URL ",{"type":56,"tag":382,"props":4592,"children":4593},{"style":411},[4594],{"type":62,"value":1925},{"type":56,"tag":382,"props":4596,"children":4597},{"style":411},[4598],{"type":62,"value":1930},{"type":56,"tag":382,"props":4600,"children":4601},{"style":405},[4602],{"type":62,"value":4603},"http:\u002F\u002Flocalhost:3001",{"type":56,"tag":382,"props":4605,"children":4606},{"style":411},[4607],{"type":62,"value":1940},{"type":56,"tag":382,"props":4609,"children":4610},{"style":411},[4611],{"type":62,"value":2195},{"type":56,"tag":382,"props":4613,"children":4614},{"class":384,"line":433},[4615],{"type":56,"tag":382,"props":4616,"children":4617},{"emptyLinePlaceholder":724},[4618],{"type":62,"value":1802},{"type":56,"tag":382,"props":4620,"children":4621},{"class":384,"line":442},[4622,4626,4631,4635,4639],{"type":56,"tag":382,"props":4623,"children":4624},{"style":1579},[4625],{"type":62,"value":1582},{"type":56,"tag":382,"props":4627,"children":4628},{"style":417},[4629],{"type":62,"value":4630}," ApiError",{"type":56,"tag":382,"props":4632,"children":4633},{"style":1579},[4634],{"type":62,"value":2565},{"type":56,"tag":382,"props":4636,"children":4637},{"style":417},[4638],{"type":62,"value":2336},{"type":56,"tag":382,"props":4640,"children":4641},{"style":411},[4642],{"type":62,"value":1592},{"type":56,"tag":382,"props":4644,"children":4645},{"class":384,"line":1677},[4646,4650,4654,4658,4662,4666,4670,4674,4679,4684,4688,4693,4697],{"type":56,"tag":382,"props":4647,"children":4648},{"style":1579},[4649],{"type":62,"value":1600},{"type":56,"tag":382,"props":4651,"children":4652},{"style":411},[4653],{"type":62,"value":1994},{"type":56,"tag":382,"props":4655,"children":4656},{"style":1579},[4657],{"type":62,"value":2956},{"type":56,"tag":382,"props":4659,"children":4660},{"style":1621},[4661],{"type":62,"value":3366},{"type":56,"tag":382,"props":4663,"children":4664},{"style":411},[4665],{"type":62,"value":1629},{"type":56,"tag":382,"props":4667,"children":4668},{"style":417},[4669],{"type":62,"value":2658},{"type":56,"tag":382,"props":4671,"children":4672},{"style":411},[4673],{"type":62,"value":1639},{"type":56,"tag":382,"props":4675,"children":4676},{"style":1579},[4677],{"type":62,"value":4678}," public",{"type":56,"tag":382,"props":4680,"children":4681},{"style":1621},[4682],{"type":62,"value":4683}," body",{"type":56,"tag":382,"props":4685,"children":4686},{"style":411},[4687],{"type":62,"value":1629},{"type":56,"tag":382,"props":4689,"children":4690},{"style":417},[4691],{"type":62,"value":4692}," any",{"type":56,"tag":382,"props":4694,"children":4695},{"style":411},[4696],{"type":62,"value":782},{"type":56,"tag":382,"props":4698,"children":4699},{"style":411},[4700],{"type":62,"value":1592},{"type":56,"tag":382,"props":4702,"children":4703},{"class":384,"line":1691},[4704,4708,4712,4717,4722,4727,4732,4736,4740,4744,4748,4753,4758,4762,4766,4770,4774],{"type":56,"tag":382,"props":4705,"children":4706},{"style":531},[4707],{"type":62,"value":2828},{"type":56,"tag":382,"props":4709,"children":4710},{"style":1884},[4711],{"type":62,"value":1994},{"type":56,"tag":382,"props":4713,"children":4714},{"style":531},[4715],{"type":62,"value":4716},"body",{"type":56,"tag":382,"props":4718,"children":4719},{"style":411},[4720],{"type":62,"value":4721},"?.",{"type":56,"tag":382,"props":4723,"children":4724},{"style":531},[4725],{"type":62,"value":4726},"detail",{"type":56,"tag":382,"props":4728,"children":4729},{"style":411},[4730],{"type":62,"value":4731}," ||",{"type":56,"tag":382,"props":4733,"children":4734},{"style":531},[4735],{"type":62,"value":4683},{"type":56,"tag":382,"props":4737,"children":4738},{"style":411},[4739],{"type":62,"value":4721},{"type":56,"tag":382,"props":4741,"children":4742},{"style":531},[4743],{"type":62,"value":2726},{"type":56,"tag":382,"props":4745,"children":4746},{"style":411},[4747],{"type":62,"value":4731},{"type":56,"tag":382,"props":4749,"children":4750},{"style":411},[4751],{"type":62,"value":4752}," `",{"type":56,"tag":382,"props":4754,"children":4755},{"style":405},[4756],{"type":62,"value":4757},"API error ",{"type":56,"tag":382,"props":4759,"children":4760},{"style":411},[4761],{"type":62,"value":2355},{"type":56,"tag":382,"props":4763,"children":4764},{"style":531},[4765],{"type":62,"value":3295},{"type":56,"tag":382,"props":4767,"children":4768},{"style":411},[4769],{"type":62,"value":2364},{"type":56,"tag":382,"props":4771,"children":4772},{"style":1884},[4773],{"type":62,"value":782},{"type":56,"tag":382,"props":4775,"children":4776},{"style":411},[4777],{"type":62,"value":2195},{"type":56,"tag":382,"props":4779,"children":4780},{"class":384,"line":1813},[4781],{"type":56,"tag":382,"props":4782,"children":4783},{"style":411},[4784],{"type":62,"value":2906},{"type":56,"tag":382,"props":4786,"children":4787},{"class":384,"line":1822},[4788],{"type":56,"tag":382,"props":4789,"children":4790},{"style":411},[4791],{"type":62,"value":1697},{"type":56,"tag":382,"props":4793,"children":4794},{"class":384,"line":2296},[4795],{"type":56,"tag":382,"props":4796,"children":4797},{"emptyLinePlaceholder":724},[4798],{"type":62,"value":1802},{"type":56,"tag":382,"props":4800,"children":4801},{"class":384,"line":2381},[4802,4806,4811,4816,4820,4825,4830,4835,4839,4843,4847,4852,4856,4861,4865,4870,4875,4879,4883,4888],{"type":56,"tag":382,"props":4803,"children":4804},{"style":1579},[4805],{"type":62,"value":4246},{"type":56,"tag":382,"props":4807,"children":4808},{"style":1579},[4809],{"type":62,"value":4810}," function",{"type":56,"tag":382,"props":4812,"children":4813},{"style":399},[4814],{"type":62,"value":4815}," api",{"type":56,"tag":382,"props":4817,"children":4818},{"style":411},[4819],{"type":62,"value":523},{"type":56,"tag":382,"props":4821,"children":4822},{"style":417},[4823],{"type":62,"value":4824},"T",{"type":56,"tag":382,"props":4826,"children":4827},{"style":411},[4828],{"type":62,"value":4829},">(",{"type":56,"tag":382,"props":4831,"children":4832},{"style":1621},[4833],{"type":62,"value":4834},"path",{"type":56,"tag":382,"props":4836,"children":4837},{"style":411},[4838],{"type":62,"value":1629},{"type":56,"tag":382,"props":4840,"children":4841},{"style":417},[4842],{"type":62,"value":2232},{"type":56,"tag":382,"props":4844,"children":4845},{"style":411},[4846],{"type":62,"value":1639},{"type":56,"tag":382,"props":4848,"children":4849},{"style":1621},[4850],{"type":62,"value":4851}," options",{"type":56,"tag":382,"props":4853,"children":4854},{"style":411},[4855],{"type":62,"value":1629},{"type":56,"tag":382,"props":4857,"children":4858},{"style":417},[4859],{"type":62,"value":4860}," RequestInit",{"type":56,"tag":382,"props":4862,"children":4863},{"style":411},[4864],{"type":62,"value":2263},{"type":56,"tag":382,"props":4866,"children":4867},{"style":411},[4868],{"type":62,"value":4869}," {}):",{"type":56,"tag":382,"props":4871,"children":4872},{"style":417},[4873],{"type":62,"value":4874}," Promise",{"type":56,"tag":382,"props":4876,"children":4877},{"style":411},[4878],{"type":62,"value":523},{"type":56,"tag":382,"props":4880,"children":4881},{"style":417},[4882],{"type":62,"value":4824},{"type":56,"tag":382,"props":4884,"children":4885},{"style":411},[4886],{"type":62,"value":4887},">",{"type":56,"tag":382,"props":4889,"children":4890},{"style":411},[4891],{"type":62,"value":1592},{"type":56,"tag":382,"props":4893,"children":4894},{"class":384,"line":2398},[4895,4899,4904,4908,4913,4917,4921],{"type":56,"tag":382,"props":4896,"children":4897},{"style":1579},[4898],{"type":62,"value":2253},{"type":56,"tag":382,"props":4900,"children":4901},{"style":531},[4902],{"type":62,"value":4903}," token",{"type":56,"tag":382,"props":4905,"children":4906},{"style":411},[4907],{"type":62,"value":2263},{"type":56,"tag":382,"props":4909,"children":4910},{"style":399},[4911],{"type":62,"value":4912}," getAuthToken",{"type":56,"tag":382,"props":4914,"children":4915},{"style":1884},[4916],{"type":62,"value":3955},{"type":56,"tag":382,"props":4918,"children":4919},{"style":411},[4920],{"type":62,"value":2373},{"type":56,"tag":382,"props":4922,"children":4923},{"style":389},[4924],{"type":62,"value":4925},"  \u002F\u002F from cookie \u002F memory \u002F context\n",{"type":56,"tag":382,"props":4927,"children":4928},{"class":384,"line":2822},[4929],{"type":56,"tag":382,"props":4930,"children":4931},{"emptyLinePlaceholder":724},[4932],{"type":62,"value":1802},{"type":56,"tag":382,"props":4934,"children":4935},{"class":384,"line":2900},[4936,4940,4944,4948,4952,4957,4961,4965,4970,4975,4979,4983,4987],{"type":56,"tag":382,"props":4937,"children":4938},{"style":1579},[4939],{"type":62,"value":2253},{"type":56,"tag":382,"props":4941,"children":4942},{"style":531},[4943],{"type":62,"value":3201},{"type":56,"tag":382,"props":4945,"children":4946},{"style":411},[4947],{"type":62,"value":2263},{"type":56,"tag":382,"props":4949,"children":4950},{"style":2182},[4951],{"type":62,"value":3927},{"type":56,"tag":382,"props":4953,"children":4954},{"style":399},[4955],{"type":62,"value":4956}," fetch",{"type":56,"tag":382,"props":4958,"children":4959},{"style":1884},[4960],{"type":62,"value":1994},{"type":56,"tag":382,"props":4962,"children":4963},{"style":411},[4964],{"type":62,"value":2837},{"type":56,"tag":382,"props":4966,"children":4967},{"style":531},[4968],{"type":62,"value":4969},"BASE_URL",{"type":56,"tag":382,"props":4971,"children":4972},{"style":411},[4973],{"type":62,"value":4974},"}${",{"type":56,"tag":382,"props":4976,"children":4977},{"style":531},[4978],{"type":62,"value":4834},{"type":56,"tag":382,"props":4980,"children":4981},{"style":411},[4982],{"type":62,"value":2364},{"type":56,"tag":382,"props":4984,"children":4985},{"style":411},[4986],{"type":62,"value":1639},{"type":56,"tag":382,"props":4988,"children":4989},{"style":411},[4990],{"type":62,"value":1592},{"type":56,"tag":382,"props":4992,"children":4993},{"class":384,"line":2909},[4994,4999,5004],{"type":56,"tag":382,"props":4995,"children":4996},{"style":411},[4997],{"type":62,"value":4998},"    ...",{"type":56,"tag":382,"props":5000,"children":5001},{"style":531},[5002],{"type":62,"value":5003},"options",{"type":56,"tag":382,"props":5005,"children":5006},{"style":411},[5007],{"type":62,"value":1674},{"type":56,"tag":382,"props":5009,"children":5010},{"class":384,"line":2917},[5011,5016,5020],{"type":56,"tag":382,"props":5012,"children":5013},{"style":1884},[5014],{"type":62,"value":5015},"    headers",{"type":56,"tag":382,"props":5017,"children":5018},{"style":411},[5019],{"type":62,"value":1629},{"type":56,"tag":382,"props":5021,"children":5022},{"style":411},[5023],{"type":62,"value":1592},{"type":56,"tag":382,"props":5025,"children":5026},{"class":384,"line":2942},[5027,5032,5037,5041,5045,5049,5054,5058],{"type":56,"tag":382,"props":5028,"children":5029},{"style":411},[5030],{"type":62,"value":5031},"      '",{"type":56,"tag":382,"props":5033,"children":5034},{"style":1884},[5035],{"type":62,"value":5036},"Content-Type",{"type":56,"tag":382,"props":5038,"children":5039},{"style":411},[5040],{"type":62,"value":1940},{"type":56,"tag":382,"props":5042,"children":5043},{"style":411},[5044],{"type":62,"value":1629},{"type":56,"tag":382,"props":5046,"children":5047},{"style":411},[5048],{"type":62,"value":1930},{"type":56,"tag":382,"props":5050,"children":5051},{"style":405},[5052],{"type":62,"value":5053},"application\u002Fjson",{"type":56,"tag":382,"props":5055,"children":5056},{"style":411},[5057],{"type":62,"value":1940},{"type":56,"tag":382,"props":5059,"children":5060},{"style":411},[5061],{"type":62,"value":1674},{"type":56,"tag":382,"props":5063,"children":5064},{"class":384,"line":2990},[5065,5070,5074,5079,5084,5088,5093,5097,5101,5106,5110,5114,5118,5122,5127,5132,5136],{"type":56,"tag":382,"props":5066,"children":5067},{"style":411},[5068],{"type":62,"value":5069},"      ...",{"type":56,"tag":382,"props":5071,"children":5072},{"style":1884},[5073],{"type":62,"value":1994},{"type":56,"tag":382,"props":5075,"children":5076},{"style":531},[5077],{"type":62,"value":5078},"token",{"type":56,"tag":382,"props":5080,"children":5081},{"style":411},[5082],{"type":62,"value":5083}," ?",{"type":56,"tag":382,"props":5085,"children":5086},{"style":411},[5087],{"type":62,"value":1975},{"type":56,"tag":382,"props":5089,"children":5090},{"style":1884},[5091],{"type":62,"value":5092}," Authorization",{"type":56,"tag":382,"props":5094,"children":5095},{"style":411},[5096],{"type":62,"value":1629},{"type":56,"tag":382,"props":5098,"children":5099},{"style":411},[5100],{"type":62,"value":4752},{"type":56,"tag":382,"props":5102,"children":5103},{"style":405},[5104],{"type":62,"value":5105},"Bearer ",{"type":56,"tag":382,"props":5107,"children":5108},{"style":411},[5109],{"type":62,"value":2355},{"type":56,"tag":382,"props":5111,"children":5112},{"style":531},[5113],{"type":62,"value":5078},{"type":56,"tag":382,"props":5115,"children":5116},{"style":411},[5117],{"type":62,"value":2364},{"type":56,"tag":382,"props":5119,"children":5120},{"style":411},[5121],{"type":62,"value":3580},{"type":56,"tag":382,"props":5123,"children":5124},{"style":411},[5125],{"type":62,"value":5126}," :",{"type":56,"tag":382,"props":5128,"children":5129},{"style":411},[5130],{"type":62,"value":5131}," {}",{"type":56,"tag":382,"props":5133,"children":5134},{"style":1884},[5135],{"type":62,"value":782},{"type":56,"tag":382,"props":5137,"children":5138},{"style":411},[5139],{"type":62,"value":1674},{"type":56,"tag":382,"props":5141,"children":5142},{"class":384,"line":3049},[5143,5147,5151,5155,5160],{"type":56,"tag":382,"props":5144,"children":5145},{"style":411},[5146],{"type":62,"value":5069},{"type":56,"tag":382,"props":5148,"children":5149},{"style":531},[5150],{"type":62,"value":5003},{"type":56,"tag":382,"props":5152,"children":5153},{"style":411},[5154],{"type":62,"value":1906},{"type":56,"tag":382,"props":5156,"children":5157},{"style":531},[5158],{"type":62,"value":5159},"headers",{"type":56,"tag":382,"props":5161,"children":5162},{"style":411},[5163],{"type":62,"value":1674},{"type":56,"tag":382,"props":5165,"children":5166},{"class":384,"line":3057},[5167],{"type":56,"tag":382,"props":5168,"children":5169},{"style":411},[5170],{"type":62,"value":5171},"    },\n",{"type":56,"tag":382,"props":5173,"children":5175},{"class":384,"line":5174},20,[5176,5181,5185],{"type":56,"tag":382,"props":5177,"children":5178},{"style":411},[5179],{"type":62,"value":5180},"  }",{"type":56,"tag":382,"props":5182,"children":5183},{"style":1884},[5184],{"type":62,"value":782},{"type":56,"tag":382,"props":5186,"children":5187},{"style":411},[5188],{"type":62,"value":2195},{"type":56,"tag":382,"props":5190,"children":5192},{"class":384,"line":5191},21,[5193],{"type":56,"tag":382,"props":5194,"children":5195},{"emptyLinePlaceholder":724},[5196],{"type":62,"value":1802},{"type":56,"tag":382,"props":5198,"children":5200},{"class":384,"line":5199},22,[5201,5205,5209,5213,5218,5222,5227,5231],{"type":56,"tag":382,"props":5202,"children":5203},{"style":2182},[5204],{"type":62,"value":2302},{"type":56,"tag":382,"props":5206,"children":5207},{"style":1884},[5208],{"type":62,"value":2307},{"type":56,"tag":382,"props":5210,"children":5211},{"style":411},[5212],{"type":62,"value":2312},{"type":56,"tag":382,"props":5214,"children":5215},{"style":531},[5216],{"type":62,"value":5217},"res",{"type":56,"tag":382,"props":5219,"children":5220},{"style":411},[5221],{"type":62,"value":1906},{"type":56,"tag":382,"props":5223,"children":5224},{"style":531},[5225],{"type":62,"value":5226},"ok",{"type":56,"tag":382,"props":5228,"children":5229},{"style":1884},[5230],{"type":62,"value":2059},{"type":56,"tag":382,"props":5232,"children":5233},{"style":411},[5234],{"type":62,"value":3274},{"type":56,"tag":382,"props":5236,"children":5238},{"class":384,"line":5237},23,[5239,5244,5248,5252,5256,5260,5264,5268,5272,5276,5281,5285,5289,5293,5298,5302],{"type":56,"tag":382,"props":5240,"children":5241},{"style":1579},[5242],{"type":62,"value":5243},"    const",{"type":56,"tag":382,"props":5245,"children":5246},{"style":531},[5247],{"type":62,"value":4683},{"type":56,"tag":382,"props":5249,"children":5250},{"style":411},[5251],{"type":62,"value":2263},{"type":56,"tag":382,"props":5253,"children":5254},{"style":2182},[5255],{"type":62,"value":3927},{"type":56,"tag":382,"props":5257,"children":5258},{"style":531},[5259],{"type":62,"value":3201},{"type":56,"tag":382,"props":5261,"children":5262},{"style":411},[5263],{"type":62,"value":1906},{"type":56,"tag":382,"props":5265,"children":5266},{"style":399},[5267],{"type":62,"value":3325},{"type":56,"tag":382,"props":5269,"children":5270},{"style":1884},[5271],{"type":62,"value":3955},{"type":56,"tag":382,"props":5273,"children":5274},{"style":411},[5275],{"type":62,"value":1906},{"type":56,"tag":382,"props":5277,"children":5278},{"style":399},[5279],{"type":62,"value":5280},"catch",{"type":56,"tag":382,"props":5282,"children":5283},{"style":1884},[5284],{"type":62,"value":1994},{"type":56,"tag":382,"props":5286,"children":5287},{"style":411},[5288],{"type":62,"value":3955},{"type":56,"tag":382,"props":5290,"children":5291},{"style":1579},[5292],{"type":62,"value":3219},{"type":56,"tag":382,"props":5294,"children":5295},{"style":411},[5296],{"type":62,"value":5297}," null",{"type":56,"tag":382,"props":5299,"children":5300},{"style":1884},[5301],{"type":62,"value":782},{"type":56,"tag":382,"props":5303,"children":5304},{"style":411},[5305],{"type":62,"value":2195},{"type":56,"tag":382,"props":5307,"children":5309},{"class":384,"line":5308},24,[5310,5315,5319,5323,5327,5331,5335,5339,5343,5347,5351],{"type":56,"tag":382,"props":5311,"children":5312},{"style":2182},[5313],{"type":62,"value":5314},"    throw",{"type":56,"tag":382,"props":5316,"children":5317},{"style":411},[5318],{"type":62,"value":2331},{"type":56,"tag":382,"props":5320,"children":5321},{"style":399},[5322],{"type":62,"value":4630},{"type":56,"tag":382,"props":5324,"children":5325},{"style":1884},[5326],{"type":62,"value":1994},{"type":56,"tag":382,"props":5328,"children":5329},{"style":531},[5330],{"type":62,"value":5217},{"type":56,"tag":382,"props":5332,"children":5333},{"style":411},[5334],{"type":62,"value":1906},{"type":56,"tag":382,"props":5336,"children":5337},{"style":531},[5338],{"type":62,"value":3295},{"type":56,"tag":382,"props":5340,"children":5341},{"style":411},[5342],{"type":62,"value":1639},{"type":56,"tag":382,"props":5344,"children":5345},{"style":531},[5346],{"type":62,"value":4683},{"type":56,"tag":382,"props":5348,"children":5349},{"style":1884},[5350],{"type":62,"value":782},{"type":56,"tag":382,"props":5352,"children":5353},{"style":411},[5354],{"type":62,"value":2195},{"type":56,"tag":382,"props":5356,"children":5358},{"class":384,"line":5357},25,[5359],{"type":56,"tag":382,"props":5360,"children":5361},{"style":411},[5362],{"type":62,"value":2906},{"type":56,"tag":382,"props":5364,"children":5366},{"class":384,"line":5365},26,[5367],{"type":56,"tag":382,"props":5368,"children":5369},{"emptyLinePlaceholder":724},[5370],{"type":62,"value":1802},{"type":56,"tag":382,"props":5372,"children":5374},{"class":384,"line":5373},27,[5375,5379,5383,5387,5391,5395,5400,5405,5409,5414,5419,5423,5428],{"type":56,"tag":382,"props":5376,"children":5377},{"style":2182},[5378],{"type":62,"value":2302},{"type":56,"tag":382,"props":5380,"children":5381},{"style":1884},[5382],{"type":62,"value":2307},{"type":56,"tag":382,"props":5384,"children":5385},{"style":531},[5386],{"type":62,"value":5217},{"type":56,"tag":382,"props":5388,"children":5389},{"style":411},[5390],{"type":62,"value":1906},{"type":56,"tag":382,"props":5392,"children":5393},{"style":531},[5394],{"type":62,"value":3295},{"type":56,"tag":382,"props":5396,"children":5397},{"style":411},[5398],{"type":62,"value":5399}," ===",{"type":56,"tag":382,"props":5401,"children":5402},{"style":1947},[5403],{"type":62,"value":5404}," 204",{"type":56,"tag":382,"props":5406,"children":5407},{"style":1884},[5408],{"type":62,"value":2059},{"type":56,"tag":382,"props":5410,"children":5411},{"style":2182},[5412],{"type":62,"value":5413},"return",{"type":56,"tag":382,"props":5415,"children":5416},{"style":411},[5417],{"type":62,"value":5418}," undefined",{"type":56,"tag":382,"props":5420,"children":5421},{"style":2182},[5422],{"type":62,"value":2185},{"type":56,"tag":382,"props":5424,"children":5425},{"style":417},[5426],{"type":62,"value":5427}," T",{"type":56,"tag":382,"props":5429,"children":5430},{"style":411},[5431],{"type":62,"value":2195},{"type":56,"tag":382,"props":5433,"children":5435},{"class":384,"line":5434},28,[5436,5440,5444,5448,5452,5456],{"type":56,"tag":382,"props":5437,"children":5438},{"style":2182},[5439],{"type":62,"value":2387},{"type":56,"tag":382,"props":5441,"children":5442},{"style":531},[5443],{"type":62,"value":3201},{"type":56,"tag":382,"props":5445,"children":5446},{"style":411},[5447],{"type":62,"value":1906},{"type":56,"tag":382,"props":5449,"children":5450},{"style":399},[5451],{"type":62,"value":3325},{"type":56,"tag":382,"props":5453,"children":5454},{"style":1884},[5455],{"type":62,"value":3955},{"type":56,"tag":382,"props":5457,"children":5458},{"style":411},[5459],{"type":62,"value":2195},{"type":56,"tag":382,"props":5461,"children":5463},{"class":384,"line":5462},29,[5464],{"type":56,"tag":382,"props":5465,"children":5466},{"style":411},[5467],{"type":62,"value":1697},{"type":56,"tag":382,"props":5469,"children":5471},{"class":384,"line":5470},30,[5472],{"type":56,"tag":382,"props":5473,"children":5474},{"emptyLinePlaceholder":724},[5475],{"type":62,"value":1802},{"type":56,"tag":382,"props":5477,"children":5479},{"class":384,"line":5478},31,[5480,5485,5489,5494,5498],{"type":56,"tag":382,"props":5481,"children":5482},{"style":2182},[5483],{"type":62,"value":5484},"export",{"type":56,"tag":382,"props":5486,"children":5487},{"style":1579},[5488],{"type":62,"value":2190},{"type":56,"tag":382,"props":5490,"children":5491},{"style":531},[5492],{"type":62,"value":5493}," apiClient ",{"type":56,"tag":382,"props":5495,"children":5496},{"style":411},[5497],{"type":62,"value":1874},{"type":56,"tag":382,"props":5499,"children":5500},{"style":411},[5501],{"type":62,"value":1592},{"type":56,"tag":382,"props":5503,"children":5505},{"class":384,"line":5504},32,[5506,5511,5515,5520,5524,5528,5532,5536,5540,5544,5548,5552,5556,5560,5564,5569],{"type":56,"tag":382,"props":5507,"children":5508},{"style":399},[5509],{"type":62,"value":5510},"  get",{"type":56,"tag":382,"props":5512,"children":5513},{"style":411},[5514],{"type":62,"value":1629},{"type":56,"tag":382,"props":5516,"children":5517},{"style":411},[5518],{"type":62,"value":5519}," \u003C",{"type":56,"tag":382,"props":5521,"children":5522},{"style":417},[5523],{"type":62,"value":4824},{"type":56,"tag":382,"props":5525,"children":5526},{"style":411},[5527],{"type":62,"value":4829},{"type":56,"tag":382,"props":5529,"children":5530},{"style":1621},[5531],{"type":62,"value":4834},{"type":56,"tag":382,"props":5533,"children":5534},{"style":411},[5535],{"type":62,"value":1629},{"type":56,"tag":382,"props":5537,"children":5538},{"style":417},[5539],{"type":62,"value":2232},{"type":56,"tag":382,"props":5541,"children":5542},{"style":411},[5543],{"type":62,"value":782},{"type":56,"tag":382,"props":5545,"children":5546},{"style":1579},[5547],{"type":62,"value":3219},{"type":56,"tag":382,"props":5549,"children":5550},{"style":399},[5551],{"type":62,"value":4815},{"type":56,"tag":382,"props":5553,"children":5554},{"style":411},[5555],{"type":62,"value":523},{"type":56,"tag":382,"props":5557,"children":5558},{"style":417},[5559],{"type":62,"value":4824},{"type":56,"tag":382,"props":5561,"children":5562},{"style":411},[5563],{"type":62,"value":4887},{"type":56,"tag":382,"props":5565,"children":5566},{"style":531},[5567],{"type":62,"value":5568},"(path)",{"type":56,"tag":382,"props":5570,"children":5571},{"style":411},[5572],{"type":62,"value":1674},{"type":56,"tag":382,"props":5574,"children":5576},{"class":384,"line":5575},33,[5577,5582,5586,5590,5594,5598,5602,5606,5610,5614,5618,5622,5627,5631,5635,5639,5643,5647,5651,5656,5660,5664,5669,5673,5677,5682,5686,5690,5694,5698,5703,5707,5712,5717,5721,5725],{"type":56,"tag":382,"props":5578,"children":5579},{"style":399},[5580],{"type":62,"value":5581},"  post",{"type":56,"tag":382,"props":5583,"children":5584},{"style":411},[5585],{"type":62,"value":1629},{"type":56,"tag":382,"props":5587,"children":5588},{"style":411},[5589],{"type":62,"value":5519},{"type":56,"tag":382,"props":5591,"children":5592},{"style":417},[5593],{"type":62,"value":4824},{"type":56,"tag":382,"props":5595,"children":5596},{"style":411},[5597],{"type":62,"value":4829},{"type":56,"tag":382,"props":5599,"children":5600},{"style":1621},[5601],{"type":62,"value":4834},{"type":56,"tag":382,"props":5603,"children":5604},{"style":411},[5605],{"type":62,"value":1629},{"type":56,"tag":382,"props":5607,"children":5608},{"style":417},[5609],{"type":62,"value":2232},{"type":56,"tag":382,"props":5611,"children":5612},{"style":411},[5613],{"type":62,"value":1639},{"type":56,"tag":382,"props":5615,"children":5616},{"style":1621},[5617],{"type":62,"value":4322},{"type":56,"tag":382,"props":5619,"children":5620},{"style":411},[5621],{"type":62,"value":1629},{"type":56,"tag":382,"props":5623,"children":5624},{"style":417},[5625],{"type":62,"value":5626}," unknown",{"type":56,"tag":382,"props":5628,"children":5629},{"style":411},[5630],{"type":62,"value":782},{"type":56,"tag":382,"props":5632,"children":5633},{"style":1579},[5634],{"type":62,"value":3219},{"type":56,"tag":382,"props":5636,"children":5637},{"style":399},[5638],{"type":62,"value":4815},{"type":56,"tag":382,"props":5640,"children":5641},{"style":411},[5642],{"type":62,"value":523},{"type":56,"tag":382,"props":5644,"children":5645},{"style":417},[5646],{"type":62,"value":4824},{"type":56,"tag":382,"props":5648,"children":5649},{"style":411},[5650],{"type":62,"value":4887},{"type":56,"tag":382,"props":5652,"children":5653},{"style":531},[5654],{"type":62,"value":5655},"(path",{"type":56,"tag":382,"props":5657,"children":5658},{"style":411},[5659],{"type":62,"value":1639},{"type":56,"tag":382,"props":5661,"children":5662},{"style":411},[5663],{"type":62,"value":1975},{"type":56,"tag":382,"props":5665,"children":5666},{"style":1884},[5667],{"type":62,"value":5668}," method",{"type":56,"tag":382,"props":5670,"children":5671},{"style":411},[5672],{"type":62,"value":1629},{"type":56,"tag":382,"props":5674,"children":5675},{"style":411},[5676],{"type":62,"value":1930},{"type":56,"tag":382,"props":5678,"children":5679},{"style":405},[5680],{"type":62,"value":5681},"POST",{"type":56,"tag":382,"props":5683,"children":5684},{"style":411},[5685],{"type":62,"value":1940},{"type":56,"tag":382,"props":5687,"children":5688},{"style":411},[5689],{"type":62,"value":1639},{"type":56,"tag":382,"props":5691,"children":5692},{"style":1884},[5693],{"type":62,"value":4683},{"type":56,"tag":382,"props":5695,"children":5696},{"style":411},[5697],{"type":62,"value":1629},{"type":56,"tag":382,"props":5699,"children":5700},{"style":531},[5701],{"type":62,"value":5702}," JSON",{"type":56,"tag":382,"props":5704,"children":5705},{"style":411},[5706],{"type":62,"value":1906},{"type":56,"tag":382,"props":5708,"children":5709},{"style":399},[5710],{"type":62,"value":5711},"stringify",{"type":56,"tag":382,"props":5713,"children":5714},{"style":531},[5715],{"type":62,"value":5716},"(data) ",{"type":56,"tag":382,"props":5718,"children":5719},{"style":411},[5720],{"type":62,"value":2179},{"type":56,"tag":382,"props":5722,"children":5723},{"style":531},[5724],{"type":62,"value":782},{"type":56,"tag":382,"props":5726,"children":5727},{"style":411},[5728],{"type":62,"value":1674},{"type":56,"tag":382,"props":5730,"children":5732},{"class":384,"line":5731},34,[5733,5738,5742,5746,5750,5754,5758,5762,5766,5770,5774,5778,5782,5786,5790,5794,5798,5802,5806,5810,5814,5818,5822,5826,5830,5835,5839,5843,5847,5851,5855,5859,5863,5867,5871,5875],{"type":56,"tag":382,"props":5734,"children":5735},{"style":399},[5736],{"type":62,"value":5737},"  put",{"type":56,"tag":382,"props":5739,"children":5740},{"style":411},[5741],{"type":62,"value":1629},{"type":56,"tag":382,"props":5743,"children":5744},{"style":411},[5745],{"type":62,"value":5519},{"type":56,"tag":382,"props":5747,"children":5748},{"style":417},[5749],{"type":62,"value":4824},{"type":56,"tag":382,"props":5751,"children":5752},{"style":411},[5753],{"type":62,"value":4829},{"type":56,"tag":382,"props":5755,"children":5756},{"style":1621},[5757],{"type":62,"value":4834},{"type":56,"tag":382,"props":5759,"children":5760},{"style":411},[5761],{"type":62,"value":1629},{"type":56,"tag":382,"props":5763,"children":5764},{"style":417},[5765],{"type":62,"value":2232},{"type":56,"tag":382,"props":5767,"children":5768},{"style":411},[5769],{"type":62,"value":1639},{"type":56,"tag":382,"props":5771,"children":5772},{"style":1621},[5773],{"type":62,"value":4322},{"type":56,"tag":382,"props":5775,"children":5776},{"style":411},[5777],{"type":62,"value":1629},{"type":56,"tag":382,"props":5779,"children":5780},{"style":417},[5781],{"type":62,"value":5626},{"type":56,"tag":382,"props":5783,"children":5784},{"style":411},[5785],{"type":62,"value":782},{"type":56,"tag":382,"props":5787,"children":5788},{"style":1579},[5789],{"type":62,"value":3219},{"type":56,"tag":382,"props":5791,"children":5792},{"style":399},[5793],{"type":62,"value":4815},{"type":56,"tag":382,"props":5795,"children":5796},{"style":411},[5797],{"type":62,"value":523},{"type":56,"tag":382,"props":5799,"children":5800},{"style":417},[5801],{"type":62,"value":4824},{"type":56,"tag":382,"props":5803,"children":5804},{"style":411},[5805],{"type":62,"value":4887},{"type":56,"tag":382,"props":5807,"children":5808},{"style":531},[5809],{"type":62,"value":5655},{"type":56,"tag":382,"props":5811,"children":5812},{"style":411},[5813],{"type":62,"value":1639},{"type":56,"tag":382,"props":5815,"children":5816},{"style":411},[5817],{"type":62,"value":1975},{"type":56,"tag":382,"props":5819,"children":5820},{"style":1884},[5821],{"type":62,"value":5668},{"type":56,"tag":382,"props":5823,"children":5824},{"style":411},[5825],{"type":62,"value":1629},{"type":56,"tag":382,"props":5827,"children":5828},{"style":411},[5829],{"type":62,"value":1930},{"type":56,"tag":382,"props":5831,"children":5832},{"style":405},[5833],{"type":62,"value":5834},"PUT",{"type":56,"tag":382,"props":5836,"children":5837},{"style":411},[5838],{"type":62,"value":1940},{"type":56,"tag":382,"props":5840,"children":5841},{"style":411},[5842],{"type":62,"value":1639},{"type":56,"tag":382,"props":5844,"children":5845},{"style":1884},[5846],{"type":62,"value":4683},{"type":56,"tag":382,"props":5848,"children":5849},{"style":411},[5850],{"type":62,"value":1629},{"type":56,"tag":382,"props":5852,"children":5853},{"style":531},[5854],{"type":62,"value":5702},{"type":56,"tag":382,"props":5856,"children":5857},{"style":411},[5858],{"type":62,"value":1906},{"type":56,"tag":382,"props":5860,"children":5861},{"style":399},[5862],{"type":62,"value":5711},{"type":56,"tag":382,"props":5864,"children":5865},{"style":531},[5866],{"type":62,"value":5716},{"type":56,"tag":382,"props":5868,"children":5869},{"style":411},[5870],{"type":62,"value":2179},{"type":56,"tag":382,"props":5872,"children":5873},{"style":531},[5874],{"type":62,"value":782},{"type":56,"tag":382,"props":5876,"children":5877},{"style":411},[5878],{"type":62,"value":1674},{"type":56,"tag":382,"props":5880,"children":5882},{"class":384,"line":5881},35,[5883,5888,5892,5896,5900,5904,5908,5912,5916,5920,5924,5928,5932,5936,5940,5944,5948,5952,5956,5960,5964,5968,5972,5976,5980,5985,5989,5993,5997,6001,6005,6009,6013,6017,6021,6025],{"type":56,"tag":382,"props":5884,"children":5885},{"style":399},[5886],{"type":62,"value":5887},"  patch",{"type":56,"tag":382,"props":5889,"children":5890},{"style":411},[5891],{"type":62,"value":1629},{"type":56,"tag":382,"props":5893,"children":5894},{"style":411},[5895],{"type":62,"value":5519},{"type":56,"tag":382,"props":5897,"children":5898},{"style":417},[5899],{"type":62,"value":4824},{"type":56,"tag":382,"props":5901,"children":5902},{"style":411},[5903],{"type":62,"value":4829},{"type":56,"tag":382,"props":5905,"children":5906},{"style":1621},[5907],{"type":62,"value":4834},{"type":56,"tag":382,"props":5909,"children":5910},{"style":411},[5911],{"type":62,"value":1629},{"type":56,"tag":382,"props":5913,"children":5914},{"style":417},[5915],{"type":62,"value":2232},{"type":56,"tag":382,"props":5917,"children":5918},{"style":411},[5919],{"type":62,"value":1639},{"type":56,"tag":382,"props":5921,"children":5922},{"style":1621},[5923],{"type":62,"value":4322},{"type":56,"tag":382,"props":5925,"children":5926},{"style":411},[5927],{"type":62,"value":1629},{"type":56,"tag":382,"props":5929,"children":5930},{"style":417},[5931],{"type":62,"value":5626},{"type":56,"tag":382,"props":5933,"children":5934},{"style":411},[5935],{"type":62,"value":782},{"type":56,"tag":382,"props":5937,"children":5938},{"style":1579},[5939],{"type":62,"value":3219},{"type":56,"tag":382,"props":5941,"children":5942},{"style":399},[5943],{"type":62,"value":4815},{"type":56,"tag":382,"props":5945,"children":5946},{"style":411},[5947],{"type":62,"value":523},{"type":56,"tag":382,"props":5949,"children":5950},{"style":417},[5951],{"type":62,"value":4824},{"type":56,"tag":382,"props":5953,"children":5954},{"style":411},[5955],{"type":62,"value":4887},{"type":56,"tag":382,"props":5957,"children":5958},{"style":531},[5959],{"type":62,"value":5655},{"type":56,"tag":382,"props":5961,"children":5962},{"style":411},[5963],{"type":62,"value":1639},{"type":56,"tag":382,"props":5965,"children":5966},{"style":411},[5967],{"type":62,"value":1975},{"type":56,"tag":382,"props":5969,"children":5970},{"style":1884},[5971],{"type":62,"value":5668},{"type":56,"tag":382,"props":5973,"children":5974},{"style":411},[5975],{"type":62,"value":1629},{"type":56,"tag":382,"props":5977,"children":5978},{"style":411},[5979],{"type":62,"value":1930},{"type":56,"tag":382,"props":5981,"children":5982},{"style":405},[5983],{"type":62,"value":5984},"PATCH",{"type":56,"tag":382,"props":5986,"children":5987},{"style":411},[5988],{"type":62,"value":1940},{"type":56,"tag":382,"props":5990,"children":5991},{"style":411},[5992],{"type":62,"value":1639},{"type":56,"tag":382,"props":5994,"children":5995},{"style":1884},[5996],{"type":62,"value":4683},{"type":56,"tag":382,"props":5998,"children":5999},{"style":411},[6000],{"type":62,"value":1629},{"type":56,"tag":382,"props":6002,"children":6003},{"style":531},[6004],{"type":62,"value":5702},{"type":56,"tag":382,"props":6006,"children":6007},{"style":411},[6008],{"type":62,"value":1906},{"type":56,"tag":382,"props":6010,"children":6011},{"style":399},[6012],{"type":62,"value":5711},{"type":56,"tag":382,"props":6014,"children":6015},{"style":531},[6016],{"type":62,"value":5716},{"type":56,"tag":382,"props":6018,"children":6019},{"style":411},[6020],{"type":62,"value":2179},{"type":56,"tag":382,"props":6022,"children":6023},{"style":531},[6024],{"type":62,"value":782},{"type":56,"tag":382,"props":6026,"children":6027},{"style":411},[6028],{"type":62,"value":1674},{"type":56,"tag":382,"props":6030,"children":6032},{"class":384,"line":6031},36,[6033,6038,6042,6046,6050,6054,6058,6062,6066,6070,6074,6078,6082,6086,6090,6094,6098,6102,6106,6110,6114,6119,6123,6127,6131],{"type":56,"tag":382,"props":6034,"children":6035},{"style":399},[6036],{"type":62,"value":6037},"  delete",{"type":56,"tag":382,"props":6039,"children":6040},{"style":411},[6041],{"type":62,"value":1629},{"type":56,"tag":382,"props":6043,"children":6044},{"style":411},[6045],{"type":62,"value":5519},{"type":56,"tag":382,"props":6047,"children":6048},{"style":417},[6049],{"type":62,"value":4824},{"type":56,"tag":382,"props":6051,"children":6052},{"style":411},[6053],{"type":62,"value":4829},{"type":56,"tag":382,"props":6055,"children":6056},{"style":1621},[6057],{"type":62,"value":4834},{"type":56,"tag":382,"props":6059,"children":6060},{"style":411},[6061],{"type":62,"value":1629},{"type":56,"tag":382,"props":6063,"children":6064},{"style":417},[6065],{"type":62,"value":2232},{"type":56,"tag":382,"props":6067,"children":6068},{"style":411},[6069],{"type":62,"value":782},{"type":56,"tag":382,"props":6071,"children":6072},{"style":1579},[6073],{"type":62,"value":3219},{"type":56,"tag":382,"props":6075,"children":6076},{"style":399},[6077],{"type":62,"value":4815},{"type":56,"tag":382,"props":6079,"children":6080},{"style":411},[6081],{"type":62,"value":523},{"type":56,"tag":382,"props":6083,"children":6084},{"style":417},[6085],{"type":62,"value":4824},{"type":56,"tag":382,"props":6087,"children":6088},{"style":411},[6089],{"type":62,"value":4887},{"type":56,"tag":382,"props":6091,"children":6092},{"style":531},[6093],{"type":62,"value":5655},{"type":56,"tag":382,"props":6095,"children":6096},{"style":411},[6097],{"type":62,"value":1639},{"type":56,"tag":382,"props":6099,"children":6100},{"style":411},[6101],{"type":62,"value":1975},{"type":56,"tag":382,"props":6103,"children":6104},{"style":1884},[6105],{"type":62,"value":5668},{"type":56,"tag":382,"props":6107,"children":6108},{"style":411},[6109],{"type":62,"value":1629},{"type":56,"tag":382,"props":6111,"children":6112},{"style":411},[6113],{"type":62,"value":1930},{"type":56,"tag":382,"props":6115,"children":6116},{"style":405},[6117],{"type":62,"value":6118},"DELETE",{"type":56,"tag":382,"props":6120,"children":6121},{"style":411},[6122],{"type":62,"value":1940},{"type":56,"tag":382,"props":6124,"children":6125},{"style":411},[6126],{"type":62,"value":3580},{"type":56,"tag":382,"props":6128,"children":6129},{"style":531},[6130],{"type":62,"value":782},{"type":56,"tag":382,"props":6132,"children":6133},{"style":411},[6134],{"type":62,"value":1674},{"type":56,"tag":382,"props":6136,"children":6138},{"class":384,"line":6137},37,[6139],{"type":56,"tag":382,"props":6140,"children":6141},{"style":411},[6142],{"type":62,"value":6143},"};\n",{"type":56,"tag":82,"props":6145,"children":6147},{"id":6146},"option-b-react-query-typed-client-recommended-for-react",[6148],{"type":62,"value":6149},"Option B: React Query + Typed Client (Recommended for React)",{"type":56,"tag":370,"props":6151,"children":6153},{"className":1567,"code":6152,"language":1569,"meta":375,"style":375},"\u002F\u002F hooks\u002Fuse-orders.ts\nimport { useQuery, useMutation, useQueryClient } from '@tanstack\u002Freact-query';\nimport { apiClient } from '@\u002Flib\u002Fapi-client';\n\ninterface Order { id: string; total: number; status: string; }\ninterface CreateOrderInput { items: { productId: string; quantity: number }[] }\n\nexport function useOrders() {\n  return useQuery({\n    queryKey: ['orders'],\n    queryFn: () => apiClient.get\u003C{ data: Order[] }>('\u002Fapi\u002Forders'),\n    staleTime: 1000 * 60,  \u002F\u002F 1 min\n  });\n}\n\nexport function useCreateOrder() {\n  const queryClient = useQueryClient();\n  return useMutation({\n    mutationFn: (data: CreateOrderInput) =>\n      apiClient.post\u003C{ data: Order }>('\u002Fapi\u002Forders', data),\n    onSuccess: () => {\n      queryClient.invalidateQueries({ queryKey: ['orders'] });\n    },\n  });\n}\n\n\u002F\u002F Usage in component:\nfunction OrdersPage() {\n  const { data, isLoading, error } = useOrders();\n  const createOrder = useCreateOrder();\n  if (isLoading) return \u003CSkeleton \u002F>;\n  if (error) return \u003CErrorBanner error={error} \u002F>;\n  \u002F\u002F ...\n}\n",[6154],{"type":56,"tag":378,"props":6155,"children":6156},{"__ignoreMap":375},[6157,6165,6226,6267,6274,6344,6413,6420,6444,6463,6501,6586,6622,6637,6644,6651,6675,6703,6722,6760,6830,6854,6921,6928,6943,6950,6957,6965,6985,7037,7065,7107,7167,7175],{"type":56,"tag":382,"props":6158,"children":6159},{"class":384,"line":385},[6160],{"type":56,"tag":382,"props":6161,"children":6162},{"style":389},[6163],{"type":62,"value":6164},"\u002F\u002F hooks\u002Fuse-orders.ts\n",{"type":56,"tag":382,"props":6166,"children":6167},{"class":384,"line":395},[6168,6173,6177,6182,6186,6191,6195,6200,6204,6209,6213,6218,6222],{"type":56,"tag":382,"props":6169,"children":6170},{"style":2182},[6171],{"type":62,"value":6172},"import",{"type":56,"tag":382,"props":6174,"children":6175},{"style":411},[6176],{"type":62,"value":1975},{"type":56,"tag":382,"props":6178,"children":6179},{"style":531},[6180],{"type":62,"value":6181}," useQuery",{"type":56,"tag":382,"props":6183,"children":6184},{"style":411},[6185],{"type":62,"value":1639},{"type":56,"tag":382,"props":6187,"children":6188},{"style":531},[6189],{"type":62,"value":6190}," useMutation",{"type":56,"tag":382,"props":6192,"children":6193},{"style":411},[6194],{"type":62,"value":1639},{"type":56,"tag":382,"props":6196,"children":6197},{"style":531},[6198],{"type":62,"value":6199}," useQueryClient",{"type":56,"tag":382,"props":6201,"children":6202},{"style":411},[6203],{"type":62,"value":3580},{"type":56,"tag":382,"props":6205,"children":6206},{"style":2182},[6207],{"type":62,"value":6208}," from",{"type":56,"tag":382,"props":6210,"children":6211},{"style":411},[6212],{"type":62,"value":1930},{"type":56,"tag":382,"props":6214,"children":6215},{"style":405},[6216],{"type":62,"value":6217},"@tanstack\u002Freact-query",{"type":56,"tag":382,"props":6219,"children":6220},{"style":411},[6221],{"type":62,"value":1940},{"type":56,"tag":382,"props":6223,"children":6224},{"style":411},[6225],{"type":62,"value":2195},{"type":56,"tag":382,"props":6227,"children":6228},{"class":384,"line":433},[6229,6233,6237,6242,6246,6250,6254,6259,6263],{"type":56,"tag":382,"props":6230,"children":6231},{"style":2182},[6232],{"type":62,"value":6172},{"type":56,"tag":382,"props":6234,"children":6235},{"style":411},[6236],{"type":62,"value":1975},{"type":56,"tag":382,"props":6238,"children":6239},{"style":531},[6240],{"type":62,"value":6241}," apiClient",{"type":56,"tag":382,"props":6243,"children":6244},{"style":411},[6245],{"type":62,"value":3580},{"type":56,"tag":382,"props":6247,"children":6248},{"style":2182},[6249],{"type":62,"value":6208},{"type":56,"tag":382,"props":6251,"children":6252},{"style":411},[6253],{"type":62,"value":1930},{"type":56,"tag":382,"props":6255,"children":6256},{"style":405},[6257],{"type":62,"value":6258},"@\u002Flib\u002Fapi-client",{"type":56,"tag":382,"props":6260,"children":6261},{"style":411},[6262],{"type":62,"value":1940},{"type":56,"tag":382,"props":6264,"children":6265},{"style":411},[6266],{"type":62,"value":2195},{"type":56,"tag":382,"props":6268,"children":6269},{"class":384,"line":442},[6270],{"type":56,"tag":382,"props":6271,"children":6272},{"emptyLinePlaceholder":724},[6273],{"type":62,"value":1802},{"type":56,"tag":382,"props":6275,"children":6276},{"class":384,"line":1677},[6277,6282,6287,6291,6295,6299,6303,6307,6312,6316,6320,6324,6328,6332,6336,6340],{"type":56,"tag":382,"props":6278,"children":6279},{"style":1579},[6280],{"type":62,"value":6281},"interface",{"type":56,"tag":382,"props":6283,"children":6284},{"style":417},[6285],{"type":62,"value":6286}," Order",{"type":56,"tag":382,"props":6288,"children":6289},{"style":411},[6290],{"type":62,"value":1975},{"type":56,"tag":382,"props":6292,"children":6293},{"style":1884},[6294],{"type":62,"value":2803},{"type":56,"tag":382,"props":6296,"children":6297},{"style":411},[6298],{"type":62,"value":1629},{"type":56,"tag":382,"props":6300,"children":6301},{"style":417},[6302],{"type":62,"value":2232},{"type":56,"tag":382,"props":6304,"children":6305},{"style":411},[6306],{"type":62,"value":2373},{"type":56,"tag":382,"props":6308,"children":6309},{"style":1884},[6310],{"type":62,"value":6311}," total",{"type":56,"tag":382,"props":6313,"children":6314},{"style":411},[6315],{"type":62,"value":1629},{"type":56,"tag":382,"props":6317,"children":6318},{"style":417},[6319],{"type":62,"value":2658},{"type":56,"tag":382,"props":6321,"children":6322},{"style":411},[6323],{"type":62,"value":2373},{"type":56,"tag":382,"props":6325,"children":6326},{"style":1884},[6327],{"type":62,"value":3366},{"type":56,"tag":382,"props":6329,"children":6330},{"style":411},[6331],{"type":62,"value":1629},{"type":56,"tag":382,"props":6333,"children":6334},{"style":417},[6335],{"type":62,"value":2232},{"type":56,"tag":382,"props":6337,"children":6338},{"style":411},[6339],{"type":62,"value":2373},{"type":56,"tag":382,"props":6341,"children":6342},{"style":411},[6343],{"type":62,"value":2739},{"type":56,"tag":382,"props":6345,"children":6346},{"class":384,"line":1691},[6347,6351,6356,6360,6364,6368,6372,6376,6380,6384,6388,6392,6396,6400,6404,6409],{"type":56,"tag":382,"props":6348,"children":6349},{"style":1579},[6350],{"type":62,"value":6281},{"type":56,"tag":382,"props":6352,"children":6353},{"style":417},[6354],{"type":62,"value":6355}," CreateOrderInput",{"type":56,"tag":382,"props":6357,"children":6358},{"style":411},[6359],{"type":62,"value":1975},{"type":56,"tag":382,"props":6361,"children":6362},{"style":1884},[6363],{"type":62,"value":4179},{"type":56,"tag":382,"props":6365,"children":6366},{"style":411},[6367],{"type":62,"value":1629},{"type":56,"tag":382,"props":6369,"children":6370},{"style":411},[6371],{"type":62,"value":1975},{"type":56,"tag":382,"props":6373,"children":6374},{"style":1884},[6375],{"type":62,"value":4386},{"type":56,"tag":382,"props":6377,"children":6378},{"style":411},[6379],{"type":62,"value":1629},{"type":56,"tag":382,"props":6381,"children":6382},{"style":417},[6383],{"type":62,"value":2232},{"type":56,"tag":382,"props":6385,"children":6386},{"style":411},[6387],{"type":62,"value":2373},{"type":56,"tag":382,"props":6389,"children":6390},{"style":1884},[6391],{"type":62,"value":4395},{"type":56,"tag":382,"props":6393,"children":6394},{"style":411},[6395],{"type":62,"value":1629},{"type":56,"tag":382,"props":6397,"children":6398},{"style":417},[6399],{"type":62,"value":2658},{"type":56,"tag":382,"props":6401,"children":6402},{"style":411},[6403],{"type":62,"value":3580},{"type":56,"tag":382,"props":6405,"children":6406},{"style":531},[6407],{"type":62,"value":6408},"[] ",{"type":56,"tag":382,"props":6410,"children":6411},{"style":411},[6412],{"type":62,"value":1697},{"type":56,"tag":382,"props":6414,"children":6415},{"class":384,"line":1813},[6416],{"type":56,"tag":382,"props":6417,"children":6418},{"emptyLinePlaceholder":724},[6419],{"type":62,"value":1802},{"type":56,"tag":382,"props":6421,"children":6422},{"class":384,"line":1822},[6423,6427,6431,6436,6440],{"type":56,"tag":382,"props":6424,"children":6425},{"style":2182},[6426],{"type":62,"value":5484},{"type":56,"tag":382,"props":6428,"children":6429},{"style":1579},[6430],{"type":62,"value":4810},{"type":56,"tag":382,"props":6432,"children":6433},{"style":399},[6434],{"type":62,"value":6435}," useOrders",{"type":56,"tag":382,"props":6437,"children":6438},{"style":411},[6439],{"type":62,"value":3955},{"type":56,"tag":382,"props":6441,"children":6442},{"style":411},[6443],{"type":62,"value":1592},{"type":56,"tag":382,"props":6445,"children":6446},{"class":384,"line":2296},[6447,6451,6455,6459],{"type":56,"tag":382,"props":6448,"children":6449},{"style":2182},[6450],{"type":62,"value":2387},{"type":56,"tag":382,"props":6452,"children":6453},{"style":399},[6454],{"type":62,"value":6181},{"type":56,"tag":382,"props":6456,"children":6457},{"style":1884},[6458],{"type":62,"value":1994},{"type":56,"tag":382,"props":6460,"children":6461},{"style":411},[6462],{"type":62,"value":3274},{"type":56,"tag":382,"props":6464,"children":6465},{"class":384,"line":2381},[6466,6471,6475,6480,6484,6489,6493,6497],{"type":56,"tag":382,"props":6467,"children":6468},{"style":1884},[6469],{"type":62,"value":6470},"    queryKey",{"type":56,"tag":382,"props":6472,"children":6473},{"style":411},[6474],{"type":62,"value":1629},{"type":56,"tag":382,"props":6476,"children":6477},{"style":1884},[6478],{"type":62,"value":6479}," [",{"type":56,"tag":382,"props":6481,"children":6482},{"style":411},[6483],{"type":62,"value":1940},{"type":56,"tag":382,"props":6485,"children":6486},{"style":405},[6487],{"type":62,"value":6488},"orders",{"type":56,"tag":382,"props":6490,"children":6491},{"style":411},[6492],{"type":62,"value":1940},{"type":56,"tag":382,"props":6494,"children":6495},{"style":1884},[6496],{"type":62,"value":2289},{"type":56,"tag":382,"props":6498,"children":6499},{"style":411},[6500],{"type":62,"value":1674},{"type":56,"tag":382,"props":6502,"children":6503},{"class":384,"line":2398},[6504,6509,6513,6518,6522,6526,6530,6535,6540,6544,6548,6552,6556,6561,6565,6569,6574,6578,6582],{"type":56,"tag":382,"props":6505,"children":6506},{"style":399},[6507],{"type":62,"value":6508},"    queryFn",{"type":56,"tag":382,"props":6510,"children":6511},{"style":411},[6512],{"type":62,"value":1629},{"type":56,"tag":382,"props":6514,"children":6515},{"style":411},[6516],{"type":62,"value":6517}," ()",{"type":56,"tag":382,"props":6519,"children":6520},{"style":1579},[6521],{"type":62,"value":3219},{"type":56,"tag":382,"props":6523,"children":6524},{"style":531},[6525],{"type":62,"value":6241},{"type":56,"tag":382,"props":6527,"children":6528},{"style":411},[6529],{"type":62,"value":1906},{"type":56,"tag":382,"props":6531,"children":6532},{"style":399},[6533],{"type":62,"value":6534},"get",{"type":56,"tag":382,"props":6536,"children":6537},{"style":411},[6538],{"type":62,"value":6539},"\u003C{",{"type":56,"tag":382,"props":6541,"children":6542},{"style":1884},[6543],{"type":62,"value":4322},{"type":56,"tag":382,"props":6545,"children":6546},{"style":411},[6547],{"type":62,"value":1629},{"type":56,"tag":382,"props":6549,"children":6550},{"style":417},[6551],{"type":62,"value":6286},{"type":56,"tag":382,"props":6553,"children":6554},{"style":1884},[6555],{"type":62,"value":6408},{"type":56,"tag":382,"props":6557,"children":6558},{"style":411},[6559],{"type":62,"value":6560},"}>",{"type":56,"tag":382,"props":6562,"children":6563},{"style":1884},[6564],{"type":62,"value":1994},{"type":56,"tag":382,"props":6566,"children":6567},{"style":411},[6568],{"type":62,"value":1940},{"type":56,"tag":382,"props":6570,"children":6571},{"style":405},[6572],{"type":62,"value":6573},"\u002Fapi\u002Forders",{"type":56,"tag":382,"props":6575,"children":6576},{"style":411},[6577],{"type":62,"value":1940},{"type":56,"tag":382,"props":6579,"children":6580},{"style":1884},[6581],{"type":62,"value":782},{"type":56,"tag":382,"props":6583,"children":6584},{"style":411},[6585],{"type":62,"value":1674},{"type":56,"tag":382,"props":6587,"children":6588},{"class":384,"line":2822},[6589,6594,6598,6603,6608,6613,6617],{"type":56,"tag":382,"props":6590,"children":6591},{"style":1884},[6592],{"type":62,"value":6593},"    staleTime",{"type":56,"tag":382,"props":6595,"children":6596},{"style":411},[6597],{"type":62,"value":1629},{"type":56,"tag":382,"props":6599,"children":6600},{"style":1947},[6601],{"type":62,"value":6602}," 1000",{"type":56,"tag":382,"props":6604,"children":6605},{"style":411},[6606],{"type":62,"value":6607}," *",{"type":56,"tag":382,"props":6609,"children":6610},{"style":1947},[6611],{"type":62,"value":6612}," 60",{"type":56,"tag":382,"props":6614,"children":6615},{"style":411},[6616],{"type":62,"value":1639},{"type":56,"tag":382,"props":6618,"children":6619},{"style":389},[6620],{"type":62,"value":6621},"  \u002F\u002F 1 min\n",{"type":56,"tag":382,"props":6623,"children":6624},{"class":384,"line":2900},[6625,6629,6633],{"type":56,"tag":382,"props":6626,"children":6627},{"style":411},[6628],{"type":62,"value":5180},{"type":56,"tag":382,"props":6630,"children":6631},{"style":1884},[6632],{"type":62,"value":782},{"type":56,"tag":382,"props":6634,"children":6635},{"style":411},[6636],{"type":62,"value":2195},{"type":56,"tag":382,"props":6638,"children":6639},{"class":384,"line":2909},[6640],{"type":56,"tag":382,"props":6641,"children":6642},{"style":411},[6643],{"type":62,"value":1697},{"type":56,"tag":382,"props":6645,"children":6646},{"class":384,"line":2917},[6647],{"type":56,"tag":382,"props":6648,"children":6649},{"emptyLinePlaceholder":724},[6650],{"type":62,"value":1802},{"type":56,"tag":382,"props":6652,"children":6653},{"class":384,"line":2942},[6654,6658,6662,6667,6671],{"type":56,"tag":382,"props":6655,"children":6656},{"style":2182},[6657],{"type":62,"value":5484},{"type":56,"tag":382,"props":6659,"children":6660},{"style":1579},[6661],{"type":62,"value":4810},{"type":56,"tag":382,"props":6663,"children":6664},{"style":399},[6665],{"type":62,"value":6666}," useCreateOrder",{"type":56,"tag":382,"props":6668,"children":6669},{"style":411},[6670],{"type":62,"value":3955},{"type":56,"tag":382,"props":6672,"children":6673},{"style":411},[6674],{"type":62,"value":1592},{"type":56,"tag":382,"props":6676,"children":6677},{"class":384,"line":2990},[6678,6682,6687,6691,6695,6699],{"type":56,"tag":382,"props":6679,"children":6680},{"style":1579},[6681],{"type":62,"value":2253},{"type":56,"tag":382,"props":6683,"children":6684},{"style":531},[6685],{"type":62,"value":6686}," queryClient",{"type":56,"tag":382,"props":6688,"children":6689},{"style":411},[6690],{"type":62,"value":2263},{"type":56,"tag":382,"props":6692,"children":6693},{"style":399},[6694],{"type":62,"value":6199},{"type":56,"tag":382,"props":6696,"children":6697},{"style":1884},[6698],{"type":62,"value":3955},{"type":56,"tag":382,"props":6700,"children":6701},{"style":411},[6702],{"type":62,"value":2195},{"type":56,"tag":382,"props":6704,"children":6705},{"class":384,"line":3049},[6706,6710,6714,6718],{"type":56,"tag":382,"props":6707,"children":6708},{"style":2182},[6709],{"type":62,"value":2387},{"type":56,"tag":382,"props":6711,"children":6712},{"style":399},[6713],{"type":62,"value":6190},{"type":56,"tag":382,"props":6715,"children":6716},{"style":1884},[6717],{"type":62,"value":1994},{"type":56,"tag":382,"props":6719,"children":6720},{"style":411},[6721],{"type":62,"value":3274},{"type":56,"tag":382,"props":6723,"children":6724},{"class":384,"line":3057},[6725,6730,6734,6738,6743,6747,6751,6755],{"type":56,"tag":382,"props":6726,"children":6727},{"style":399},[6728],{"type":62,"value":6729},"    mutationFn",{"type":56,"tag":382,"props":6731,"children":6732},{"style":411},[6733],{"type":62,"value":1629},{"type":56,"tag":382,"props":6735,"children":6736},{"style":411},[6737],{"type":62,"value":2307},{"type":56,"tag":382,"props":6739,"children":6740},{"style":1621},[6741],{"type":62,"value":6742},"data",{"type":56,"tag":382,"props":6744,"children":6745},{"style":411},[6746],{"type":62,"value":1629},{"type":56,"tag":382,"props":6748,"children":6749},{"style":417},[6750],{"type":62,"value":6355},{"type":56,"tag":382,"props":6752,"children":6753},{"style":411},[6754],{"type":62,"value":782},{"type":56,"tag":382,"props":6756,"children":6757},{"style":1579},[6758],{"type":62,"value":6759}," =>\n",{"type":56,"tag":382,"props":6761,"children":6762},{"class":384,"line":5174},[6763,6768,6772,6777,6781,6785,6789,6793,6798,6802,6806,6810,6814,6818,6822,6826],{"type":56,"tag":382,"props":6764,"children":6765},{"style":531},[6766],{"type":62,"value":6767},"      apiClient",{"type":56,"tag":382,"props":6769,"children":6770},{"style":411},[6771],{"type":62,"value":1906},{"type":56,"tag":382,"props":6773,"children":6774},{"style":399},[6775],{"type":62,"value":6776},"post",{"type":56,"tag":382,"props":6778,"children":6779},{"style":411},[6780],{"type":62,"value":6539},{"type":56,"tag":382,"props":6782,"children":6783},{"style":1884},[6784],{"type":62,"value":4322},{"type":56,"tag":382,"props":6786,"children":6787},{"style":411},[6788],{"type":62,"value":1629},{"type":56,"tag":382,"props":6790,"children":6791},{"style":417},[6792],{"type":62,"value":6286},{"type":56,"tag":382,"props":6794,"children":6795},{"style":411},[6796],{"type":62,"value":6797}," }>",{"type":56,"tag":382,"props":6799,"children":6800},{"style":1884},[6801],{"type":62,"value":1994},{"type":56,"tag":382,"props":6803,"children":6804},{"style":411},[6805],{"type":62,"value":1940},{"type":56,"tag":382,"props":6807,"children":6808},{"style":405},[6809],{"type":62,"value":6573},{"type":56,"tag":382,"props":6811,"children":6812},{"style":411},[6813],{"type":62,"value":1940},{"type":56,"tag":382,"props":6815,"children":6816},{"style":411},[6817],{"type":62,"value":1639},{"type":56,"tag":382,"props":6819,"children":6820},{"style":531},[6821],{"type":62,"value":4322},{"type":56,"tag":382,"props":6823,"children":6824},{"style":1884},[6825],{"type":62,"value":782},{"type":56,"tag":382,"props":6827,"children":6828},{"style":411},[6829],{"type":62,"value":1674},{"type":56,"tag":382,"props":6831,"children":6832},{"class":384,"line":5191},[6833,6838,6842,6846,6850],{"type":56,"tag":382,"props":6834,"children":6835},{"style":399},[6836],{"type":62,"value":6837},"    onSuccess",{"type":56,"tag":382,"props":6839,"children":6840},{"style":411},[6841],{"type":62,"value":1629},{"type":56,"tag":382,"props":6843,"children":6844},{"style":411},[6845],{"type":62,"value":6517},{"type":56,"tag":382,"props":6847,"children":6848},{"style":1579},[6849],{"type":62,"value":3219},{"type":56,"tag":382,"props":6851,"children":6852},{"style":411},[6853],{"type":62,"value":1592},{"type":56,"tag":382,"props":6855,"children":6856},{"class":384,"line":5199},[6857,6862,6866,6871,6875,6879,6884,6888,6892,6896,6900,6904,6909,6913,6917],{"type":56,"tag":382,"props":6858,"children":6859},{"style":531},[6860],{"type":62,"value":6861},"      queryClient",{"type":56,"tag":382,"props":6863,"children":6864},{"style":411},[6865],{"type":62,"value":1906},{"type":56,"tag":382,"props":6867,"children":6868},{"style":399},[6869],{"type":62,"value":6870},"invalidateQueries",{"type":56,"tag":382,"props":6872,"children":6873},{"style":1884},[6874],{"type":62,"value":1994},{"type":56,"tag":382,"props":6876,"children":6877},{"style":411},[6878],{"type":62,"value":3634},{"type":56,"tag":382,"props":6880,"children":6881},{"style":1884},[6882],{"type":62,"value":6883}," queryKey",{"type":56,"tag":382,"props":6885,"children":6886},{"style":411},[6887],{"type":62,"value":1629},{"type":56,"tag":382,"props":6889,"children":6890},{"style":1884},[6891],{"type":62,"value":6479},{"type":56,"tag":382,"props":6893,"children":6894},{"style":411},[6895],{"type":62,"value":1940},{"type":56,"tag":382,"props":6897,"children":6898},{"style":405},[6899],{"type":62,"value":6488},{"type":56,"tag":382,"props":6901,"children":6902},{"style":411},[6903],{"type":62,"value":1940},{"type":56,"tag":382,"props":6905,"children":6906},{"style":1884},[6907],{"type":62,"value":6908},"] ",{"type":56,"tag":382,"props":6910,"children":6911},{"style":411},[6912],{"type":62,"value":2179},{"type":56,"tag":382,"props":6914,"children":6915},{"style":1884},[6916],{"type":62,"value":782},{"type":56,"tag":382,"props":6918,"children":6919},{"style":411},[6920],{"type":62,"value":2195},{"type":56,"tag":382,"props":6922,"children":6923},{"class":384,"line":5237},[6924],{"type":56,"tag":382,"props":6925,"children":6926},{"style":411},[6927],{"type":62,"value":5171},{"type":56,"tag":382,"props":6929,"children":6930},{"class":384,"line":5308},[6931,6935,6939],{"type":56,"tag":382,"props":6932,"children":6933},{"style":411},[6934],{"type":62,"value":5180},{"type":56,"tag":382,"props":6936,"children":6937},{"style":1884},[6938],{"type":62,"value":782},{"type":56,"tag":382,"props":6940,"children":6941},{"style":411},[6942],{"type":62,"value":2195},{"type":56,"tag":382,"props":6944,"children":6945},{"class":384,"line":5357},[6946],{"type":56,"tag":382,"props":6947,"children":6948},{"style":411},[6949],{"type":62,"value":1697},{"type":56,"tag":382,"props":6951,"children":6952},{"class":384,"line":5365},[6953],{"type":56,"tag":382,"props":6954,"children":6955},{"emptyLinePlaceholder":724},[6956],{"type":62,"value":1802},{"type":56,"tag":382,"props":6958,"children":6959},{"class":384,"line":5373},[6960],{"type":56,"tag":382,"props":6961,"children":6962},{"style":389},[6963],{"type":62,"value":6964},"\u002F\u002F Usage in component:\n",{"type":56,"tag":382,"props":6966,"children":6967},{"class":384,"line":5434},[6968,6972,6977,6981],{"type":56,"tag":382,"props":6969,"children":6970},{"style":1579},[6971],{"type":62,"value":2210},{"type":56,"tag":382,"props":6973,"children":6974},{"style":399},[6975],{"type":62,"value":6976}," OrdersPage",{"type":56,"tag":382,"props":6978,"children":6979},{"style":411},[6980],{"type":62,"value":3955},{"type":56,"tag":382,"props":6982,"children":6983},{"style":411},[6984],{"type":62,"value":1592},{"type":56,"tag":382,"props":6986,"children":6987},{"class":384,"line":5462},[6988,6992,6996,7000,7004,7009,7013,7017,7021,7025,7029,7033],{"type":56,"tag":382,"props":6989,"children":6990},{"style":1579},[6991],{"type":62,"value":2253},{"type":56,"tag":382,"props":6993,"children":6994},{"style":411},[6995],{"type":62,"value":1975},{"type":56,"tag":382,"props":6997,"children":6998},{"style":531},[6999],{"type":62,"value":4322},{"type":56,"tag":382,"props":7001,"children":7002},{"style":411},[7003],{"type":62,"value":1639},{"type":56,"tag":382,"props":7005,"children":7006},{"style":531},[7007],{"type":62,"value":7008}," isLoading",{"type":56,"tag":382,"props":7010,"children":7011},{"style":411},[7012],{"type":62,"value":1639},{"type":56,"tag":382,"props":7014,"children":7015},{"style":531},[7016],{"type":62,"value":3509},{"type":56,"tag":382,"props":7018,"children":7019},{"style":411},[7020],{"type":62,"value":3580},{"type":56,"tag":382,"props":7022,"children":7023},{"style":411},[7024],{"type":62,"value":2263},{"type":56,"tag":382,"props":7026,"children":7027},{"style":399},[7028],{"type":62,"value":6435},{"type":56,"tag":382,"props":7030,"children":7031},{"style":1884},[7032],{"type":62,"value":3955},{"type":56,"tag":382,"props":7034,"children":7035},{"style":411},[7036],{"type":62,"value":2195},{"type":56,"tag":382,"props":7038,"children":7039},{"class":384,"line":5470},[7040,7044,7049,7053,7057,7061],{"type":56,"tag":382,"props":7041,"children":7042},{"style":1579},[7043],{"type":62,"value":2253},{"type":56,"tag":382,"props":7045,"children":7046},{"style":531},[7047],{"type":62,"value":7048}," createOrder",{"type":56,"tag":382,"props":7050,"children":7051},{"style":411},[7052],{"type":62,"value":2263},{"type":56,"tag":382,"props":7054,"children":7055},{"style":399},[7056],{"type":62,"value":6666},{"type":56,"tag":382,"props":7058,"children":7059},{"style":1884},[7060],{"type":62,"value":3955},{"type":56,"tag":382,"props":7062,"children":7063},{"style":411},[7064],{"type":62,"value":2195},{"type":56,"tag":382,"props":7066,"children":7067},{"class":384,"line":5478},[7068,7072,7076,7081,7085,7089,7093,7098,7103],{"type":56,"tag":382,"props":7069,"children":7070},{"style":2182},[7071],{"type":62,"value":2302},{"type":56,"tag":382,"props":7073,"children":7074},{"style":1884},[7075],{"type":62,"value":2307},{"type":56,"tag":382,"props":7077,"children":7078},{"style":531},[7079],{"type":62,"value":7080},"isLoading",{"type":56,"tag":382,"props":7082,"children":7083},{"style":1884},[7084],{"type":62,"value":2059},{"type":56,"tag":382,"props":7086,"children":7087},{"style":2182},[7088],{"type":62,"value":5413},{"type":56,"tag":382,"props":7090,"children":7091},{"style":1884},[7092],{"type":62,"value":5519},{"type":56,"tag":382,"props":7094,"children":7095},{"style":417},[7096],{"type":62,"value":7097},"Skeleton",{"type":56,"tag":382,"props":7099,"children":7100},{"style":1884},[7101],{"type":62,"value":7102}," \u002F>",{"type":56,"tag":382,"props":7104,"children":7105},{"style":411},[7106],{"type":62,"value":2195},{"type":56,"tag":382,"props":7108,"children":7109},{"class":384,"line":5504},[7110,7114,7118,7122,7126,7130,7134,7139,7143,7147,7151,7155,7159,7163],{"type":56,"tag":382,"props":7111,"children":7112},{"style":2182},[7113],{"type":62,"value":2302},{"type":56,"tag":382,"props":7115,"children":7116},{"style":1884},[7117],{"type":62,"value":2307},{"type":56,"tag":382,"props":7119,"children":7120},{"style":531},[7121],{"type":62,"value":3479},{"type":56,"tag":382,"props":7123,"children":7124},{"style":1884},[7125],{"type":62,"value":2059},{"type":56,"tag":382,"props":7127,"children":7128},{"style":2182},[7129],{"type":62,"value":5413},{"type":56,"tag":382,"props":7131,"children":7132},{"style":1884},[7133],{"type":62,"value":5519},{"type":56,"tag":382,"props":7135,"children":7136},{"style":417},[7137],{"type":62,"value":7138},"ErrorBanner",{"type":56,"tag":382,"props":7140,"children":7141},{"style":417},[7142],{"type":62,"value":3509},{"type":56,"tag":382,"props":7144,"children":7145},{"style":1884},[7146],{"type":62,"value":1874},{"type":56,"tag":382,"props":7148,"children":7149},{"style":411},[7150],{"type":62,"value":3634},{"type":56,"tag":382,"props":7152,"children":7153},{"style":1884},[7154],{"type":62,"value":3479},{"type":56,"tag":382,"props":7156,"children":7157},{"style":411},[7158],{"type":62,"value":2179},{"type":56,"tag":382,"props":7160,"children":7161},{"style":1884},[7162],{"type":62,"value":7102},{"type":56,"tag":382,"props":7164,"children":7165},{"style":411},[7166],{"type":62,"value":2195},{"type":56,"tag":382,"props":7168,"children":7169},{"class":384,"line":5575},[7170],{"type":56,"tag":382,"props":7171,"children":7172},{"style":389},[7173],{"type":62,"value":7174},"  \u002F\u002F ...\n",{"type":56,"tag":382,"props":7176,"children":7177},{"class":384,"line":5731},[7178],{"type":56,"tag":382,"props":7179,"children":7180},{"style":411},[7181],{"type":62,"value":1697},{"type":56,"tag":82,"props":7183,"children":7185},{"id":7184},"option-c-trpc-same-team-owns-both-sides",[7186],{"type":62,"value":7187},"Option C: tRPC (Same Team Owns Both Sides)",{"type":56,"tag":370,"props":7189,"children":7191},{"className":1567,"code":7190,"language":1569,"meta":375,"style":375},"\u002F\u002F server: trpc\u002Frouter.ts\nexport const appRouter = router({\n  orders: router({\n    list: publicProcedure.query(async () => {\n      return db.order.findMany({ include: { items: true } });\n    }),\n    create: protectedProcedure\n      .input(z.object({ items: z.array(orderItemSchema) }))\n      .mutation(async ({ input, ctx }) => {\n        return orderService.create(ctx.user.id, input);\n      }),\n  }),\n});\nexport type AppRouter = typeof appRouter;\n\n\u002F\u002F client: automatic type safety, no code generation\nconst { data } = trpc.orders.list.useQuery();\nconst createOrder = trpc.orders.create.useMutation();\n",[7192],{"type":56,"tag":378,"props":7193,"children":7194},{"__ignoreMap":375},[7195,7203,7236,7260,7306,7382,7397,7414,7484,7536,7599,7615,7630,7645,7680,7687,7695,7758],{"type":56,"tag":382,"props":7196,"children":7197},{"class":384,"line":385},[7198],{"type":56,"tag":382,"props":7199,"children":7200},{"style":389},[7201],{"type":62,"value":7202},"\u002F\u002F server: trpc\u002Frouter.ts\n",{"type":56,"tag":382,"props":7204,"children":7205},{"class":384,"line":395},[7206,7210,7214,7219,7223,7228,7232],{"type":56,"tag":382,"props":7207,"children":7208},{"style":2182},[7209],{"type":62,"value":5484},{"type":56,"tag":382,"props":7211,"children":7212},{"style":1579},[7213],{"type":62,"value":2190},{"type":56,"tag":382,"props":7215,"children":7216},{"style":531},[7217],{"type":62,"value":7218}," appRouter ",{"type":56,"tag":382,"props":7220,"children":7221},{"style":411},[7222],{"type":62,"value":1874},{"type":56,"tag":382,"props":7224,"children":7225},{"style":399},[7226],{"type":62,"value":7227}," router",{"type":56,"tag":382,"props":7229,"children":7230},{"style":531},[7231],{"type":62,"value":1994},{"type":56,"tag":382,"props":7233,"children":7234},{"style":411},[7235],{"type":62,"value":3274},{"type":56,"tag":382,"props":7237,"children":7238},{"class":384,"line":433},[7239,7244,7248,7252,7256],{"type":56,"tag":382,"props":7240,"children":7241},{"style":1884},[7242],{"type":62,"value":7243},"  orders",{"type":56,"tag":382,"props":7245,"children":7246},{"style":411},[7247],{"type":62,"value":1629},{"type":56,"tag":382,"props":7249,"children":7250},{"style":399},[7251],{"type":62,"value":7227},{"type":56,"tag":382,"props":7253,"children":7254},{"style":531},[7255],{"type":62,"value":1994},{"type":56,"tag":382,"props":7257,"children":7258},{"style":411},[7259],{"type":62,"value":3274},{"type":56,"tag":382,"props":7261,"children":7262},{"class":384,"line":442},[7263,7268,7272,7277,7281,7286,7290,7294,7298,7302],{"type":56,"tag":382,"props":7264,"children":7265},{"style":1884},[7266],{"type":62,"value":7267},"    list",{"type":56,"tag":382,"props":7269,"children":7270},{"style":411},[7271],{"type":62,"value":1629},{"type":56,"tag":382,"props":7273,"children":7274},{"style":531},[7275],{"type":62,"value":7276}," publicProcedure",{"type":56,"tag":382,"props":7278,"children":7279},{"style":411},[7280],{"type":62,"value":1906},{"type":56,"tag":382,"props":7282,"children":7283},{"style":399},[7284],{"type":62,"value":7285},"query",{"type":56,"tag":382,"props":7287,"children":7288},{"style":531},[7289],{"type":62,"value":1994},{"type":56,"tag":382,"props":7291,"children":7292},{"style":1579},[7293],{"type":62,"value":4246},{"type":56,"tag":382,"props":7295,"children":7296},{"style":411},[7297],{"type":62,"value":6517},{"type":56,"tag":382,"props":7299,"children":7300},{"style":1579},[7301],{"type":62,"value":3219},{"type":56,"tag":382,"props":7303,"children":7304},{"style":411},[7305],{"type":62,"value":1592},{"type":56,"tag":382,"props":7307,"children":7308},{"class":384,"line":1677},[7309,7314,7318,7322,7326,7330,7334,7338,7342,7346,7350,7354,7358,7362,7366,7370,7374,7378],{"type":56,"tag":382,"props":7310,"children":7311},{"style":2182},[7312],{"type":62,"value":7313},"      return",{"type":56,"tag":382,"props":7315,"children":7316},{"style":531},[7317],{"type":62,"value":3932},{"type":56,"tag":382,"props":7319,"children":7320},{"style":411},[7321],{"type":62,"value":1906},{"type":56,"tag":382,"props":7323,"children":7324},{"style":531},[7325],{"type":62,"value":3941},{"type":56,"tag":382,"props":7327,"children":7328},{"style":411},[7329],{"type":62,"value":1906},{"type":56,"tag":382,"props":7331,"children":7332},{"style":399},[7333],{"type":62,"value":3950},{"type":56,"tag":382,"props":7335,"children":7336},{"style":1884},[7337],{"type":62,"value":1994},{"type":56,"tag":382,"props":7339,"children":7340},{"style":411},[7341],{"type":62,"value":3634},{"type":56,"tag":382,"props":7343,"children":7344},{"style":1884},[7345],{"type":62,"value":4166},{"type":56,"tag":382,"props":7347,"children":7348},{"style":411},[7349],{"type":62,"value":1629},{"type":56,"tag":382,"props":7351,"children":7352},{"style":411},[7353],{"type":62,"value":1975},{"type":56,"tag":382,"props":7355,"children":7356},{"style":1884},[7357],{"type":62,"value":4179},{"type":56,"tag":382,"props":7359,"children":7360},{"style":411},[7361],{"type":62,"value":1629},{"type":56,"tag":382,"props":7363,"children":7364},{"style":2694},[7365],{"type":62,"value":2697},{"type":56,"tag":382,"props":7367,"children":7368},{"style":411},[7369],{"type":62,"value":3580},{"type":56,"tag":382,"props":7371,"children":7372},{"style":411},[7373],{"type":62,"value":3580},{"type":56,"tag":382,"props":7375,"children":7376},{"style":1884},[7377],{"type":62,"value":782},{"type":56,"tag":382,"props":7379,"children":7380},{"style":411},[7381],{"type":62,"value":2195},{"type":56,"tag":382,"props":7383,"children":7384},{"class":384,"line":1691},[7385,7389,7393],{"type":56,"tag":382,"props":7386,"children":7387},{"style":411},[7388],{"type":62,"value":3447},{"type":56,"tag":382,"props":7390,"children":7391},{"style":531},[7392],{"type":62,"value":782},{"type":56,"tag":382,"props":7394,"children":7395},{"style":411},[7396],{"type":62,"value":1674},{"type":56,"tag":382,"props":7398,"children":7399},{"class":384,"line":1813},[7400,7405,7409],{"type":56,"tag":382,"props":7401,"children":7402},{"style":1884},[7403],{"type":62,"value":7404},"    create",{"type":56,"tag":382,"props":7406,"children":7407},{"style":411},[7408],{"type":62,"value":1629},{"type":56,"tag":382,"props":7410,"children":7411},{"style":531},[7412],{"type":62,"value":7413}," protectedProcedure\n",{"type":56,"tag":382,"props":7415,"children":7416},{"class":384,"line":1822},[7417,7422,7426,7431,7435,7440,7444,7448,7452,7456,7461,7465,7470,7475,7479],{"type":56,"tag":382,"props":7418,"children":7419},{"style":411},[7420],{"type":62,"value":7421},"      .",{"type":56,"tag":382,"props":7423,"children":7424},{"style":399},[7425],{"type":62,"value":722},{"type":56,"tag":382,"props":7427,"children":7428},{"style":531},[7429],{"type":62,"value":7430},"(z",{"type":56,"tag":382,"props":7432,"children":7433},{"style":411},[7434],{"type":62,"value":1906},{"type":56,"tag":382,"props":7436,"children":7437},{"style":399},[7438],{"type":62,"value":7439},"object",{"type":56,"tag":382,"props":7441,"children":7442},{"style":531},[7443],{"type":62,"value":1994},{"type":56,"tag":382,"props":7445,"children":7446},{"style":411},[7447],{"type":62,"value":3634},{"type":56,"tag":382,"props":7449,"children":7450},{"style":1884},[7451],{"type":62,"value":4179},{"type":56,"tag":382,"props":7453,"children":7454},{"style":411},[7455],{"type":62,"value":1629},{"type":56,"tag":382,"props":7457,"children":7458},{"style":531},[7459],{"type":62,"value":7460}," z",{"type":56,"tag":382,"props":7462,"children":7463},{"style":411},[7464],{"type":62,"value":1906},{"type":56,"tag":382,"props":7466,"children":7467},{"style":399},[7468],{"type":62,"value":7469},"array",{"type":56,"tag":382,"props":7471,"children":7472},{"style":531},[7473],{"type":62,"value":7474},"(orderItemSchema) ",{"type":56,"tag":382,"props":7476,"children":7477},{"style":411},[7478],{"type":62,"value":2179},{"type":56,"tag":382,"props":7480,"children":7481},{"style":531},[7482],{"type":62,"value":7483},"))\n",{"type":56,"tag":382,"props":7485,"children":7486},{"class":384,"line":2296},[7487,7491,7496,7500,7504,7509,7514,7518,7523,7528,7532],{"type":56,"tag":382,"props":7488,"children":7489},{"style":411},[7490],{"type":62,"value":7421},{"type":56,"tag":382,"props":7492,"children":7493},{"style":399},[7494],{"type":62,"value":7495},"mutation",{"type":56,"tag":382,"props":7497,"children":7498},{"style":531},[7499],{"type":62,"value":1994},{"type":56,"tag":382,"props":7501,"children":7502},{"style":1579},[7503],{"type":62,"value":4246},{"type":56,"tag":382,"props":7505,"children":7506},{"style":411},[7507],{"type":62,"value":7508}," ({",{"type":56,"tag":382,"props":7510,"children":7511},{"style":1621},[7512],{"type":62,"value":7513}," input",{"type":56,"tag":382,"props":7515,"children":7516},{"style":411},[7517],{"type":62,"value":1639},{"type":56,"tag":382,"props":7519,"children":7520},{"style":1621},[7521],{"type":62,"value":7522}," ctx",{"type":56,"tag":382,"props":7524,"children":7525},{"style":411},[7526],{"type":62,"value":7527}," })",{"type":56,"tag":382,"props":7529,"children":7530},{"style":1579},[7531],{"type":62,"value":3219},{"type":56,"tag":382,"props":7533,"children":7534},{"style":411},[7535],{"type":62,"value":1592},{"type":56,"tag":382,"props":7537,"children":7538},{"class":384,"line":2381},[7539,7544,7549,7553,7557,7561,7566,7570,7575,7579,7583,7587,7591,7595],{"type":56,"tag":382,"props":7540,"children":7541},{"style":2182},[7542],{"type":62,"value":7543},"        return",{"type":56,"tag":382,"props":7545,"children":7546},{"style":531},[7547],{"type":62,"value":7548}," orderService",{"type":56,"tag":382,"props":7550,"children":7551},{"style":411},[7552],{"type":62,"value":1906},{"type":56,"tag":382,"props":7554,"children":7555},{"style":399},[7556],{"type":62,"value":4309},{"type":56,"tag":382,"props":7558,"children":7559},{"style":1884},[7560],{"type":62,"value":1994},{"type":56,"tag":382,"props":7562,"children":7563},{"style":531},[7564],{"type":62,"value":7565},"ctx",{"type":56,"tag":382,"props":7567,"children":7568},{"style":411},[7569],{"type":62,"value":1906},{"type":56,"tag":382,"props":7571,"children":7572},{"style":531},[7573],{"type":62,"value":7574},"user",{"type":56,"tag":382,"props":7576,"children":7577},{"style":411},[7578],{"type":62,"value":1906},{"type":56,"tag":382,"props":7580,"children":7581},{"style":531},[7582],{"type":62,"value":2859},{"type":56,"tag":382,"props":7584,"children":7585},{"style":411},[7586],{"type":62,"value":1639},{"type":56,"tag":382,"props":7588,"children":7589},{"style":531},[7590],{"type":62,"value":7513},{"type":56,"tag":382,"props":7592,"children":7593},{"style":1884},[7594],{"type":62,"value":782},{"type":56,"tag":382,"props":7596,"children":7597},{"style":411},[7598],{"type":62,"value":2195},{"type":56,"tag":382,"props":7600,"children":7601},{"class":384,"line":2398},[7602,7607,7611],{"type":56,"tag":382,"props":7603,"children":7604},{"style":411},[7605],{"type":62,"value":7606},"      }",{"type":56,"tag":382,"props":7608,"children":7609},{"style":531},[7610],{"type":62,"value":782},{"type":56,"tag":382,"props":7612,"children":7613},{"style":411},[7614],{"type":62,"value":1674},{"type":56,"tag":382,"props":7616,"children":7617},{"class":384,"line":2822},[7618,7622,7626],{"type":56,"tag":382,"props":7619,"children":7620},{"style":411},[7621],{"type":62,"value":5180},{"type":56,"tag":382,"props":7623,"children":7624},{"style":531},[7625],{"type":62,"value":782},{"type":56,"tag":382,"props":7627,"children":7628},{"style":411},[7629],{"type":62,"value":1674},{"type":56,"tag":382,"props":7631,"children":7632},{"class":384,"line":2900},[7633,7637,7641],{"type":56,"tag":382,"props":7634,"children":7635},{"style":411},[7636],{"type":62,"value":2179},{"type":56,"tag":382,"props":7638,"children":7639},{"style":531},[7640],{"type":62,"value":782},{"type":56,"tag":382,"props":7642,"children":7643},{"style":411},[7644],{"type":62,"value":2195},{"type":56,"tag":382,"props":7646,"children":7647},{"class":384,"line":2909},[7648,7652,7657,7662,7666,7671,7676],{"type":56,"tag":382,"props":7649,"children":7650},{"style":2182},[7651],{"type":62,"value":5484},{"type":56,"tag":382,"props":7653,"children":7654},{"style":1579},[7655],{"type":62,"value":7656}," type",{"type":56,"tag":382,"props":7658,"children":7659},{"style":417},[7660],{"type":62,"value":7661}," AppRouter",{"type":56,"tag":382,"props":7663,"children":7664},{"style":411},[7665],{"type":62,"value":2263},{"type":56,"tag":382,"props":7667,"children":7668},{"style":411},[7669],{"type":62,"value":7670}," typeof",{"type":56,"tag":382,"props":7672,"children":7673},{"style":531},[7674],{"type":62,"value":7675}," appRouter",{"type":56,"tag":382,"props":7677,"children":7678},{"style":411},[7679],{"type":62,"value":2195},{"type":56,"tag":382,"props":7681,"children":7682},{"class":384,"line":2917},[7683],{"type":56,"tag":382,"props":7684,"children":7685},{"emptyLinePlaceholder":724},[7686],{"type":62,"value":1802},{"type":56,"tag":382,"props":7688,"children":7689},{"class":384,"line":2942},[7690],{"type":56,"tag":382,"props":7691,"children":7692},{"style":389},[7693],{"type":62,"value":7694},"\u002F\u002F client: automatic type safety, no code generation\n",{"type":56,"tag":382,"props":7696,"children":7697},{"class":384,"line":2990},[7698,7702,7706,7711,7715,7719,7724,7728,7732,7736,7741,7745,7750,7754],{"type":56,"tag":382,"props":7699,"children":7700},{"style":1579},[7701],{"type":62,"value":1864},{"type":56,"tag":382,"props":7703,"children":7704},{"style":411},[7705],{"type":62,"value":1975},{"type":56,"tag":382,"props":7707,"children":7708},{"style":531},[7709],{"type":62,"value":7710}," data ",{"type":56,"tag":382,"props":7712,"children":7713},{"style":411},[7714],{"type":62,"value":2179},{"type":56,"tag":382,"props":7716,"children":7717},{"style":411},[7718],{"type":62,"value":2263},{"type":56,"tag":382,"props":7720,"children":7721},{"style":531},[7722],{"type":62,"value":7723}," trpc",{"type":56,"tag":382,"props":7725,"children":7726},{"style":411},[7727],{"type":62,"value":1906},{"type":56,"tag":382,"props":7729,"children":7730},{"style":531},[7731],{"type":62,"value":6488},{"type":56,"tag":382,"props":7733,"children":7734},{"style":411},[7735],{"type":62,"value":1906},{"type":56,"tag":382,"props":7737,"children":7738},{"style":531},[7739],{"type":62,"value":7740},"list",{"type":56,"tag":382,"props":7742,"children":7743},{"style":411},[7744],{"type":62,"value":1906},{"type":56,"tag":382,"props":7746,"children":7747},{"style":399},[7748],{"type":62,"value":7749},"useQuery",{"type":56,"tag":382,"props":7751,"children":7752},{"style":531},[7753],{"type":62,"value":3955},{"type":56,"tag":382,"props":7755,"children":7756},{"style":411},[7757],{"type":62,"value":2195},{"type":56,"tag":382,"props":7759,"children":7760},{"class":384,"line":3049},[7761,7765,7770,7774,7778,7782,7786,7790,7794,7798,7803,7807],{"type":56,"tag":382,"props":7762,"children":7763},{"style":1579},[7764],{"type":62,"value":1864},{"type":56,"tag":382,"props":7766,"children":7767},{"style":531},[7768],{"type":62,"value":7769}," createOrder ",{"type":56,"tag":382,"props":7771,"children":7772},{"style":411},[7773],{"type":62,"value":1874},{"type":56,"tag":382,"props":7775,"children":7776},{"style":531},[7777],{"type":62,"value":7723},{"type":56,"tag":382,"props":7779,"children":7780},{"style":411},[7781],{"type":62,"value":1906},{"type":56,"tag":382,"props":7783,"children":7784},{"style":531},[7785],{"type":62,"value":6488},{"type":56,"tag":382,"props":7787,"children":7788},{"style":411},[7789],{"type":62,"value":1906},{"type":56,"tag":382,"props":7791,"children":7792},{"style":531},[7793],{"type":62,"value":4309},{"type":56,"tag":382,"props":7795,"children":7796},{"style":411},[7797],{"type":62,"value":1906},{"type":56,"tag":382,"props":7799,"children":7800},{"style":399},[7801],{"type":62,"value":7802},"useMutation",{"type":56,"tag":382,"props":7804,"children":7805},{"style":531},[7806],{"type":62,"value":3955},{"type":56,"tag":382,"props":7808,"children":7809},{"style":411},[7810],{"type":62,"value":2195},{"type":56,"tag":82,"props":7812,"children":7814},{"id":7813},"option-d-openapi-generated-client-public-multi-consumer-apis",[7815],{"type":62,"value":7816},"Option D: OpenAPI Generated Client (Public \u002F Multi-Consumer APIs)",{"type":56,"tag":370,"props":7818,"children":7820},{"className":372,"code":7819,"language":374,"meta":375,"style":375},"npx openapi-typescript-codegen \\\n  --input http:\u002F\u002Flocalhost:3001\u002Fapi\u002Fopenapi.json \\\n  --output src\u002Fgenerated\u002Fapi \\\n  --client axios\n",[7821],{"type":56,"tag":378,"props":7822,"children":7823},{"__ignoreMap":375},[7824,7841,7858,7875],{"type":56,"tag":382,"props":7825,"children":7826},{"class":384,"line":385},[7827,7831,7836],{"type":56,"tag":382,"props":7828,"children":7829},{"style":417},[7830],{"type":62,"value":3776},{"type":56,"tag":382,"props":7832,"children":7833},{"style":405},[7834],{"type":62,"value":7835}," openapi-typescript-codegen",{"type":56,"tag":382,"props":7837,"children":7838},{"style":531},[7839],{"type":62,"value":7840}," \\\n",{"type":56,"tag":382,"props":7842,"children":7843},{"class":384,"line":395},[7844,7849,7854],{"type":56,"tag":382,"props":7845,"children":7846},{"style":405},[7847],{"type":62,"value":7848},"  --input",{"type":56,"tag":382,"props":7850,"children":7851},{"style":405},[7852],{"type":62,"value":7853}," http:\u002F\u002Flocalhost:3001\u002Fapi\u002Fopenapi.json",{"type":56,"tag":382,"props":7855,"children":7856},{"style":531},[7857],{"type":62,"value":7840},{"type":56,"tag":382,"props":7859,"children":7860},{"class":384,"line":433},[7861,7866,7871],{"type":56,"tag":382,"props":7862,"children":7863},{"style":405},[7864],{"type":62,"value":7865},"  --output",{"type":56,"tag":382,"props":7867,"children":7868},{"style":405},[7869],{"type":62,"value":7870}," src\u002Fgenerated\u002Fapi",{"type":56,"tag":382,"props":7872,"children":7873},{"style":531},[7874],{"type":62,"value":7840},{"type":56,"tag":382,"props":7876,"children":7877},{"class":384,"line":442},[7878,7883],{"type":56,"tag":382,"props":7879,"children":7880},{"style":405},[7881],{"type":62,"value":7882},"  --client",{"type":56,"tag":382,"props":7884,"children":7885},{"style":405},[7886],{"type":62,"value":7887}," axios\n",{"type":56,"tag":82,"props":7889,"children":7891},{"id":7890},"decision-which-api-client",[7892],{"type":62,"value":7893},"Decision: Which API Client?",{"type":56,"tag":175,"props":7895,"children":7896},{},[7897,7923],{"type":56,"tag":179,"props":7898,"children":7899},{},[7900],{"type":56,"tag":183,"props":7901,"children":7902},{},[7903,7908,7913,7918],{"type":56,"tag":187,"props":7904,"children":7905},{},[7906],{"type":62,"value":7907},"Approach",{"type":56,"tag":187,"props":7909,"children":7910},{},[7911],{"type":62,"value":7912},"When",{"type":56,"tag":187,"props":7914,"children":7915},{},[7916],{"type":62,"value":7917},"Type Safety",{"type":56,"tag":187,"props":7919,"children":7920},{},[7921],{"type":62,"value":7922},"Effort",{"type":56,"tag":203,"props":7924,"children":7925},{},[7926,7949,7971,7993,8014],{"type":56,"tag":183,"props":7927,"children":7928},{},[7929,7934,7939,7944],{"type":56,"tag":210,"props":7930,"children":7931},{},[7932],{"type":62,"value":7933},"Typed fetch wrapper",{"type":56,"tag":210,"props":7935,"children":7936},{},[7937],{"type":62,"value":7938},"Simple apps, small teams",{"type":56,"tag":210,"props":7940,"children":7941},{},[7942],{"type":62,"value":7943},"Manual types",{"type":56,"tag":210,"props":7945,"children":7946},{},[7947],{"type":62,"value":7948},"Low",{"type":56,"tag":183,"props":7950,"children":7951},{},[7952,7957,7962,7966],{"type":56,"tag":210,"props":7953,"children":7954},{},[7955],{"type":62,"value":7956},"React Query + fetch",{"type":56,"tag":210,"props":7958,"children":7959},{},[7960],{"type":62,"value":7961},"React apps, server state",{"type":56,"tag":210,"props":7963,"children":7964},{},[7965],{"type":62,"value":7943},{"type":56,"tag":210,"props":7967,"children":7968},{},[7969],{"type":62,"value":7970},"Medium",{"type":56,"tag":183,"props":7972,"children":7973},{},[7974,7979,7984,7989],{"type":56,"tag":210,"props":7975,"children":7976},{},[7977],{"type":62,"value":7978},"tRPC",{"type":56,"tag":210,"props":7980,"children":7981},{},[7982],{"type":62,"value":7983},"Same team, TypeScript both sides",{"type":56,"tag":210,"props":7985,"children":7986},{},[7987],{"type":62,"value":7988},"Automatic",{"type":56,"tag":210,"props":7990,"children":7991},{},[7992],{"type":62,"value":7948},{"type":56,"tag":183,"props":7994,"children":7995},{},[7996,8001,8006,8010],{"type":56,"tag":210,"props":7997,"children":7998},{},[7999],{"type":62,"value":8000},"OpenAPI generated",{"type":56,"tag":210,"props":8002,"children":8003},{},[8004],{"type":62,"value":8005},"Public API, multi-consumer",{"type":56,"tag":210,"props":8007,"children":8008},{},[8009],{"type":62,"value":7988},{"type":56,"tag":210,"props":8011,"children":8012},{},[8013],{"type":62,"value":7970},{"type":56,"tag":183,"props":8015,"children":8016},{},[8017,8022,8027,8031],{"type":56,"tag":210,"props":8018,"children":8019},{},[8020],{"type":62,"value":8021},"GraphQL codegen",{"type":56,"tag":210,"props":8023,"children":8024},{},[8025],{"type":62,"value":8026},"GraphQL APIs",{"type":56,"tag":210,"props":8028,"children":8029},{},[8030],{"type":62,"value":7988},{"type":56,"tag":210,"props":8032,"children":8033},{},[8034],{"type":62,"value":7970},{"type":56,"tag":621,"props":8036,"children":8037},{},[],{"type":56,"tag":65,"props":8039,"children":8041},{"id":8040},"_6-authentication-middleware-high",[8042],{"type":62,"value":8043},"6. Authentication & Middleware (HIGH)",{"type":56,"tag":8045,"props":8046,"children":8047},"blockquote",{},[8048],{"type":56,"tag":72,"props":8049,"children":8050},{},[8051,8056,8057,8061],{"type":56,"tag":76,"props":8052,"children":8053},{},[8054],{"type":62,"value":8055},"Full reference:",{"type":62,"value":767},{"type":56,"tag":224,"props":8058,"children":8059},{"href":1393},[8060],{"type":62,"value":1393},{"type":62,"value":8062}," — JWT bearer flow, automatic token refresh, Next.js server-side auth, RBAC pattern, backend middleware order.",{"type":56,"tag":82,"props":8064,"children":8066},{"id":8065},"standard-middleware-order",[8067],{"type":62,"value":8068},"Standard Middleware Order",{"type":56,"tag":370,"props":8070,"children":8073},{"className":8071,"code":8072,"language":62},[1424],"Request → 1.RequestID → 2.Logging → 3.CORS → 4.RateLimit → 5.BodyParse\n       → 6.Auth → 7.Authz → 8.Validation → 9.Handler → 10.ErrorHandler → Response\n",[8074],{"type":56,"tag":378,"props":8075,"children":8076},{"__ignoreMap":375},[8077],{"type":62,"value":8072},{"type":56,"tag":82,"props":8079,"children":8081},{"id":8080},"jwt-rules",[8082],{"type":62,"value":8083},"JWT Rules",{"type":56,"tag":370,"props":8085,"children":8088},{"className":8086,"code":8087,"language":62},[1424],"✅ Short expiry access token (15min) + refresh token (server-stored)\n✅ Minimal claims: userId, roles (not entire user object)\n✅ Rotate signing keys periodically\n\n❌ Never store tokens in localStorage (XSS risk)\n❌ Never pass tokens in URL query params\n",[8089],{"type":56,"tag":378,"props":8090,"children":8091},{"__ignoreMap":375},[8092],{"type":62,"value":8087},{"type":56,"tag":82,"props":8094,"children":8096},{"id":8095},"rbac-pattern",[8097],{"type":62,"value":8098},"RBAC Pattern",{"type":56,"tag":370,"props":8100,"children":8102},{"className":1567,"code":8101,"language":1569,"meta":375,"style":375},"function authorize(...roles: Role[]) {\n  return (req, res, next) => {\n    if (!req.user) throw new UnauthorizedError();\n    if (!roles.some(r => req.user.roles.includes(r))) throw new ForbiddenError();\n    next();\n  };\n}\nrouter.delete('\u002Fusers\u002F:id', authenticate, authorize('admin'), deleteUser);\n",[8103],{"type":56,"tag":378,"props":8104,"children":8105},{"__ignoreMap":375},[8106,8149,8193,8246,8350,8366,8374,8381],{"type":56,"tag":382,"props":8107,"children":8108},{"class":384,"line":385},[8109,8113,8118,8123,8128,8132,8137,8141,8145],{"type":56,"tag":382,"props":8110,"children":8111},{"style":1579},[8112],{"type":62,"value":2210},{"type":56,"tag":382,"props":8114,"children":8115},{"style":399},[8116],{"type":62,"value":8117}," authorize",{"type":56,"tag":382,"props":8119,"children":8120},{"style":411},[8121],{"type":62,"value":8122},"(...",{"type":56,"tag":382,"props":8124,"children":8125},{"style":1621},[8126],{"type":62,"value":8127},"roles",{"type":56,"tag":382,"props":8129,"children":8130},{"style":411},[8131],{"type":62,"value":1629},{"type":56,"tag":382,"props":8133,"children":8134},{"style":417},[8135],{"type":62,"value":8136}," Role",{"type":56,"tag":382,"props":8138,"children":8139},{"style":531},[8140],{"type":62,"value":2979},{"type":56,"tag":382,"props":8142,"children":8143},{"style":411},[8144],{"type":62,"value":782},{"type":56,"tag":382,"props":8146,"children":8147},{"style":411},[8148],{"type":62,"value":1592},{"type":56,"tag":382,"props":8150,"children":8151},{"class":384,"line":395},[8152,8156,8160,8165,8169,8173,8177,8181,8185,8189],{"type":56,"tag":382,"props":8153,"children":8154},{"style":2182},[8155],{"type":62,"value":2387},{"type":56,"tag":382,"props":8157,"children":8158},{"style":411},[8159],{"type":62,"value":2307},{"type":56,"tag":382,"props":8161,"children":8162},{"style":1621},[8163],{"type":62,"value":8164},"req",{"type":56,"tag":382,"props":8166,"children":8167},{"style":411},[8168],{"type":62,"value":1639},{"type":56,"tag":382,"props":8170,"children":8171},{"style":1621},[8172],{"type":62,"value":3201},{"type":56,"tag":382,"props":8174,"children":8175},{"style":411},[8176],{"type":62,"value":1639},{"type":56,"tag":382,"props":8178,"children":8179},{"style":1621},[8180],{"type":62,"value":3210},{"type":56,"tag":382,"props":8182,"children":8183},{"style":411},[8184],{"type":62,"value":782},{"type":56,"tag":382,"props":8186,"children":8187},{"style":1579},[8188],{"type":62,"value":3219},{"type":56,"tag":382,"props":8190,"children":8191},{"style":411},[8192],{"type":62,"value":1592},{"type":56,"tag":382,"props":8194,"children":8195},{"class":384,"line":433},[8196,8201,8205,8209,8213,8217,8221,8225,8229,8233,8238,8242],{"type":56,"tag":382,"props":8197,"children":8198},{"style":2182},[8199],{"type":62,"value":8200},"    if",{"type":56,"tag":382,"props":8202,"children":8203},{"style":1884},[8204],{"type":62,"value":2307},{"type":56,"tag":382,"props":8206,"children":8207},{"style":411},[8208],{"type":62,"value":2312},{"type":56,"tag":382,"props":8210,"children":8211},{"style":531},[8212],{"type":62,"value":8164},{"type":56,"tag":382,"props":8214,"children":8215},{"style":411},[8216],{"type":62,"value":1906},{"type":56,"tag":382,"props":8218,"children":8219},{"style":531},[8220],{"type":62,"value":7574},{"type":56,"tag":382,"props":8222,"children":8223},{"style":1884},[8224],{"type":62,"value":2059},{"type":56,"tag":382,"props":8226,"children":8227},{"style":2182},[8228],{"type":62,"value":2326},{"type":56,"tag":382,"props":8230,"children":8231},{"style":411},[8232],{"type":62,"value":2331},{"type":56,"tag":382,"props":8234,"children":8235},{"style":399},[8236],{"type":62,"value":8237}," UnauthorizedError",{"type":56,"tag":382,"props":8239,"children":8240},{"style":1884},[8241],{"type":62,"value":3955},{"type":56,"tag":382,"props":8243,"children":8244},{"style":411},[8245],{"type":62,"value":2195},{"type":56,"tag":382,"props":8247,"children":8248},{"class":384,"line":442},[8249,8253,8257,8261,8265,8269,8274,8278,8283,8287,8291,8295,8299,8303,8307,8311,8316,8320,8324,8329,8333,8337,8342,8346],{"type":56,"tag":382,"props":8250,"children":8251},{"style":2182},[8252],{"type":62,"value":8200},{"type":56,"tag":382,"props":8254,"children":8255},{"style":1884},[8256],{"type":62,"value":2307},{"type":56,"tag":382,"props":8258,"children":8259},{"style":411},[8260],{"type":62,"value":2312},{"type":56,"tag":382,"props":8262,"children":8263},{"style":531},[8264],{"type":62,"value":8127},{"type":56,"tag":382,"props":8266,"children":8267},{"style":411},[8268],{"type":62,"value":1906},{"type":56,"tag":382,"props":8270,"children":8271},{"style":399},[8272],{"type":62,"value":8273},"some",{"type":56,"tag":382,"props":8275,"children":8276},{"style":1884},[8277],{"type":62,"value":1994},{"type":56,"tag":382,"props":8279,"children":8280},{"style":1621},[8281],{"type":62,"value":8282},"r",{"type":56,"tag":382,"props":8284,"children":8285},{"style":1579},[8286],{"type":62,"value":3219},{"type":56,"tag":382,"props":8288,"children":8289},{"style":531},[8290],{"type":62,"value":3192},{"type":56,"tag":382,"props":8292,"children":8293},{"style":411},[8294],{"type":62,"value":1906},{"type":56,"tag":382,"props":8296,"children":8297},{"style":531},[8298],{"type":62,"value":7574},{"type":56,"tag":382,"props":8300,"children":8301},{"style":411},[8302],{"type":62,"value":1906},{"type":56,"tag":382,"props":8304,"children":8305},{"style":531},[8306],{"type":62,"value":8127},{"type":56,"tag":382,"props":8308,"children":8309},{"style":411},[8310],{"type":62,"value":1906},{"type":56,"tag":382,"props":8312,"children":8313},{"style":399},[8314],{"type":62,"value":8315},"includes",{"type":56,"tag":382,"props":8317,"children":8318},{"style":1884},[8319],{"type":62,"value":1994},{"type":56,"tag":382,"props":8321,"children":8322},{"style":531},[8323],{"type":62,"value":8282},{"type":56,"tag":382,"props":8325,"children":8326},{"style":1884},[8327],{"type":62,"value":8328},"))) ",{"type":56,"tag":382,"props":8330,"children":8331},{"style":2182},[8332],{"type":62,"value":2326},{"type":56,"tag":382,"props":8334,"children":8335},{"style":411},[8336],{"type":62,"value":2331},{"type":56,"tag":382,"props":8338,"children":8339},{"style":399},[8340],{"type":62,"value":8341}," ForbiddenError",{"type":56,"tag":382,"props":8343,"children":8344},{"style":1884},[8345],{"type":62,"value":3955},{"type":56,"tag":382,"props":8347,"children":8348},{"style":411},[8349],{"type":62,"value":2195},{"type":56,"tag":382,"props":8351,"children":8352},{"class":384,"line":1677},[8353,8358,8362],{"type":56,"tag":382,"props":8354,"children":8355},{"style":399},[8356],{"type":62,"value":8357},"    next",{"type":56,"tag":382,"props":8359,"children":8360},{"style":1884},[8361],{"type":62,"value":3955},{"type":56,"tag":382,"props":8363,"children":8364},{"style":411},[8365],{"type":62,"value":2195},{"type":56,"tag":382,"props":8367,"children":8368},{"class":384,"line":1691},[8369],{"type":56,"tag":382,"props":8370,"children":8371},{"style":411},[8372],{"type":62,"value":8373},"  };\n",{"type":56,"tag":382,"props":8375,"children":8376},{"class":384,"line":1813},[8377],{"type":56,"tag":382,"props":8378,"children":8379},{"style":411},[8380],{"type":62,"value":1697},{"type":56,"tag":382,"props":8382,"children":8383},{"class":384,"line":1822},[8384,8389,8393,8398,8402,8406,8411,8415,8419,8424,8428,8432,8436,8440,8445,8449,8453,8457,8462],{"type":56,"tag":382,"props":8385,"children":8386},{"style":531},[8387],{"type":62,"value":8388},"router",{"type":56,"tag":382,"props":8390,"children":8391},{"style":411},[8392],{"type":62,"value":1906},{"type":56,"tag":382,"props":8394,"children":8395},{"style":399},[8396],{"type":62,"value":8397},"delete",{"type":56,"tag":382,"props":8399,"children":8400},{"style":531},[8401],{"type":62,"value":1994},{"type":56,"tag":382,"props":8403,"children":8404},{"style":411},[8405],{"type":62,"value":1940},{"type":56,"tag":382,"props":8407,"children":8408},{"style":405},[8409],{"type":62,"value":8410},"\u002Fusers\u002F:id",{"type":56,"tag":382,"props":8412,"children":8413},{"style":411},[8414],{"type":62,"value":1940},{"type":56,"tag":382,"props":8416,"children":8417},{"style":411},[8418],{"type":62,"value":1639},{"type":56,"tag":382,"props":8420,"children":8421},{"style":531},[8422],{"type":62,"value":8423}," authenticate",{"type":56,"tag":382,"props":8425,"children":8426},{"style":411},[8427],{"type":62,"value":1639},{"type":56,"tag":382,"props":8429,"children":8430},{"style":399},[8431],{"type":62,"value":8117},{"type":56,"tag":382,"props":8433,"children":8434},{"style":531},[8435],{"type":62,"value":1994},{"type":56,"tag":382,"props":8437,"children":8438},{"style":411},[8439],{"type":62,"value":1940},{"type":56,"tag":382,"props":8441,"children":8442},{"style":405},[8443],{"type":62,"value":8444},"admin",{"type":56,"tag":382,"props":8446,"children":8447},{"style":411},[8448],{"type":62,"value":1940},{"type":56,"tag":382,"props":8450,"children":8451},{"style":531},[8452],{"type":62,"value":782},{"type":56,"tag":382,"props":8454,"children":8455},{"style":411},[8456],{"type":62,"value":1639},{"type":56,"tag":382,"props":8458,"children":8459},{"style":531},[8460],{"type":62,"value":8461}," deleteUser)",{"type":56,"tag":382,"props":8463,"children":8464},{"style":411},[8465],{"type":62,"value":2195},{"type":56,"tag":82,"props":8467,"children":8469},{"id":8468},"auth-token-automatic-refresh",[8470],{"type":62,"value":8471},"Auth Token Automatic Refresh",{"type":56,"tag":370,"props":8473,"children":8475},{"className":1567,"code":8474,"language":1569,"meta":375,"style":375},"\u002F\u002F lib\u002Fapi-client.ts — transparent refresh on 401\nasync function apiWithRefresh\u003CT>(path: string, options: RequestInit = {}): Promise\u003CT> {\n  try {\n    return await api\u003CT>(path, options);\n  } catch (err) {\n    if (err instanceof ApiError && err.status === 401) {\n      const refreshed = await api\u003C{ accessToken: string }>('\u002Fapi\u002Fauth\u002Frefresh', {\n        method: 'POST',\n        credentials: 'include',  \u002F\u002F send httpOnly cookie\n      });\n      setAuthToken(refreshed.accessToken);\n      return api\u003CT>(path, options);  \u002F\u002F retry\n    }\n    throw err;\n  }\n}\n",[8476],{"type":56,"tag":378,"props":8477,"children":8478},{"__ignoreMap":375},[8479,8487,8571,8583,8634,8662,8718,8789,8817,8851,8866,8900,8952,8960,8975,8982],{"type":56,"tag":382,"props":8480,"children":8481},{"class":384,"line":385},[8482],{"type":56,"tag":382,"props":8483,"children":8484},{"style":389},[8485],{"type":62,"value":8486},"\u002F\u002F lib\u002Fapi-client.ts — transparent refresh on 401\n",{"type":56,"tag":382,"props":8488,"children":8489},{"class":384,"line":395},[8490,8494,8498,8503,8507,8511,8515,8519,8523,8527,8531,8535,8539,8543,8547,8551,8555,8559,8563,8567],{"type":56,"tag":382,"props":8491,"children":8492},{"style":1579},[8493],{"type":62,"value":4246},{"type":56,"tag":382,"props":8495,"children":8496},{"style":1579},[8497],{"type":62,"value":4810},{"type":56,"tag":382,"props":8499,"children":8500},{"style":399},[8501],{"type":62,"value":8502}," apiWithRefresh",{"type":56,"tag":382,"props":8504,"children":8505},{"style":411},[8506],{"type":62,"value":523},{"type":56,"tag":382,"props":8508,"children":8509},{"style":417},[8510],{"type":62,"value":4824},{"type":56,"tag":382,"props":8512,"children":8513},{"style":411},[8514],{"type":62,"value":4829},{"type":56,"tag":382,"props":8516,"children":8517},{"style":1621},[8518],{"type":62,"value":4834},{"type":56,"tag":382,"props":8520,"children":8521},{"style":411},[8522],{"type":62,"value":1629},{"type":56,"tag":382,"props":8524,"children":8525},{"style":417},[8526],{"type":62,"value":2232},{"type":56,"tag":382,"props":8528,"children":8529},{"style":411},[8530],{"type":62,"value":1639},{"type":56,"tag":382,"props":8532,"children":8533},{"style":1621},[8534],{"type":62,"value":4851},{"type":56,"tag":382,"props":8536,"children":8537},{"style":411},[8538],{"type":62,"value":1629},{"type":56,"tag":382,"props":8540,"children":8541},{"style":417},[8542],{"type":62,"value":4860},{"type":56,"tag":382,"props":8544,"children":8545},{"style":411},[8546],{"type":62,"value":2263},{"type":56,"tag":382,"props":8548,"children":8549},{"style":411},[8550],{"type":62,"value":4869},{"type":56,"tag":382,"props":8552,"children":8553},{"style":417},[8554],{"type":62,"value":4874},{"type":56,"tag":382,"props":8556,"children":8557},{"style":411},[8558],{"type":62,"value":523},{"type":56,"tag":382,"props":8560,"children":8561},{"style":417},[8562],{"type":62,"value":4824},{"type":56,"tag":382,"props":8564,"children":8565},{"style":411},[8566],{"type":62,"value":4887},{"type":56,"tag":382,"props":8568,"children":8569},{"style":411},[8570],{"type":62,"value":1592},{"type":56,"tag":382,"props":8572,"children":8573},{"class":384,"line":433},[8574,8579],{"type":56,"tag":382,"props":8575,"children":8576},{"style":2182},[8577],{"type":62,"value":8578},"  try",{"type":56,"tag":382,"props":8580,"children":8581},{"style":411},[8582],{"type":62,"value":1592},{"type":56,"tag":382,"props":8584,"children":8585},{"class":384,"line":442},[8586,8590,8594,8598,8602,8606,8610,8614,8618,8622,8626,8630],{"type":56,"tag":382,"props":8587,"children":8588},{"style":2182},[8589],{"type":62,"value":3282},{"type":56,"tag":382,"props":8591,"children":8592},{"style":2182},[8593],{"type":62,"value":3927},{"type":56,"tag":382,"props":8595,"children":8596},{"style":399},[8597],{"type":62,"value":4815},{"type":56,"tag":382,"props":8599,"children":8600},{"style":411},[8601],{"type":62,"value":523},{"type":56,"tag":382,"props":8603,"children":8604},{"style":417},[8605],{"type":62,"value":4824},{"type":56,"tag":382,"props":8607,"children":8608},{"style":411},[8609],{"type":62,"value":4887},{"type":56,"tag":382,"props":8611,"children":8612},{"style":1884},[8613],{"type":62,"value":1994},{"type":56,"tag":382,"props":8615,"children":8616},{"style":531},[8617],{"type":62,"value":4834},{"type":56,"tag":382,"props":8619,"children":8620},{"style":411},[8621],{"type":62,"value":1639},{"type":56,"tag":382,"props":8623,"children":8624},{"style":531},[8625],{"type":62,"value":4851},{"type":56,"tag":382,"props":8627,"children":8628},{"style":1884},[8629],{"type":62,"value":782},{"type":56,"tag":382,"props":8631,"children":8632},{"style":411},[8633],{"type":62,"value":2195},{"type":56,"tag":382,"props":8635,"children":8636},{"class":384,"line":1677},[8637,8641,8646,8650,8654,8658],{"type":56,"tag":382,"props":8638,"children":8639},{"style":411},[8640],{"type":62,"value":5180},{"type":56,"tag":382,"props":8642,"children":8643},{"style":2182},[8644],{"type":62,"value":8645}," catch",{"type":56,"tag":382,"props":8647,"children":8648},{"style":1884},[8649],{"type":62,"value":2307},{"type":56,"tag":382,"props":8651,"children":8652},{"style":531},[8653],{"type":62,"value":3183},{"type":56,"tag":382,"props":8655,"children":8656},{"style":1884},[8657],{"type":62,"value":2059},{"type":56,"tag":382,"props":8659,"children":8660},{"style":411},[8661],{"type":62,"value":3274},{"type":56,"tag":382,"props":8663,"children":8664},{"class":384,"line":1691},[8665,8669,8673,8677,8681,8685,8689,8693,8697,8701,8705,8710,8714],{"type":56,"tag":382,"props":8666,"children":8667},{"style":2182},[8668],{"type":62,"value":8200},{"type":56,"tag":382,"props":8670,"children":8671},{"style":1884},[8672],{"type":62,"value":2307},{"type":56,"tag":382,"props":8674,"children":8675},{"style":531},[8676],{"type":62,"value":3183},{"type":56,"tag":382,"props":8678,"children":8679},{"style":411},[8680],{"type":62,"value":3243},{"type":56,"tag":382,"props":8682,"children":8683},{"style":417},[8684],{"type":62,"value":4630},{"type":56,"tag":382,"props":8686,"children":8687},{"style":411},[8688],{"type":62,"value":414},{"type":56,"tag":382,"props":8690,"children":8691},{"style":531},[8692],{"type":62,"value":3256},{"type":56,"tag":382,"props":8694,"children":8695},{"style":411},[8696],{"type":62,"value":1906},{"type":56,"tag":382,"props":8698,"children":8699},{"style":531},[8700],{"type":62,"value":3295},{"type":56,"tag":382,"props":8702,"children":8703},{"style":411},[8704],{"type":62,"value":5399},{"type":56,"tag":382,"props":8706,"children":8707},{"style":1947},[8708],{"type":62,"value":8709}," 401",{"type":56,"tag":382,"props":8711,"children":8712},{"style":1884},[8713],{"type":62,"value":2059},{"type":56,"tag":382,"props":8715,"children":8716},{"style":411},[8717],{"type":62,"value":3274},{"type":56,"tag":382,"props":8719,"children":8720},{"class":384,"line":1813},[8721,8726,8731,8735,8739,8743,8747,8752,8756,8760,8764,8768,8772,8777,8781,8785],{"type":56,"tag":382,"props":8722,"children":8723},{"style":1579},[8724],{"type":62,"value":8725},"      const",{"type":56,"tag":382,"props":8727,"children":8728},{"style":531},[8729],{"type":62,"value":8730}," refreshed",{"type":56,"tag":382,"props":8732,"children":8733},{"style":411},[8734],{"type":62,"value":2263},{"type":56,"tag":382,"props":8736,"children":8737},{"style":2182},[8738],{"type":62,"value":3927},{"type":56,"tag":382,"props":8740,"children":8741},{"style":399},[8742],{"type":62,"value":4815},{"type":56,"tag":382,"props":8744,"children":8745},{"style":411},[8746],{"type":62,"value":6539},{"type":56,"tag":382,"props":8748,"children":8749},{"style":1884},[8750],{"type":62,"value":8751}," accessToken",{"type":56,"tag":382,"props":8753,"children":8754},{"style":411},[8755],{"type":62,"value":1629},{"type":56,"tag":382,"props":8757,"children":8758},{"style":417},[8759],{"type":62,"value":2232},{"type":56,"tag":382,"props":8761,"children":8762},{"style":411},[8763],{"type":62,"value":6797},{"type":56,"tag":382,"props":8765,"children":8766},{"style":1884},[8767],{"type":62,"value":1994},{"type":56,"tag":382,"props":8769,"children":8770},{"style":411},[8771],{"type":62,"value":1940},{"type":56,"tag":382,"props":8773,"children":8774},{"style":405},[8775],{"type":62,"value":8776},"\u002Fapi\u002Fauth\u002Frefresh",{"type":56,"tag":382,"props":8778,"children":8779},{"style":411},[8780],{"type":62,"value":1940},{"type":56,"tag":382,"props":8782,"children":8783},{"style":411},[8784],{"type":62,"value":1639},{"type":56,"tag":382,"props":8786,"children":8787},{"style":411},[8788],{"type":62,"value":1592},{"type":56,"tag":382,"props":8790,"children":8791},{"class":384,"line":1822},[8792,8797,8801,8805,8809,8813],{"type":56,"tag":382,"props":8793,"children":8794},{"style":1884},[8795],{"type":62,"value":8796},"        method",{"type":56,"tag":382,"props":8798,"children":8799},{"style":411},[8800],{"type":62,"value":1629},{"type":56,"tag":382,"props":8802,"children":8803},{"style":411},[8804],{"type":62,"value":1930},{"type":56,"tag":382,"props":8806,"children":8807},{"style":405},[8808],{"type":62,"value":5681},{"type":56,"tag":382,"props":8810,"children":8811},{"style":411},[8812],{"type":62,"value":1940},{"type":56,"tag":382,"props":8814,"children":8815},{"style":411},[8816],{"type":62,"value":1674},{"type":56,"tag":382,"props":8818,"children":8819},{"class":384,"line":2296},[8820,8825,8829,8833,8838,8842,8846],{"type":56,"tag":382,"props":8821,"children":8822},{"style":1884},[8823],{"type":62,"value":8824},"        credentials",{"type":56,"tag":382,"props":8826,"children":8827},{"style":411},[8828],{"type":62,"value":1629},{"type":56,"tag":382,"props":8830,"children":8831},{"style":411},[8832],{"type":62,"value":1930},{"type":56,"tag":382,"props":8834,"children":8835},{"style":405},[8836],{"type":62,"value":8837},"include",{"type":56,"tag":382,"props":8839,"children":8840},{"style":411},[8841],{"type":62,"value":1940},{"type":56,"tag":382,"props":8843,"children":8844},{"style":411},[8845],{"type":62,"value":1639},{"type":56,"tag":382,"props":8847,"children":8848},{"style":389},[8849],{"type":62,"value":8850},"  \u002F\u002F send httpOnly cookie\n",{"type":56,"tag":382,"props":8852,"children":8853},{"class":384,"line":2381},[8854,8858,8862],{"type":56,"tag":382,"props":8855,"children":8856},{"style":411},[8857],{"type":62,"value":7606},{"type":56,"tag":382,"props":8859,"children":8860},{"style":1884},[8861],{"type":62,"value":782},{"type":56,"tag":382,"props":8863,"children":8864},{"style":411},[8865],{"type":62,"value":2195},{"type":56,"tag":382,"props":8867,"children":8868},{"class":384,"line":2398},[8869,8874,8878,8883,8887,8892,8896],{"type":56,"tag":382,"props":8870,"children":8871},{"style":399},[8872],{"type":62,"value":8873},"      setAuthToken",{"type":56,"tag":382,"props":8875,"children":8876},{"style":1884},[8877],{"type":62,"value":1994},{"type":56,"tag":382,"props":8879,"children":8880},{"style":531},[8881],{"type":62,"value":8882},"refreshed",{"type":56,"tag":382,"props":8884,"children":8885},{"style":411},[8886],{"type":62,"value":1906},{"type":56,"tag":382,"props":8888,"children":8889},{"style":531},[8890],{"type":62,"value":8891},"accessToken",{"type":56,"tag":382,"props":8893,"children":8894},{"style":1884},[8895],{"type":62,"value":782},{"type":56,"tag":382,"props":8897,"children":8898},{"style":411},[8899],{"type":62,"value":2195},{"type":56,"tag":382,"props":8901,"children":8902},{"class":384,"line":2822},[8903,8907,8911,8915,8919,8923,8927,8931,8935,8939,8943,8947],{"type":56,"tag":382,"props":8904,"children":8905},{"style":2182},[8906],{"type":62,"value":7313},{"type":56,"tag":382,"props":8908,"children":8909},{"style":399},[8910],{"type":62,"value":4815},{"type":56,"tag":382,"props":8912,"children":8913},{"style":411},[8914],{"type":62,"value":523},{"type":56,"tag":382,"props":8916,"children":8917},{"style":417},[8918],{"type":62,"value":4824},{"type":56,"tag":382,"props":8920,"children":8921},{"style":411},[8922],{"type":62,"value":4887},{"type":56,"tag":382,"props":8924,"children":8925},{"style":1884},[8926],{"type":62,"value":1994},{"type":56,"tag":382,"props":8928,"children":8929},{"style":531},[8930],{"type":62,"value":4834},{"type":56,"tag":382,"props":8932,"children":8933},{"style":411},[8934],{"type":62,"value":1639},{"type":56,"tag":382,"props":8936,"children":8937},{"style":531},[8938],{"type":62,"value":4851},{"type":56,"tag":382,"props":8940,"children":8941},{"style":1884},[8942],{"type":62,"value":782},{"type":56,"tag":382,"props":8944,"children":8945},{"style":411},[8946],{"type":62,"value":2373},{"type":56,"tag":382,"props":8948,"children":8949},{"style":389},[8950],{"type":62,"value":8951},"  \u002F\u002F retry\n",{"type":56,"tag":382,"props":8953,"children":8954},{"class":384,"line":2900},[8955],{"type":56,"tag":382,"props":8956,"children":8957},{"style":411},[8958],{"type":62,"value":8959},"    }\n",{"type":56,"tag":382,"props":8961,"children":8962},{"class":384,"line":2909},[8963,8967,8971],{"type":56,"tag":382,"props":8964,"children":8965},{"style":2182},[8966],{"type":62,"value":5314},{"type":56,"tag":382,"props":8968,"children":8969},{"style":531},[8970],{"type":62,"value":3256},{"type":56,"tag":382,"props":8972,"children":8973},{"style":411},[8974],{"type":62,"value":2195},{"type":56,"tag":382,"props":8976,"children":8977},{"class":384,"line":2917},[8978],{"type":56,"tag":382,"props":8979,"children":8980},{"style":411},[8981],{"type":62,"value":2906},{"type":56,"tag":382,"props":8983,"children":8984},{"class":384,"line":2942},[8985],{"type":56,"tag":382,"props":8986,"children":8987},{"style":411},[8988],{"type":62,"value":1697},{"type":56,"tag":621,"props":8990,"children":8991},{},[],{"type":56,"tag":65,"props":8993,"children":8995},{"id":8994},"_7-logging-observability-medium-high",[8996],{"type":62,"value":8997},"7. Logging & Observability (MEDIUM-HIGH)",{"type":56,"tag":82,"props":8999,"children":9001},{"id":9000},"structured-json-logging",[9002],{"type":62,"value":9003},"Structured JSON Logging",{"type":56,"tag":370,"props":9005,"children":9007},{"className":1567,"code":9006,"language":1569,"meta":375,"style":375},"\u002F\u002F ✅ Structured — parseable, filterable, alertable\nlogger.info('Order created', {\n  orderId: order.id, userId: user.id, total: order.total,\n  items: order.items.length, duration_ms: Date.now() - startTime,\n});\n\u002F\u002F Output: {\"level\":\"info\",\"msg\":\"Order created\",\"orderId\":\"ord_123\",...}\n\n\u002F\u002F ❌ Unstructured — useless at scale\nconsole.log(`Order created for user ${user.id} with total ${order.total}`);\n",[9008],{"type":56,"tag":378,"props":9009,"children":9010},{"__ignoreMap":375},[9011,9019,9061,9140,9219,9234,9242,9249,9257],{"type":56,"tag":382,"props":9012,"children":9013},{"class":384,"line":385},[9014],{"type":56,"tag":382,"props":9015,"children":9016},{"style":389},[9017],{"type":62,"value":9018},"\u002F\u002F ✅ Structured — parseable, filterable, alertable\n",{"type":56,"tag":382,"props":9020,"children":9021},{"class":384,"line":395},[9022,9027,9031,9036,9040,9044,9049,9053,9057],{"type":56,"tag":382,"props":9023,"children":9024},{"style":531},[9025],{"type":62,"value":9026},"logger",{"type":56,"tag":382,"props":9028,"children":9029},{"style":411},[9030],{"type":62,"value":1906},{"type":56,"tag":382,"props":9032,"children":9033},{"style":399},[9034],{"type":62,"value":9035},"info",{"type":56,"tag":382,"props":9037,"children":9038},{"style":531},[9039],{"type":62,"value":1994},{"type":56,"tag":382,"props":9041,"children":9042},{"style":411},[9043],{"type":62,"value":1940},{"type":56,"tag":382,"props":9045,"children":9046},{"style":405},[9047],{"type":62,"value":9048},"Order created",{"type":56,"tag":382,"props":9050,"children":9051},{"style":411},[9052],{"type":62,"value":1940},{"type":56,"tag":382,"props":9054,"children":9055},{"style":411},[9056],{"type":62,"value":1639},{"type":56,"tag":382,"props":9058,"children":9059},{"style":411},[9060],{"type":62,"value":1592},{"type":56,"tag":382,"props":9062,"children":9063},{"class":384,"line":433},[9064,9069,9073,9077,9081,9085,9089,9094,9098,9103,9107,9111,9115,9119,9123,9127,9131,9136],{"type":56,"tag":382,"props":9065,"children":9066},{"style":1884},[9067],{"type":62,"value":9068},"  orderId",{"type":56,"tag":382,"props":9070,"children":9071},{"style":411},[9072],{"type":62,"value":1629},{"type":56,"tag":382,"props":9074,"children":9075},{"style":531},[9076],{"type":62,"value":4279},{"type":56,"tag":382,"props":9078,"children":9079},{"style":411},[9080],{"type":62,"value":1906},{"type":56,"tag":382,"props":9082,"children":9083},{"style":531},[9084],{"type":62,"value":2859},{"type":56,"tag":382,"props":9086,"children":9087},{"style":411},[9088],{"type":62,"value":1639},{"type":56,"tag":382,"props":9090,"children":9091},{"style":1884},[9092],{"type":62,"value":9093}," userId",{"type":56,"tag":382,"props":9095,"children":9096},{"style":411},[9097],{"type":62,"value":1629},{"type":56,"tag":382,"props":9099,"children":9100},{"style":531},[9101],{"type":62,"value":9102}," user",{"type":56,"tag":382,"props":9104,"children":9105},{"style":411},[9106],{"type":62,"value":1906},{"type":56,"tag":382,"props":9108,"children":9109},{"style":531},[9110],{"type":62,"value":2859},{"type":56,"tag":382,"props":9112,"children":9113},{"style":411},[9114],{"type":62,"value":1639},{"type":56,"tag":382,"props":9116,"children":9117},{"style":1884},[9118],{"type":62,"value":6311},{"type":56,"tag":382,"props":9120,"children":9121},{"style":411},[9122],{"type":62,"value":1629},{"type":56,"tag":382,"props":9124,"children":9125},{"style":531},[9126],{"type":62,"value":4279},{"type":56,"tag":382,"props":9128,"children":9129},{"style":411},[9130],{"type":62,"value":1906},{"type":56,"tag":382,"props":9132,"children":9133},{"style":531},[9134],{"type":62,"value":9135},"total",{"type":56,"tag":382,"props":9137,"children":9138},{"style":411},[9139],{"type":62,"value":1674},{"type":56,"tag":382,"props":9141,"children":9142},{"class":384,"line":442},[9143,9148,9152,9156,9160,9164,9168,9173,9177,9182,9186,9191,9195,9200,9205,9210,9215],{"type":56,"tag":382,"props":9144,"children":9145},{"style":1884},[9146],{"type":62,"value":9147},"  items",{"type":56,"tag":382,"props":9149,"children":9150},{"style":411},[9151],{"type":62,"value":1629},{"type":56,"tag":382,"props":9153,"children":9154},{"style":531},[9155],{"type":62,"value":4279},{"type":56,"tag":382,"props":9157,"children":9158},{"style":411},[9159],{"type":62,"value":1906},{"type":56,"tag":382,"props":9161,"children":9162},{"style":531},[9163],{"type":62,"value":4008},{"type":56,"tag":382,"props":9165,"children":9166},{"style":411},[9167],{"type":62,"value":1906},{"type":56,"tag":382,"props":9169,"children":9170},{"style":531},[9171],{"type":62,"value":9172},"length",{"type":56,"tag":382,"props":9174,"children":9175},{"style":411},[9176],{"type":62,"value":1639},{"type":56,"tag":382,"props":9178,"children":9179},{"style":1884},[9180],{"type":62,"value":9181}," duration_ms",{"type":56,"tag":382,"props":9183,"children":9184},{"style":411},[9185],{"type":62,"value":1629},{"type":56,"tag":382,"props":9187,"children":9188},{"style":531},[9189],{"type":62,"value":9190}," Date",{"type":56,"tag":382,"props":9192,"children":9193},{"style":411},[9194],{"type":62,"value":1906},{"type":56,"tag":382,"props":9196,"children":9197},{"style":399},[9198],{"type":62,"value":9199},"now",{"type":56,"tag":382,"props":9201,"children":9202},{"style":531},[9203],{"type":62,"value":9204},"() ",{"type":56,"tag":382,"props":9206,"children":9207},{"style":411},[9208],{"type":62,"value":9209},"-",{"type":56,"tag":382,"props":9211,"children":9212},{"style":531},[9213],{"type":62,"value":9214}," startTime",{"type":56,"tag":382,"props":9216,"children":9217},{"style":411},[9218],{"type":62,"value":1674},{"type":56,"tag":382,"props":9220,"children":9221},{"class":384,"line":1677},[9222,9226,9230],{"type":56,"tag":382,"props":9223,"children":9224},{"style":411},[9225],{"type":62,"value":2179},{"type":56,"tag":382,"props":9227,"children":9228},{"style":531},[9229],{"type":62,"value":782},{"type":56,"tag":382,"props":9231,"children":9232},{"style":411},[9233],{"type":62,"value":2195},{"type":56,"tag":382,"props":9235,"children":9236},{"class":384,"line":1691},[9237],{"type":56,"tag":382,"props":9238,"children":9239},{"style":389},[9240],{"type":62,"value":9241},"\u002F\u002F Output: {\"level\":\"info\",\"msg\":\"Order created\",\"orderId\":\"ord_123\",...}\n",{"type":56,"tag":382,"props":9243,"children":9244},{"class":384,"line":1813},[9245],{"type":56,"tag":382,"props":9246,"children":9247},{"emptyLinePlaceholder":724},[9248],{"type":62,"value":1802},{"type":56,"tag":382,"props":9250,"children":9251},{"class":384,"line":1822},[9252],{"type":56,"tag":382,"props":9253,"children":9254},{"style":389},[9255],{"type":62,"value":9256},"\u002F\u002F ❌ Unstructured — useless at scale\n",{"type":56,"tag":382,"props":9258,"children":9259},{"class":384,"line":2296},[9260,9265,9269,9274,9278,9282,9287,9291,9295,9299,9303,9307,9312,9316,9320,9324,9328,9332,9336],{"type":56,"tag":382,"props":9261,"children":9262},{"style":531},[9263],{"type":62,"value":9264},"console",{"type":56,"tag":382,"props":9266,"children":9267},{"style":411},[9268],{"type":62,"value":1906},{"type":56,"tag":382,"props":9270,"children":9271},{"style":399},[9272],{"type":62,"value":9273},"log",{"type":56,"tag":382,"props":9275,"children":9276},{"style":531},[9277],{"type":62,"value":1994},{"type":56,"tag":382,"props":9279,"children":9280},{"style":411},[9281],{"type":62,"value":2345},{"type":56,"tag":382,"props":9283,"children":9284},{"style":405},[9285],{"type":62,"value":9286},"Order created for user ",{"type":56,"tag":382,"props":9288,"children":9289},{"style":411},[9290],{"type":62,"value":2355},{"type":56,"tag":382,"props":9292,"children":9293},{"style":531},[9294],{"type":62,"value":7574},{"type":56,"tag":382,"props":9296,"children":9297},{"style":411},[9298],{"type":62,"value":1906},{"type":56,"tag":382,"props":9300,"children":9301},{"style":531},[9302],{"type":62,"value":2859},{"type":56,"tag":382,"props":9304,"children":9305},{"style":411},[9306],{"type":62,"value":2179},{"type":56,"tag":382,"props":9308,"children":9309},{"style":405},[9310],{"type":62,"value":9311}," with total ",{"type":56,"tag":382,"props":9313,"children":9314},{"style":411},[9315],{"type":62,"value":2355},{"type":56,"tag":382,"props":9317,"children":9318},{"style":531},[9319],{"type":62,"value":3941},{"type":56,"tag":382,"props":9321,"children":9322},{"style":411},[9323],{"type":62,"value":1906},{"type":56,"tag":382,"props":9325,"children":9326},{"style":531},[9327],{"type":62,"value":9135},{"type":56,"tag":382,"props":9329,"children":9330},{"style":411},[9331],{"type":62,"value":2364},{"type":56,"tag":382,"props":9333,"children":9334},{"style":531},[9335],{"type":62,"value":782},{"type":56,"tag":382,"props":9337,"children":9338},{"style":411},[9339],{"type":62,"value":2195},{"type":56,"tag":82,"props":9341,"children":9343},{"id":9342},"log-levels",[9344],{"type":62,"value":9345},"Log Levels",{"type":56,"tag":175,"props":9347,"children":9348},{},[9349,9369],{"type":56,"tag":179,"props":9350,"children":9351},{},[9352],{"type":56,"tag":183,"props":9353,"children":9354},{},[9355,9360,9364],{"type":56,"tag":187,"props":9356,"children":9357},{},[9358],{"type":62,"value":9359},"Level",{"type":56,"tag":187,"props":9361,"children":9362},{},[9363],{"type":62,"value":7912},{"type":56,"tag":187,"props":9365,"children":9366},{},[9367],{"type":62,"value":9368},"Production?",{"type":56,"tag":203,"props":9370,"children":9371},{},[9372,9389,9406,9422],{"type":56,"tag":183,"props":9373,"children":9374},{},[9375,9379,9384],{"type":56,"tag":210,"props":9376,"children":9377},{},[9378],{"type":62,"value":3479},{"type":56,"tag":210,"props":9380,"children":9381},{},[9382],{"type":62,"value":9383},"Requires immediate attention",{"type":56,"tag":210,"props":9385,"children":9386},{},[9387],{"type":62,"value":9388},"✅ Always",{"type":56,"tag":183,"props":9390,"children":9391},{},[9392,9397,9402],{"type":56,"tag":210,"props":9393,"children":9394},{},[9395],{"type":62,"value":9396},"warn",{"type":56,"tag":210,"props":9398,"children":9399},{},[9400],{"type":62,"value":9401},"Unexpected but handled",{"type":56,"tag":210,"props":9403,"children":9404},{},[9405],{"type":62,"value":9388},{"type":56,"tag":183,"props":9407,"children":9408},{},[9409,9413,9418],{"type":56,"tag":210,"props":9410,"children":9411},{},[9412],{"type":62,"value":9035},{"type":56,"tag":210,"props":9414,"children":9415},{},[9416],{"type":62,"value":9417},"Normal operations, audit trail",{"type":56,"tag":210,"props":9419,"children":9420},{},[9421],{"type":62,"value":9388},{"type":56,"tag":183,"props":9423,"children":9424},{},[9425,9430,9435],{"type":56,"tag":210,"props":9426,"children":9427},{},[9428],{"type":62,"value":9429},"debug",{"type":56,"tag":210,"props":9431,"children":9432},{},[9433],{"type":62,"value":9434},"Dev troubleshooting",{"type":56,"tag":210,"props":9436,"children":9437},{},[9438],{"type":62,"value":9439},"❌ Dev only",{"type":56,"tag":82,"props":9441,"children":9443},{"id":9442},"rules-2",[9444],{"type":62,"value":2509},{"type":56,"tag":370,"props":9446,"children":9449},{"className":9447,"code":9448,"language":62},[1424],"✅ Request ID in every log entry (propagated via middleware)\n✅ Log at layer boundaries (request in, response out, external call)\n❌ Never log passwords, tokens, PII, or secrets\n❌ Never use console.log in production code\n",[9450],{"type":56,"tag":378,"props":9451,"children":9452},{"__ignoreMap":375},[9453],{"type":62,"value":9448},{"type":56,"tag":621,"props":9455,"children":9456},{},[],{"type":56,"tag":65,"props":9458,"children":9460},{"id":9459},"_8-background-jobs-async-medium",[9461],{"type":62,"value":9462},"8. Background Jobs & Async (MEDIUM)",{"type":56,"tag":82,"props":9464,"children":9466},{"id":9465},"rules-3",[9467],{"type":62,"value":2509},{"type":56,"tag":370,"props":9469,"children":9472},{"className":9470,"code":9471,"language":62},[1424],"✅ All jobs must be IDEMPOTENT (same job running twice = same result)\n✅ Failed jobs → retry (max 3) → dead letter queue → alert\n✅ Workers run as SEPARATE processes (not threads in API server)\n\n❌ Never put long-running tasks in request handlers\n❌ Never assume job runs exactly once\n",[9473],{"type":56,"tag":378,"props":9474,"children":9475},{"__ignoreMap":375},[9476],{"type":62,"value":9471},{"type":56,"tag":82,"props":9478,"children":9480},{"id":9479},"idempotent-job-pattern",[9481],{"type":62,"value":9482},"Idempotent Job Pattern",{"type":56,"tag":370,"props":9484,"children":9486},{"className":1567,"code":9485,"language":1569,"meta":375,"style":375},"async function processPayment(data: { orderId: string }) {\n  const order = await orderRepo.findById(data.orderId);\n  if (order.paymentStatus === 'completed') return;  \u002F\u002F already processed\n  await paymentGateway.charge(order);\n  await orderRepo.updatePaymentStatus(order.id, 'completed');\n}\n",[9487],{"type":56,"tag":378,"props":9488,"children":9489},{"__ignoreMap":375},[9490,9542,9599,9657,9694,9754],{"type":56,"tag":382,"props":9491,"children":9492},{"class":384,"line":385},[9493,9497,9501,9506,9510,9514,9518,9522,9526,9530,9534,9538],{"type":56,"tag":382,"props":9494,"children":9495},{"style":1579},[9496],{"type":62,"value":4246},{"type":56,"tag":382,"props":9498,"children":9499},{"style":1579},[9500],{"type":62,"value":4810},{"type":56,"tag":382,"props":9502,"children":9503},{"style":399},[9504],{"type":62,"value":9505}," processPayment",{"type":56,"tag":382,"props":9507,"children":9508},{"style":411},[9509],{"type":62,"value":1994},{"type":56,"tag":382,"props":9511,"children":9512},{"style":1621},[9513],{"type":62,"value":6742},{"type":56,"tag":382,"props":9515,"children":9516},{"style":411},[9517],{"type":62,"value":1629},{"type":56,"tag":382,"props":9519,"children":9520},{"style":411},[9521],{"type":62,"value":1975},{"type":56,"tag":382,"props":9523,"children":9524},{"style":1884},[9525],{"type":62,"value":4063},{"type":56,"tag":382,"props":9527,"children":9528},{"style":411},[9529],{"type":62,"value":1629},{"type":56,"tag":382,"props":9531,"children":9532},{"style":417},[9533],{"type":62,"value":2232},{"type":56,"tag":382,"props":9535,"children":9536},{"style":411},[9537],{"type":62,"value":7527},{"type":56,"tag":382,"props":9539,"children":9540},{"style":411},[9541],{"type":62,"value":1592},{"type":56,"tag":382,"props":9543,"children":9544},{"class":384,"line":395},[9545,9549,9553,9557,9561,9565,9569,9574,9578,9582,9586,9591,9595],{"type":56,"tag":382,"props":9546,"children":9547},{"style":1579},[9548],{"type":62,"value":2253},{"type":56,"tag":382,"props":9550,"children":9551},{"style":531},[9552],{"type":62,"value":4279},{"type":56,"tag":382,"props":9554,"children":9555},{"style":411},[9556],{"type":62,"value":2263},{"type":56,"tag":382,"props":9558,"children":9559},{"style":2182},[9560],{"type":62,"value":3927},{"type":56,"tag":382,"props":9562,"children":9563},{"style":531},[9564],{"type":62,"value":1624},{"type":56,"tag":382,"props":9566,"children":9567},{"style":411},[9568],{"type":62,"value":1906},{"type":56,"tag":382,"props":9570,"children":9571},{"style":399},[9572],{"type":62,"value":9573},"findById",{"type":56,"tag":382,"props":9575,"children":9576},{"style":1884},[9577],{"type":62,"value":1994},{"type":56,"tag":382,"props":9579,"children":9580},{"style":531},[9581],{"type":62,"value":6742},{"type":56,"tag":382,"props":9583,"children":9584},{"style":411},[9585],{"type":62,"value":1906},{"type":56,"tag":382,"props":9587,"children":9588},{"style":531},[9589],{"type":62,"value":9590},"orderId",{"type":56,"tag":382,"props":9592,"children":9593},{"style":1884},[9594],{"type":62,"value":782},{"type":56,"tag":382,"props":9596,"children":9597},{"style":411},[9598],{"type":62,"value":2195},{"type":56,"tag":382,"props":9600,"children":9601},{"class":384,"line":433},[9602,9606,9610,9614,9618,9623,9627,9631,9636,9640,9644,9648,9652],{"type":56,"tag":382,"props":9603,"children":9604},{"style":2182},[9605],{"type":62,"value":2302},{"type":56,"tag":382,"props":9607,"children":9608},{"style":1884},[9609],{"type":62,"value":2307},{"type":56,"tag":382,"props":9611,"children":9612},{"style":531},[9613],{"type":62,"value":3941},{"type":56,"tag":382,"props":9615,"children":9616},{"style":411},[9617],{"type":62,"value":1906},{"type":56,"tag":382,"props":9619,"children":9620},{"style":531},[9621],{"type":62,"value":9622},"paymentStatus",{"type":56,"tag":382,"props":9624,"children":9625},{"style":411},[9626],{"type":62,"value":5399},{"type":56,"tag":382,"props":9628,"children":9629},{"style":411},[9630],{"type":62,"value":1930},{"type":56,"tag":382,"props":9632,"children":9633},{"style":405},[9634],{"type":62,"value":9635},"completed",{"type":56,"tag":382,"props":9637,"children":9638},{"style":411},[9639],{"type":62,"value":1940},{"type":56,"tag":382,"props":9641,"children":9642},{"style":1884},[9643],{"type":62,"value":2059},{"type":56,"tag":382,"props":9645,"children":9646},{"style":2182},[9647],{"type":62,"value":5413},{"type":56,"tag":382,"props":9649,"children":9650},{"style":411},[9651],{"type":62,"value":2373},{"type":56,"tag":382,"props":9653,"children":9654},{"style":389},[9655],{"type":62,"value":9656},"  \u002F\u002F already processed\n",{"type":56,"tag":382,"props":9658,"children":9659},{"class":384,"line":442},[9660,9664,9669,9673,9678,9682,9686,9690],{"type":56,"tag":382,"props":9661,"children":9662},{"style":2182},[9663],{"type":62,"value":4351},{"type":56,"tag":382,"props":9665,"children":9666},{"style":531},[9667],{"type":62,"value":9668}," paymentGateway",{"type":56,"tag":382,"props":9670,"children":9671},{"style":411},[9672],{"type":62,"value":1906},{"type":56,"tag":382,"props":9674,"children":9675},{"style":399},[9676],{"type":62,"value":9677},"charge",{"type":56,"tag":382,"props":9679,"children":9680},{"style":1884},[9681],{"type":62,"value":1994},{"type":56,"tag":382,"props":9683,"children":9684},{"style":531},[9685],{"type":62,"value":3941},{"type":56,"tag":382,"props":9687,"children":9688},{"style":1884},[9689],{"type":62,"value":782},{"type":56,"tag":382,"props":9691,"children":9692},{"style":411},[9693],{"type":62,"value":2195},{"type":56,"tag":382,"props":9695,"children":9696},{"class":384,"line":1677},[9697,9701,9705,9709,9714,9718,9722,9726,9730,9734,9738,9742,9746,9750],{"type":56,"tag":382,"props":9698,"children":9699},{"style":2182},[9700],{"type":62,"value":4351},{"type":56,"tag":382,"props":9702,"children":9703},{"style":531},[9704],{"type":62,"value":1624},{"type":56,"tag":382,"props":9706,"children":9707},{"style":411},[9708],{"type":62,"value":1906},{"type":56,"tag":382,"props":9710,"children":9711},{"style":399},[9712],{"type":62,"value":9713},"updatePaymentStatus",{"type":56,"tag":382,"props":9715,"children":9716},{"style":1884},[9717],{"type":62,"value":1994},{"type":56,"tag":382,"props":9719,"children":9720},{"style":531},[9721],{"type":62,"value":3941},{"type":56,"tag":382,"props":9723,"children":9724},{"style":411},[9725],{"type":62,"value":1906},{"type":56,"tag":382,"props":9727,"children":9728},{"style":531},[9729],{"type":62,"value":2859},{"type":56,"tag":382,"props":9731,"children":9732},{"style":411},[9733],{"type":62,"value":1639},{"type":56,"tag":382,"props":9735,"children":9736},{"style":411},[9737],{"type":62,"value":1930},{"type":56,"tag":382,"props":9739,"children":9740},{"style":405},[9741],{"type":62,"value":9635},{"type":56,"tag":382,"props":9743,"children":9744},{"style":411},[9745],{"type":62,"value":1940},{"type":56,"tag":382,"props":9747,"children":9748},{"style":1884},[9749],{"type":62,"value":782},{"type":56,"tag":382,"props":9751,"children":9752},{"style":411},[9753],{"type":62,"value":2195},{"type":56,"tag":382,"props":9755,"children":9756},{"class":384,"line":1691},[9757],{"type":56,"tag":382,"props":9758,"children":9759},{"style":411},[9760],{"type":62,"value":1697},{"type":56,"tag":621,"props":9762,"children":9763},{},[],{"type":56,"tag":65,"props":9765,"children":9767},{"id":9766},"_9-caching-patterns-medium",[9768],{"type":62,"value":9769},"9. Caching Patterns (MEDIUM)",{"type":56,"tag":82,"props":9771,"children":9773},{"id":9772},"cache-aside-lazy-loading",[9774],{"type":62,"value":9775},"Cache-Aside (Lazy Loading)",{"type":56,"tag":370,"props":9777,"children":9779},{"className":1567,"code":9778,"language":1569,"meta":375,"style":375},"async function getUser(id: string): Promise\u003CUser> {\n  const cached = await redis.get(`user:${id}`);\n  if (cached) return JSON.parse(cached);\n\n  const user = await userRepo.findById(id);\n  if (!user) throw new NotFoundError('User', id);\n\n  await redis.set(`user:${id}`, JSON.stringify(user), 'EX', 900);  \u002F\u002F 15min TTL\n  return user;\n}\n",[9780],{"type":56,"tag":378,"props":9781,"children":9782},{"__ignoreMap":375},[9783,9840,9906,9959,9966,10014,10081,10088,10199,10214],{"type":56,"tag":382,"props":9784,"children":9785},{"class":384,"line":385},[9786,9790,9794,9799,9803,9807,9811,9815,9819,9823,9827,9832,9836],{"type":56,"tag":382,"props":9787,"children":9788},{"style":1579},[9789],{"type":62,"value":4246},{"type":56,"tag":382,"props":9791,"children":9792},{"style":1579},[9793],{"type":62,"value":4810},{"type":56,"tag":382,"props":9795,"children":9796},{"style":399},[9797],{"type":62,"value":9798}," getUser",{"type":56,"tag":382,"props":9800,"children":9801},{"style":411},[9802],{"type":62,"value":1994},{"type":56,"tag":382,"props":9804,"children":9805},{"style":1621},[9806],{"type":62,"value":2859},{"type":56,"tag":382,"props":9808,"children":9809},{"style":411},[9810],{"type":62,"value":1629},{"type":56,"tag":382,"props":9812,"children":9813},{"style":417},[9814],{"type":62,"value":2232},{"type":56,"tag":382,"props":9816,"children":9817},{"style":411},[9818],{"type":62,"value":2237},{"type":56,"tag":382,"props":9820,"children":9821},{"style":417},[9822],{"type":62,"value":4874},{"type":56,"tag":382,"props":9824,"children":9825},{"style":411},[9826],{"type":62,"value":523},{"type":56,"tag":382,"props":9828,"children":9829},{"style":417},[9830],{"type":62,"value":9831},"User",{"type":56,"tag":382,"props":9833,"children":9834},{"style":411},[9835],{"type":62,"value":4887},{"type":56,"tag":382,"props":9837,"children":9838},{"style":411},[9839],{"type":62,"value":1592},{"type":56,"tag":382,"props":9841,"children":9842},{"class":384,"line":395},[9843,9847,9852,9856,9860,9865,9869,9873,9877,9881,9886,9890,9894,9898,9902],{"type":56,"tag":382,"props":9844,"children":9845},{"style":1579},[9846],{"type":62,"value":2253},{"type":56,"tag":382,"props":9848,"children":9849},{"style":531},[9850],{"type":62,"value":9851}," cached",{"type":56,"tag":382,"props":9853,"children":9854},{"style":411},[9855],{"type":62,"value":2263},{"type":56,"tag":382,"props":9857,"children":9858},{"style":2182},[9859],{"type":62,"value":3927},{"type":56,"tag":382,"props":9861,"children":9862},{"style":531},[9863],{"type":62,"value":9864}," redis",{"type":56,"tag":382,"props":9866,"children":9867},{"style":411},[9868],{"type":62,"value":1906},{"type":56,"tag":382,"props":9870,"children":9871},{"style":399},[9872],{"type":62,"value":6534},{"type":56,"tag":382,"props":9874,"children":9875},{"style":1884},[9876],{"type":62,"value":1994},{"type":56,"tag":382,"props":9878,"children":9879},{"style":411},[9880],{"type":62,"value":2345},{"type":56,"tag":382,"props":9882,"children":9883},{"style":405},[9884],{"type":62,"value":9885},"user:",{"type":56,"tag":382,"props":9887,"children":9888},{"style":411},[9889],{"type":62,"value":2355},{"type":56,"tag":382,"props":9891,"children":9892},{"style":531},[9893],{"type":62,"value":2859},{"type":56,"tag":382,"props":9895,"children":9896},{"style":411},[9897],{"type":62,"value":2364},{"type":56,"tag":382,"props":9899,"children":9900},{"style":1884},[9901],{"type":62,"value":782},{"type":56,"tag":382,"props":9903,"children":9904},{"style":411},[9905],{"type":62,"value":2195},{"type":56,"tag":382,"props":9907,"children":9908},{"class":384,"line":433},[9909,9913,9917,9922,9926,9930,9934,9938,9943,9947,9951,9955],{"type":56,"tag":382,"props":9910,"children":9911},{"style":2182},[9912],{"type":62,"value":2302},{"type":56,"tag":382,"props":9914,"children":9915},{"style":1884},[9916],{"type":62,"value":2307},{"type":56,"tag":382,"props":9918,"children":9919},{"style":531},[9920],{"type":62,"value":9921},"cached",{"type":56,"tag":382,"props":9923,"children":9924},{"style":1884},[9925],{"type":62,"value":2059},{"type":56,"tag":382,"props":9927,"children":9928},{"style":2182},[9929],{"type":62,"value":5413},{"type":56,"tag":382,"props":9931,"children":9932},{"style":531},[9933],{"type":62,"value":5702},{"type":56,"tag":382,"props":9935,"children":9936},{"style":411},[9937],{"type":62,"value":1906},{"type":56,"tag":382,"props":9939,"children":9940},{"style":399},[9941],{"type":62,"value":9942},"parse",{"type":56,"tag":382,"props":9944,"children":9945},{"style":1884},[9946],{"type":62,"value":1994},{"type":56,"tag":382,"props":9948,"children":9949},{"style":531},[9950],{"type":62,"value":9921},{"type":56,"tag":382,"props":9952,"children":9953},{"style":1884},[9954],{"type":62,"value":782},{"type":56,"tag":382,"props":9956,"children":9957},{"style":411},[9958],{"type":62,"value":2195},{"type":56,"tag":382,"props":9960,"children":9961},{"class":384,"line":442},[9962],{"type":56,"tag":382,"props":9963,"children":9964},{"emptyLinePlaceholder":724},[9965],{"type":62,"value":1802},{"type":56,"tag":382,"props":9967,"children":9968},{"class":384,"line":1677},[9969,9973,9977,9981,9985,9990,9994,9998,10002,10006,10010],{"type":56,"tag":382,"props":9970,"children":9971},{"style":1579},[9972],{"type":62,"value":2253},{"type":56,"tag":382,"props":9974,"children":9975},{"style":531},[9976],{"type":62,"value":9102},{"type":56,"tag":382,"props":9978,"children":9979},{"style":411},[9980],{"type":62,"value":2263},{"type":56,"tag":382,"props":9982,"children":9983},{"style":2182},[9984],{"type":62,"value":3927},{"type":56,"tag":382,"props":9986,"children":9987},{"style":531},[9988],{"type":62,"value":9989}," userRepo",{"type":56,"tag":382,"props":9991,"children":9992},{"style":411},[9993],{"type":62,"value":1906},{"type":56,"tag":382,"props":9995,"children":9996},{"style":399},[9997],{"type":62,"value":9573},{"type":56,"tag":382,"props":9999,"children":10000},{"style":1884},[10001],{"type":62,"value":1994},{"type":56,"tag":382,"props":10003,"children":10004},{"style":531},[10005],{"type":62,"value":2859},{"type":56,"tag":382,"props":10007,"children":10008},{"style":1884},[10009],{"type":62,"value":782},{"type":56,"tag":382,"props":10011,"children":10012},{"style":411},[10013],{"type":62,"value":2195},{"type":56,"tag":382,"props":10015,"children":10016},{"class":384,"line":1691},[10017,10021,10025,10029,10033,10037,10041,10045,10049,10053,10057,10061,10065,10069,10073,10077],{"type":56,"tag":382,"props":10018,"children":10019},{"style":2182},[10020],{"type":62,"value":2302},{"type":56,"tag":382,"props":10022,"children":10023},{"style":1884},[10024],{"type":62,"value":2307},{"type":56,"tag":382,"props":10026,"children":10027},{"style":411},[10028],{"type":62,"value":2312},{"type":56,"tag":382,"props":10030,"children":10031},{"style":531},[10032],{"type":62,"value":7574},{"type":56,"tag":382,"props":10034,"children":10035},{"style":1884},[10036],{"type":62,"value":2059},{"type":56,"tag":382,"props":10038,"children":10039},{"style":2182},[10040],{"type":62,"value":2326},{"type":56,"tag":382,"props":10042,"children":10043},{"style":411},[10044],{"type":62,"value":2331},{"type":56,"tag":382,"props":10046,"children":10047},{"style":399},[10048],{"type":62,"value":2758},{"type":56,"tag":382,"props":10050,"children":10051},{"style":1884},[10052],{"type":62,"value":1994},{"type":56,"tag":382,"props":10054,"children":10055},{"style":411},[10056],{"type":62,"value":1940},{"type":56,"tag":382,"props":10058,"children":10059},{"style":405},[10060],{"type":62,"value":9831},{"type":56,"tag":382,"props":10062,"children":10063},{"style":411},[10064],{"type":62,"value":1940},{"type":56,"tag":382,"props":10066,"children":10067},{"style":411},[10068],{"type":62,"value":1639},{"type":56,"tag":382,"props":10070,"children":10071},{"style":531},[10072],{"type":62,"value":2803},{"type":56,"tag":382,"props":10074,"children":10075},{"style":1884},[10076],{"type":62,"value":782},{"type":56,"tag":382,"props":10078,"children":10079},{"style":411},[10080],{"type":62,"value":2195},{"type":56,"tag":382,"props":10082,"children":10083},{"class":384,"line":1813},[10084],{"type":56,"tag":382,"props":10085,"children":10086},{"emptyLinePlaceholder":724},[10087],{"type":62,"value":1802},{"type":56,"tag":382,"props":10089,"children":10090},{"class":384,"line":1822},[10091,10095,10099,10103,10108,10112,10116,10120,10124,10128,10132,10136,10140,10144,10148,10152,10156,10160,10164,10168,10173,10177,10181,10186,10190,10194],{"type":56,"tag":382,"props":10092,"children":10093},{"style":2182},[10094],{"type":62,"value":4351},{"type":56,"tag":382,"props":10096,"children":10097},{"style":531},[10098],{"type":62,"value":9864},{"type":56,"tag":382,"props":10100,"children":10101},{"style":411},[10102],{"type":62,"value":1906},{"type":56,"tag":382,"props":10104,"children":10105},{"style":399},[10106],{"type":62,"value":10107},"set",{"type":56,"tag":382,"props":10109,"children":10110},{"style":1884},[10111],{"type":62,"value":1994},{"type":56,"tag":382,"props":10113,"children":10114},{"style":411},[10115],{"type":62,"value":2345},{"type":56,"tag":382,"props":10117,"children":10118},{"style":405},[10119],{"type":62,"value":9885},{"type":56,"tag":382,"props":10121,"children":10122},{"style":411},[10123],{"type":62,"value":2355},{"type":56,"tag":382,"props":10125,"children":10126},{"style":531},[10127],{"type":62,"value":2859},{"type":56,"tag":382,"props":10129,"children":10130},{"style":411},[10131],{"type":62,"value":2364},{"type":56,"tag":382,"props":10133,"children":10134},{"style":411},[10135],{"type":62,"value":1639},{"type":56,"tag":382,"props":10137,"children":10138},{"style":531},[10139],{"type":62,"value":5702},{"type":56,"tag":382,"props":10141,"children":10142},{"style":411},[10143],{"type":62,"value":1906},{"type":56,"tag":382,"props":10145,"children":10146},{"style":399},[10147],{"type":62,"value":5711},{"type":56,"tag":382,"props":10149,"children":10150},{"style":1884},[10151],{"type":62,"value":1994},{"type":56,"tag":382,"props":10153,"children":10154},{"style":531},[10155],{"type":62,"value":7574},{"type":56,"tag":382,"props":10157,"children":10158},{"style":1884},[10159],{"type":62,"value":782},{"type":56,"tag":382,"props":10161,"children":10162},{"style":411},[10163],{"type":62,"value":1639},{"type":56,"tag":382,"props":10165,"children":10166},{"style":411},[10167],{"type":62,"value":1930},{"type":56,"tag":382,"props":10169,"children":10170},{"style":405},[10171],{"type":62,"value":10172},"EX",{"type":56,"tag":382,"props":10174,"children":10175},{"style":411},[10176],{"type":62,"value":1940},{"type":56,"tag":382,"props":10178,"children":10179},{"style":411},[10180],{"type":62,"value":1639},{"type":56,"tag":382,"props":10182,"children":10183},{"style":1947},[10184],{"type":62,"value":10185}," 900",{"type":56,"tag":382,"props":10187,"children":10188},{"style":1884},[10189],{"type":62,"value":782},{"type":56,"tag":382,"props":10191,"children":10192},{"style":411},[10193],{"type":62,"value":2373},{"type":56,"tag":382,"props":10195,"children":10196},{"style":389},[10197],{"type":62,"value":10198},"  \u002F\u002F 15min TTL\n",{"type":56,"tag":382,"props":10200,"children":10201},{"class":384,"line":2296},[10202,10206,10210],{"type":56,"tag":382,"props":10203,"children":10204},{"style":2182},[10205],{"type":62,"value":2387},{"type":56,"tag":382,"props":10207,"children":10208},{"style":531},[10209],{"type":62,"value":9102},{"type":56,"tag":382,"props":10211,"children":10212},{"style":411},[10213],{"type":62,"value":2195},{"type":56,"tag":382,"props":10215,"children":10216},{"class":384,"line":2381},[10217],{"type":56,"tag":382,"props":10218,"children":10219},{"style":411},[10220],{"type":62,"value":1697},{"type":56,"tag":82,"props":10222,"children":10224},{"id":10223},"rules-4",[10225],{"type":62,"value":2509},{"type":56,"tag":370,"props":10227,"children":10230},{"className":10228,"code":10229,"language":62},[1424],"✅ ALWAYS set TTL — never cache without expiry\n✅ Invalidate on write (delete cache key after update)\n✅ Use cache for reads, never for authoritative state\n\n❌ Never cache without TTL (stale data is worse than slow data)\n",[10231],{"type":56,"tag":378,"props":10232,"children":10233},{"__ignoreMap":375},[10234],{"type":62,"value":10229},{"type":56,"tag":175,"props":10236,"children":10237},{},[10238,10254],{"type":56,"tag":179,"props":10239,"children":10240},{},[10241],{"type":56,"tag":183,"props":10242,"children":10243},{},[10244,10249],{"type":56,"tag":187,"props":10245,"children":10246},{},[10247],{"type":62,"value":10248},"Data Type",{"type":56,"tag":187,"props":10250,"children":10251},{},[10252],{"type":62,"value":10253},"Suggested TTL",{"type":56,"tag":203,"props":10255,"children":10256},{},[10257,10270,10283,10296],{"type":56,"tag":183,"props":10258,"children":10259},{},[10260,10265],{"type":56,"tag":210,"props":10261,"children":10262},{},[10263],{"type":62,"value":10264},"User profile",{"type":56,"tag":210,"props":10266,"children":10267},{},[10268],{"type":62,"value":10269},"5-15 min",{"type":56,"tag":183,"props":10271,"children":10272},{},[10273,10278],{"type":56,"tag":210,"props":10274,"children":10275},{},[10276],{"type":62,"value":10277},"Product catalog",{"type":56,"tag":210,"props":10279,"children":10280},{},[10281],{"type":62,"value":10282},"1-5 min",{"type":56,"tag":183,"props":10284,"children":10285},{},[10286,10291],{"type":56,"tag":210,"props":10287,"children":10288},{},[10289],{"type":62,"value":10290},"Config \u002F feature flags",{"type":56,"tag":210,"props":10292,"children":10293},{},[10294],{"type":62,"value":10295},"30-60 sec",{"type":56,"tag":183,"props":10297,"children":10298},{},[10299,10304],{"type":56,"tag":210,"props":10300,"children":10301},{},[10302],{"type":62,"value":10303},"Session",{"type":56,"tag":210,"props":10305,"children":10306},{},[10307],{"type":62,"value":10308},"Match session duration",{"type":56,"tag":621,"props":10310,"children":10311},{},[],{"type":56,"tag":65,"props":10313,"children":10315},{"id":10314},"_10-file-upload-patterns-medium",[10316],{"type":62,"value":10317},"10. File Upload Patterns (MEDIUM)",{"type":56,"tag":82,"props":10319,"children":10321},{"id":10320},"option-a-presigned-url-recommended-for-large-files",[10322],{"type":62,"value":10323},"Option A: Presigned URL (Recommended for Large Files)",{"type":56,"tag":370,"props":10325,"children":10328},{"className":10326,"code":10327,"language":62},[1424],"Client → GET \u002Fapi\u002Fuploads\u002Fpresign?filename=photo.jpg&type=image\u002Fjpeg\nServer → { uploadUrl: \"https:\u002F\u002Fs3...\u002Fpresigned\", fileKey: \"uploads\u002Fabc123.jpg\" }\nClient → PUT uploadUrl (direct to S3, bypasses your server)\nClient → POST \u002Fapi\u002Fphotos { fileKey: \"uploads\u002Fabc123.jpg\" }  (save reference)\n",[10329],{"type":56,"tag":378,"props":10330,"children":10331},{"__ignoreMap":375},[10332],{"type":62,"value":10327},{"type":56,"tag":72,"props":10334,"children":10335},{},[10336],{"type":56,"tag":76,"props":10337,"children":10338},{},[10339],{"type":62,"value":10340},"Backend:",{"type":56,"tag":370,"props":10342,"children":10344},{"className":1567,"code":10343,"language":1569,"meta":375,"style":375},"app.get('\u002Fapi\u002Fuploads\u002Fpresign', authenticate, async (req, res) => {\n  const { filename, type } = req.query;\n  const key = `uploads\u002F${crypto.randomUUID()}-${filename}`;\n  const url = await s3.getSignedUrl('putObject', {\n    Bucket: process.env.S3_BUCKET, Key: key,\n    ContentType: type, Expires: 300,  \u002F\u002F 5 min\n  });\n  res.json({ uploadUrl: url, fileKey: key });\n});\n",[10345],{"type":56,"tag":378,"props":10346,"children":10347},{"__ignoreMap":375},[10348,10425,10473,10545,10603,10657,10700,10715,10780],{"type":56,"tag":382,"props":10349,"children":10350},{"class":384,"line":385},[10351,10355,10359,10363,10367,10371,10376,10380,10384,10388,10392,10397,10401,10405,10409,10413,10417,10421],{"type":56,"tag":382,"props":10352,"children":10353},{"style":531},[10354],{"type":62,"value":3161},{"type":56,"tag":382,"props":10356,"children":10357},{"style":411},[10358],{"type":62,"value":1906},{"type":56,"tag":382,"props":10360,"children":10361},{"style":399},[10362],{"type":62,"value":6534},{"type":56,"tag":382,"props":10364,"children":10365},{"style":531},[10366],{"type":62,"value":1994},{"type":56,"tag":382,"props":10368,"children":10369},{"style":411},[10370],{"type":62,"value":1940},{"type":56,"tag":382,"props":10372,"children":10373},{"style":405},[10374],{"type":62,"value":10375},"\u002Fapi\u002Fuploads\u002Fpresign",{"type":56,"tag":382,"props":10377,"children":10378},{"style":411},[10379],{"type":62,"value":1940},{"type":56,"tag":382,"props":10381,"children":10382},{"style":411},[10383],{"type":62,"value":1639},{"type":56,"tag":382,"props":10385,"children":10386},{"style":531},[10387],{"type":62,"value":8423},{"type":56,"tag":382,"props":10389,"children":10390},{"style":411},[10391],{"type":62,"value":1639},{"type":56,"tag":382,"props":10393,"children":10394},{"style":1579},[10395],{"type":62,"value":10396}," async",{"type":56,"tag":382,"props":10398,"children":10399},{"style":411},[10400],{"type":62,"value":2307},{"type":56,"tag":382,"props":10402,"children":10403},{"style":1621},[10404],{"type":62,"value":8164},{"type":56,"tag":382,"props":10406,"children":10407},{"style":411},[10408],{"type":62,"value":1639},{"type":56,"tag":382,"props":10410,"children":10411},{"style":1621},[10412],{"type":62,"value":3201},{"type":56,"tag":382,"props":10414,"children":10415},{"style":411},[10416],{"type":62,"value":782},{"type":56,"tag":382,"props":10418,"children":10419},{"style":1579},[10420],{"type":62,"value":3219},{"type":56,"tag":382,"props":10422,"children":10423},{"style":411},[10424],{"type":62,"value":1592},{"type":56,"tag":382,"props":10426,"children":10427},{"class":384,"line":395},[10428,10432,10436,10441,10445,10449,10453,10457,10461,10465,10469],{"type":56,"tag":382,"props":10429,"children":10430},{"style":1579},[10431],{"type":62,"value":2253},{"type":56,"tag":382,"props":10433,"children":10434},{"style":411},[10435],{"type":62,"value":1975},{"type":56,"tag":382,"props":10437,"children":10438},{"style":531},[10439],{"type":62,"value":10440}," filename",{"type":56,"tag":382,"props":10442,"children":10443},{"style":411},[10444],{"type":62,"value":1639},{"type":56,"tag":382,"props":10446,"children":10447},{"style":531},[10448],{"type":62,"value":7656},{"type":56,"tag":382,"props":10450,"children":10451},{"style":411},[10452],{"type":62,"value":3580},{"type":56,"tag":382,"props":10454,"children":10455},{"style":411},[10456],{"type":62,"value":2263},{"type":56,"tag":382,"props":10458,"children":10459},{"style":531},[10460],{"type":62,"value":3192},{"type":56,"tag":382,"props":10462,"children":10463},{"style":411},[10464],{"type":62,"value":1906},{"type":56,"tag":382,"props":10466,"children":10467},{"style":531},[10468],{"type":62,"value":7285},{"type":56,"tag":382,"props":10470,"children":10471},{"style":411},[10472],{"type":62,"value":2195},{"type":56,"tag":382,"props":10474,"children":10475},{"class":384,"line":433},[10476,10480,10485,10489,10493,10498,10502,10507,10511,10516,10520,10524,10528,10532,10537,10541],{"type":56,"tag":382,"props":10477,"children":10478},{"style":1579},[10479],{"type":62,"value":2253},{"type":56,"tag":382,"props":10481,"children":10482},{"style":531},[10483],{"type":62,"value":10484}," key",{"type":56,"tag":382,"props":10486,"children":10487},{"style":411},[10488],{"type":62,"value":2263},{"type":56,"tag":382,"props":10490,"children":10491},{"style":411},[10492],{"type":62,"value":4752},{"type":56,"tag":382,"props":10494,"children":10495},{"style":405},[10496],{"type":62,"value":10497},"uploads\u002F",{"type":56,"tag":382,"props":10499,"children":10500},{"style":411},[10501],{"type":62,"value":2355},{"type":56,"tag":382,"props":10503,"children":10504},{"style":531},[10505],{"type":62,"value":10506},"crypto",{"type":56,"tag":382,"props":10508,"children":10509},{"style":411},[10510],{"type":62,"value":1906},{"type":56,"tag":382,"props":10512,"children":10513},{"style":399},[10514],{"type":62,"value":10515},"randomUUID",{"type":56,"tag":382,"props":10517,"children":10518},{"style":531},[10519],{"type":62,"value":3955},{"type":56,"tag":382,"props":10521,"children":10522},{"style":411},[10523],{"type":62,"value":2179},{"type":56,"tag":382,"props":10525,"children":10526},{"style":405},[10527],{"type":62,"value":9209},{"type":56,"tag":382,"props":10529,"children":10530},{"style":411},[10531],{"type":62,"value":2355},{"type":56,"tag":382,"props":10533,"children":10534},{"style":531},[10535],{"type":62,"value":10536},"filename",{"type":56,"tag":382,"props":10538,"children":10539},{"style":411},[10540],{"type":62,"value":2364},{"type":56,"tag":382,"props":10542,"children":10543},{"style":411},[10544],{"type":62,"value":2195},{"type":56,"tag":382,"props":10546,"children":10547},{"class":384,"line":442},[10548,10552,10556,10560,10564,10569,10573,10578,10582,10586,10591,10595,10599],{"type":56,"tag":382,"props":10549,"children":10550},{"style":1579},[10551],{"type":62,"value":2253},{"type":56,"tag":382,"props":10553,"children":10554},{"style":531},[10555],{"type":62,"value":1980},{"type":56,"tag":382,"props":10557,"children":10558},{"style":411},[10559],{"type":62,"value":2263},{"type":56,"tag":382,"props":10561,"children":10562},{"style":2182},[10563],{"type":62,"value":3927},{"type":56,"tag":382,"props":10565,"children":10566},{"style":531},[10567],{"type":62,"value":10568}," s3",{"type":56,"tag":382,"props":10570,"children":10571},{"style":411},[10572],{"type":62,"value":1906},{"type":56,"tag":382,"props":10574,"children":10575},{"style":399},[10576],{"type":62,"value":10577},"getSignedUrl",{"type":56,"tag":382,"props":10579,"children":10580},{"style":1884},[10581],{"type":62,"value":1994},{"type":56,"tag":382,"props":10583,"children":10584},{"style":411},[10585],{"type":62,"value":1940},{"type":56,"tag":382,"props":10587,"children":10588},{"style":405},[10589],{"type":62,"value":10590},"putObject",{"type":56,"tag":382,"props":10592,"children":10593},{"style":411},[10594],{"type":62,"value":1940},{"type":56,"tag":382,"props":10596,"children":10597},{"style":411},[10598],{"type":62,"value":1639},{"type":56,"tag":382,"props":10600,"children":10601},{"style":411},[10602],{"type":62,"value":1592},{"type":56,"tag":382,"props":10604,"children":10605},{"class":384,"line":1677},[10606,10611,10615,10619,10623,10627,10631,10636,10640,10645,10649,10653],{"type":56,"tag":382,"props":10607,"children":10608},{"style":1884},[10609],{"type":62,"value":10610},"    Bucket",{"type":56,"tag":382,"props":10612,"children":10613},{"style":411},[10614],{"type":62,"value":1629},{"type":56,"tag":382,"props":10616,"children":10617},{"style":531},[10618],{"type":62,"value":2132},{"type":56,"tag":382,"props":10620,"children":10621},{"style":411},[10622],{"type":62,"value":1906},{"type":56,"tag":382,"props":10624,"children":10625},{"style":531},[10626],{"type":62,"value":1911},{"type":56,"tag":382,"props":10628,"children":10629},{"style":411},[10630],{"type":62,"value":1906},{"type":56,"tag":382,"props":10632,"children":10633},{"style":531},[10634],{"type":62,"value":10635},"S3_BUCKET",{"type":56,"tag":382,"props":10637,"children":10638},{"style":411},[10639],{"type":62,"value":1639},{"type":56,"tag":382,"props":10641,"children":10642},{"style":1884},[10643],{"type":62,"value":10644}," Key",{"type":56,"tag":382,"props":10646,"children":10647},{"style":411},[10648],{"type":62,"value":1629},{"type":56,"tag":382,"props":10650,"children":10651},{"style":531},[10652],{"type":62,"value":10484},{"type":56,"tag":382,"props":10654,"children":10655},{"style":411},[10656],{"type":62,"value":1674},{"type":56,"tag":382,"props":10658,"children":10659},{"class":384,"line":1691},[10660,10665,10669,10673,10677,10682,10686,10691,10695],{"type":56,"tag":382,"props":10661,"children":10662},{"style":1884},[10663],{"type":62,"value":10664},"    ContentType",{"type":56,"tag":382,"props":10666,"children":10667},{"style":411},[10668],{"type":62,"value":1629},{"type":56,"tag":382,"props":10670,"children":10671},{"style":531},[10672],{"type":62,"value":7656},{"type":56,"tag":382,"props":10674,"children":10675},{"style":411},[10676],{"type":62,"value":1639},{"type":56,"tag":382,"props":10678,"children":10679},{"style":1884},[10680],{"type":62,"value":10681}," Expires",{"type":56,"tag":382,"props":10683,"children":10684},{"style":411},[10685],{"type":62,"value":1629},{"type":56,"tag":382,"props":10687,"children":10688},{"style":1947},[10689],{"type":62,"value":10690}," 300",{"type":56,"tag":382,"props":10692,"children":10693},{"style":411},[10694],{"type":62,"value":1639},{"type":56,"tag":382,"props":10696,"children":10697},{"style":389},[10698],{"type":62,"value":10699},"  \u002F\u002F 5 min\n",{"type":56,"tag":382,"props":10701,"children":10702},{"class":384,"line":1813},[10703,10707,10711],{"type":56,"tag":382,"props":10704,"children":10705},{"style":411},[10706],{"type":62,"value":5180},{"type":56,"tag":382,"props":10708,"children":10709},{"style":1884},[10710],{"type":62,"value":782},{"type":56,"tag":382,"props":10712,"children":10713},{"style":411},[10714],{"type":62,"value":2195},{"type":56,"tag":382,"props":10716,"children":10717},{"class":384,"line":1822},[10718,10722,10726,10730,10734,10738,10743,10747,10751,10755,10760,10764,10768,10772,10776],{"type":56,"tag":382,"props":10719,"children":10720},{"style":531},[10721],{"type":62,"value":3596},{"type":56,"tag":382,"props":10723,"children":10724},{"style":411},[10725],{"type":62,"value":1906},{"type":56,"tag":382,"props":10727,"children":10728},{"style":399},[10729],{"type":62,"value":3325},{"type":56,"tag":382,"props":10731,"children":10732},{"style":1884},[10733],{"type":62,"value":1994},{"type":56,"tag":382,"props":10735,"children":10736},{"style":411},[10737],{"type":62,"value":3634},{"type":56,"tag":382,"props":10739,"children":10740},{"style":1884},[10741],{"type":62,"value":10742}," uploadUrl",{"type":56,"tag":382,"props":10744,"children":10745},{"style":411},[10746],{"type":62,"value":1629},{"type":56,"tag":382,"props":10748,"children":10749},{"style":531},[10750],{"type":62,"value":1980},{"type":56,"tag":382,"props":10752,"children":10753},{"style":411},[10754],{"type":62,"value":1639},{"type":56,"tag":382,"props":10756,"children":10757},{"style":1884},[10758],{"type":62,"value":10759}," fileKey",{"type":56,"tag":382,"props":10761,"children":10762},{"style":411},[10763],{"type":62,"value":1629},{"type":56,"tag":382,"props":10765,"children":10766},{"style":531},[10767],{"type":62,"value":10484},{"type":56,"tag":382,"props":10769,"children":10770},{"style":411},[10771],{"type":62,"value":3580},{"type":56,"tag":382,"props":10773,"children":10774},{"style":1884},[10775],{"type":62,"value":782},{"type":56,"tag":382,"props":10777,"children":10778},{"style":411},[10779],{"type":62,"value":2195},{"type":56,"tag":382,"props":10781,"children":10782},{"class":384,"line":2296},[10783,10787,10791],{"type":56,"tag":382,"props":10784,"children":10785},{"style":411},[10786],{"type":62,"value":2179},{"type":56,"tag":382,"props":10788,"children":10789},{"style":531},[10790],{"type":62,"value":782},{"type":56,"tag":382,"props":10792,"children":10793},{"style":411},[10794],{"type":62,"value":2195},{"type":56,"tag":72,"props":10796,"children":10797},{},[10798],{"type":56,"tag":76,"props":10799,"children":10800},{},[10801],{"type":62,"value":10802},"Frontend:",{"type":56,"tag":370,"props":10804,"children":10806},{"className":1567,"code":10805,"language":1569,"meta":375,"style":375},"async function uploadFile(file: File) {\n  const { uploadUrl, fileKey } = await apiClient.get\u003CPresignResponse>(\n    `\u002Fapi\u002Fuploads\u002Fpresign?filename=${file.name}&type=${file.type}`\n  );\n  await fetch(uploadUrl, { method: 'PUT', body: file, headers: { 'Content-Type': file.type } });\n  return apiClient.post('\u002Fapi\u002Fphotos', { fileKey });\n}\n",[10807],{"type":56,"tag":378,"props":10808,"children":10809},{"__ignoreMap":375},[10810,10852,10916,10976,10987,11113,11173],{"type":56,"tag":382,"props":10811,"children":10812},{"class":384,"line":385},[10813,10817,10821,10826,10830,10835,10839,10844,10848],{"type":56,"tag":382,"props":10814,"children":10815},{"style":1579},[10816],{"type":62,"value":4246},{"type":56,"tag":382,"props":10818,"children":10819},{"style":1579},[10820],{"type":62,"value":4810},{"type":56,"tag":382,"props":10822,"children":10823},{"style":399},[10824],{"type":62,"value":10825}," uploadFile",{"type":56,"tag":382,"props":10827,"children":10828},{"style":411},[10829],{"type":62,"value":1994},{"type":56,"tag":382,"props":10831,"children":10832},{"style":1621},[10833],{"type":62,"value":10834},"file",{"type":56,"tag":382,"props":10836,"children":10837},{"style":411},[10838],{"type":62,"value":1629},{"type":56,"tag":382,"props":10840,"children":10841},{"style":417},[10842],{"type":62,"value":10843}," File",{"type":56,"tag":382,"props":10845,"children":10846},{"style":411},[10847],{"type":62,"value":782},{"type":56,"tag":382,"props":10849,"children":10850},{"style":411},[10851],{"type":62,"value":1592},{"type":56,"tag":382,"props":10853,"children":10854},{"class":384,"line":395},[10855,10859,10863,10867,10871,10875,10879,10883,10887,10891,10895,10899,10903,10908,10912],{"type":56,"tag":382,"props":10856,"children":10857},{"style":1579},[10858],{"type":62,"value":2253},{"type":56,"tag":382,"props":10860,"children":10861},{"style":411},[10862],{"type":62,"value":1975},{"type":56,"tag":382,"props":10864,"children":10865},{"style":531},[10866],{"type":62,"value":10742},{"type":56,"tag":382,"props":10868,"children":10869},{"style":411},[10870],{"type":62,"value":1639},{"type":56,"tag":382,"props":10872,"children":10873},{"style":531},[10874],{"type":62,"value":10759},{"type":56,"tag":382,"props":10876,"children":10877},{"style":411},[10878],{"type":62,"value":3580},{"type":56,"tag":382,"props":10880,"children":10881},{"style":411},[10882],{"type":62,"value":2263},{"type":56,"tag":382,"props":10884,"children":10885},{"style":2182},[10886],{"type":62,"value":3927},{"type":56,"tag":382,"props":10888,"children":10889},{"style":531},[10890],{"type":62,"value":6241},{"type":56,"tag":382,"props":10892,"children":10893},{"style":411},[10894],{"type":62,"value":1906},{"type":56,"tag":382,"props":10896,"children":10897},{"style":399},[10898],{"type":62,"value":6534},{"type":56,"tag":382,"props":10900,"children":10901},{"style":411},[10902],{"type":62,"value":523},{"type":56,"tag":382,"props":10904,"children":10905},{"style":417},[10906],{"type":62,"value":10907},"PresignResponse",{"type":56,"tag":382,"props":10909,"children":10910},{"style":411},[10911],{"type":62,"value":4887},{"type":56,"tag":382,"props":10913,"children":10914},{"style":1884},[10915],{"type":62,"value":1605},{"type":56,"tag":382,"props":10917,"children":10918},{"class":384,"line":433},[10919,10924,10929,10933,10937,10941,10945,10949,10954,10958,10962,10966,10971],{"type":56,"tag":382,"props":10920,"children":10921},{"style":411},[10922],{"type":62,"value":10923},"    `",{"type":56,"tag":382,"props":10925,"children":10926},{"style":405},[10927],{"type":62,"value":10928},"\u002Fapi\u002Fuploads\u002Fpresign?filename=",{"type":56,"tag":382,"props":10930,"children":10931},{"style":411},[10932],{"type":62,"value":2355},{"type":56,"tag":382,"props":10934,"children":10935},{"style":531},[10936],{"type":62,"value":10834},{"type":56,"tag":382,"props":10938,"children":10939},{"style":411},[10940],{"type":62,"value":1906},{"type":56,"tag":382,"props":10942,"children":10943},{"style":531},[10944],{"type":62,"value":2223},{"type":56,"tag":382,"props":10946,"children":10947},{"style":411},[10948],{"type":62,"value":2179},{"type":56,"tag":382,"props":10950,"children":10951},{"style":405},[10952],{"type":62,"value":10953},"&type=",{"type":56,"tag":382,"props":10955,"children":10956},{"style":411},[10957],{"type":62,"value":2355},{"type":56,"tag":382,"props":10959,"children":10960},{"style":531},[10961],{"type":62,"value":10834},{"type":56,"tag":382,"props":10963,"children":10964},{"style":411},[10965],{"type":62,"value":1906},{"type":56,"tag":382,"props":10967,"children":10968},{"style":531},[10969],{"type":62,"value":10970},"type",{"type":56,"tag":382,"props":10972,"children":10973},{"style":411},[10974],{"type":62,"value":10975},"}`\n",{"type":56,"tag":382,"props":10977,"children":10978},{"class":384,"line":442},[10979,10983],{"type":56,"tag":382,"props":10980,"children":10981},{"style":1884},[10982],{"type":62,"value":1683},{"type":56,"tag":382,"props":10984,"children":10985},{"style":411},[10986],{"type":62,"value":2195},{"type":56,"tag":382,"props":10988,"children":10989},{"class":384,"line":1677},[10990,10994,10998,11002,11007,11011,11015,11019,11023,11027,11031,11035,11039,11043,11047,11052,11056,11061,11065,11069,11073,11077,11081,11085,11089,11093,11097,11101,11105,11109],{"type":56,"tag":382,"props":10991,"children":10992},{"style":2182},[10993],{"type":62,"value":4351},{"type":56,"tag":382,"props":10995,"children":10996},{"style":399},[10997],{"type":62,"value":4956},{"type":56,"tag":382,"props":10999,"children":11000},{"style":1884},[11001],{"type":62,"value":1994},{"type":56,"tag":382,"props":11003,"children":11004},{"style":531},[11005],{"type":62,"value":11006},"uploadUrl",{"type":56,"tag":382,"props":11008,"children":11009},{"style":411},[11010],{"type":62,"value":1639},{"type":56,"tag":382,"props":11012,"children":11013},{"style":411},[11014],{"type":62,"value":1975},{"type":56,"tag":382,"props":11016,"children":11017},{"style":1884},[11018],{"type":62,"value":5668},{"type":56,"tag":382,"props":11020,"children":11021},{"style":411},[11022],{"type":62,"value":1629},{"type":56,"tag":382,"props":11024,"children":11025},{"style":411},[11026],{"type":62,"value":1930},{"type":56,"tag":382,"props":11028,"children":11029},{"style":405},[11030],{"type":62,"value":5834},{"type":56,"tag":382,"props":11032,"children":11033},{"style":411},[11034],{"type":62,"value":1940},{"type":56,"tag":382,"props":11036,"children":11037},{"style":411},[11038],{"type":62,"value":1639},{"type":56,"tag":382,"props":11040,"children":11041},{"style":1884},[11042],{"type":62,"value":4683},{"type":56,"tag":382,"props":11044,"children":11045},{"style":411},[11046],{"type":62,"value":1629},{"type":56,"tag":382,"props":11048,"children":11049},{"style":531},[11050],{"type":62,"value":11051}," file",{"type":56,"tag":382,"props":11053,"children":11054},{"style":411},[11055],{"type":62,"value":1639},{"type":56,"tag":382,"props":11057,"children":11058},{"style":1884},[11059],{"type":62,"value":11060}," headers",{"type":56,"tag":382,"props":11062,"children":11063},{"style":411},[11064],{"type":62,"value":1629},{"type":56,"tag":382,"props":11066,"children":11067},{"style":411},[11068],{"type":62,"value":1975},{"type":56,"tag":382,"props":11070,"children":11071},{"style":411},[11072],{"type":62,"value":1930},{"type":56,"tag":382,"props":11074,"children":11075},{"style":1884},[11076],{"type":62,"value":5036},{"type":56,"tag":382,"props":11078,"children":11079},{"style":411},[11080],{"type":62,"value":1940},{"type":56,"tag":382,"props":11082,"children":11083},{"style":411},[11084],{"type":62,"value":1629},{"type":56,"tag":382,"props":11086,"children":11087},{"style":531},[11088],{"type":62,"value":11051},{"type":56,"tag":382,"props":11090,"children":11091},{"style":411},[11092],{"type":62,"value":1906},{"type":56,"tag":382,"props":11094,"children":11095},{"style":531},[11096],{"type":62,"value":10970},{"type":56,"tag":382,"props":11098,"children":11099},{"style":411},[11100],{"type":62,"value":3580},{"type":56,"tag":382,"props":11102,"children":11103},{"style":411},[11104],{"type":62,"value":3580},{"type":56,"tag":382,"props":11106,"children":11107},{"style":1884},[11108],{"type":62,"value":782},{"type":56,"tag":382,"props":11110,"children":11111},{"style":411},[11112],{"type":62,"value":2195},{"type":56,"tag":382,"props":11114,"children":11115},{"class":384,"line":1691},[11116,11120,11124,11128,11132,11136,11140,11145,11149,11153,11157,11161,11165,11169],{"type":56,"tag":382,"props":11117,"children":11118},{"style":2182},[11119],{"type":62,"value":2387},{"type":56,"tag":382,"props":11121,"children":11122},{"style":531},[11123],{"type":62,"value":6241},{"type":56,"tag":382,"props":11125,"children":11126},{"style":411},[11127],{"type":62,"value":1906},{"type":56,"tag":382,"props":11129,"children":11130},{"style":399},[11131],{"type":62,"value":6776},{"type":56,"tag":382,"props":11133,"children":11134},{"style":1884},[11135],{"type":62,"value":1994},{"type":56,"tag":382,"props":11137,"children":11138},{"style":411},[11139],{"type":62,"value":1940},{"type":56,"tag":382,"props":11141,"children":11142},{"style":405},[11143],{"type":62,"value":11144},"\u002Fapi\u002Fphotos",{"type":56,"tag":382,"props":11146,"children":11147},{"style":411},[11148],{"type":62,"value":1940},{"type":56,"tag":382,"props":11150,"children":11151},{"style":411},[11152],{"type":62,"value":1639},{"type":56,"tag":382,"props":11154,"children":11155},{"style":411},[11156],{"type":62,"value":1975},{"type":56,"tag":382,"props":11158,"children":11159},{"style":531},[11160],{"type":62,"value":10759},{"type":56,"tag":382,"props":11162,"children":11163},{"style":411},[11164],{"type":62,"value":3580},{"type":56,"tag":382,"props":11166,"children":11167},{"style":1884},[11168],{"type":62,"value":782},{"type":56,"tag":382,"props":11170,"children":11171},{"style":411},[11172],{"type":62,"value":2195},{"type":56,"tag":382,"props":11174,"children":11175},{"class":384,"line":1813},[11176],{"type":56,"tag":382,"props":11177,"children":11178},{"style":411},[11179],{"type":62,"value":1697},{"type":56,"tag":82,"props":11181,"children":11183},{"id":11182},"option-b-multipart-small-files-10mb",[11184],{"type":62,"value":11185},"Option B: Multipart (Small Files \u003C 10MB)",{"type":56,"tag":370,"props":11187,"children":11189},{"className":1567,"code":11188,"language":1569,"meta":375,"style":375},"\u002F\u002F Frontend\nconst formData = new FormData();\nformData.append('file', file);\nformData.append('description', 'Profile photo');\nconst res = await fetch('\u002Fapi\u002Fupload', { method: 'POST', body: formData });\n\u002F\u002F Note: do NOT set Content-Type header — browser sets boundary automatically\n",[11190],{"type":56,"tag":378,"props":11191,"children":11192},{"__ignoreMap":375},[11193,11201,11234,11280,11337,11434],{"type":56,"tag":382,"props":11194,"children":11195},{"class":384,"line":385},[11196],{"type":56,"tag":382,"props":11197,"children":11198},{"style":389},[11199],{"type":62,"value":11200},"\u002F\u002F Frontend\n",{"type":56,"tag":382,"props":11202,"children":11203},{"class":384,"line":395},[11204,11208,11213,11217,11221,11226,11230],{"type":56,"tag":382,"props":11205,"children":11206},{"style":1579},[11207],{"type":62,"value":1864},{"type":56,"tag":382,"props":11209,"children":11210},{"style":531},[11211],{"type":62,"value":11212}," formData ",{"type":56,"tag":382,"props":11214,"children":11215},{"style":411},[11216],{"type":62,"value":1874},{"type":56,"tag":382,"props":11218,"children":11219},{"style":411},[11220],{"type":62,"value":2331},{"type":56,"tag":382,"props":11222,"children":11223},{"style":399},[11224],{"type":62,"value":11225}," FormData",{"type":56,"tag":382,"props":11227,"children":11228},{"style":531},[11229],{"type":62,"value":3955},{"type":56,"tag":382,"props":11231,"children":11232},{"style":411},[11233],{"type":62,"value":2195},{"type":56,"tag":382,"props":11235,"children":11236},{"class":384,"line":433},[11237,11242,11246,11251,11255,11259,11263,11267,11271,11276],{"type":56,"tag":382,"props":11238,"children":11239},{"style":531},[11240],{"type":62,"value":11241},"formData",{"type":56,"tag":382,"props":11243,"children":11244},{"style":411},[11245],{"type":62,"value":1906},{"type":56,"tag":382,"props":11247,"children":11248},{"style":399},[11249],{"type":62,"value":11250},"append",{"type":56,"tag":382,"props":11252,"children":11253},{"style":531},[11254],{"type":62,"value":1994},{"type":56,"tag":382,"props":11256,"children":11257},{"style":411},[11258],{"type":62,"value":1940},{"type":56,"tag":382,"props":11260,"children":11261},{"style":405},[11262],{"type":62,"value":10834},{"type":56,"tag":382,"props":11264,"children":11265},{"style":411},[11266],{"type":62,"value":1940},{"type":56,"tag":382,"props":11268,"children":11269},{"style":411},[11270],{"type":62,"value":1639},{"type":56,"tag":382,"props":11272,"children":11273},{"style":531},[11274],{"type":62,"value":11275}," file)",{"type":56,"tag":382,"props":11277,"children":11278},{"style":411},[11279],{"type":62,"value":2195},{"type":56,"tag":382,"props":11281,"children":11282},{"class":384,"line":442},[11283,11287,11291,11295,11299,11303,11308,11312,11316,11320,11325,11329,11333],{"type":56,"tag":382,"props":11284,"children":11285},{"style":531},[11286],{"type":62,"value":11241},{"type":56,"tag":382,"props":11288,"children":11289},{"style":411},[11290],{"type":62,"value":1906},{"type":56,"tag":382,"props":11292,"children":11293},{"style":399},[11294],{"type":62,"value":11250},{"type":56,"tag":382,"props":11296,"children":11297},{"style":531},[11298],{"type":62,"value":1994},{"type":56,"tag":382,"props":11300,"children":11301},{"style":411},[11302],{"type":62,"value":1940},{"type":56,"tag":382,"props":11304,"children":11305},{"style":405},[11306],{"type":62,"value":11307},"description",{"type":56,"tag":382,"props":11309,"children":11310},{"style":411},[11311],{"type":62,"value":1940},{"type":56,"tag":382,"props":11313,"children":11314},{"style":411},[11315],{"type":62,"value":1639},{"type":56,"tag":382,"props":11317,"children":11318},{"style":411},[11319],{"type":62,"value":1930},{"type":56,"tag":382,"props":11321,"children":11322},{"style":405},[11323],{"type":62,"value":11324},"Profile photo",{"type":56,"tag":382,"props":11326,"children":11327},{"style":411},[11328],{"type":62,"value":1940},{"type":56,"tag":382,"props":11330,"children":11331},{"style":531},[11332],{"type":62,"value":782},{"type":56,"tag":382,"props":11334,"children":11335},{"style":411},[11336],{"type":62,"value":2195},{"type":56,"tag":382,"props":11338,"children":11339},{"class":384,"line":1677},[11340,11344,11349,11353,11357,11361,11365,11369,11374,11378,11382,11386,11390,11394,11398,11402,11406,11410,11414,11418,11422,11426,11430],{"type":56,"tag":382,"props":11341,"children":11342},{"style":1579},[11343],{"type":62,"value":1864},{"type":56,"tag":382,"props":11345,"children":11346},{"style":531},[11347],{"type":62,"value":11348}," res ",{"type":56,"tag":382,"props":11350,"children":11351},{"style":411},[11352],{"type":62,"value":1874},{"type":56,"tag":382,"props":11354,"children":11355},{"style":2182},[11356],{"type":62,"value":3927},{"type":56,"tag":382,"props":11358,"children":11359},{"style":399},[11360],{"type":62,"value":4956},{"type":56,"tag":382,"props":11362,"children":11363},{"style":531},[11364],{"type":62,"value":1994},{"type":56,"tag":382,"props":11366,"children":11367},{"style":411},[11368],{"type":62,"value":1940},{"type":56,"tag":382,"props":11370,"children":11371},{"style":405},[11372],{"type":62,"value":11373},"\u002Fapi\u002Fupload",{"type":56,"tag":382,"props":11375,"children":11376},{"style":411},[11377],{"type":62,"value":1940},{"type":56,"tag":382,"props":11379,"children":11380},{"style":411},[11381],{"type":62,"value":1639},{"type":56,"tag":382,"props":11383,"children":11384},{"style":411},[11385],{"type":62,"value":1975},{"type":56,"tag":382,"props":11387,"children":11388},{"style":1884},[11389],{"type":62,"value":5668},{"type":56,"tag":382,"props":11391,"children":11392},{"style":411},[11393],{"type":62,"value":1629},{"type":56,"tag":382,"props":11395,"children":11396},{"style":411},[11397],{"type":62,"value":1930},{"type":56,"tag":382,"props":11399,"children":11400},{"style":405},[11401],{"type":62,"value":5681},{"type":56,"tag":382,"props":11403,"children":11404},{"style":411},[11405],{"type":62,"value":1940},{"type":56,"tag":382,"props":11407,"children":11408},{"style":411},[11409],{"type":62,"value":1639},{"type":56,"tag":382,"props":11411,"children":11412},{"style":1884},[11413],{"type":62,"value":4683},{"type":56,"tag":382,"props":11415,"children":11416},{"style":411},[11417],{"type":62,"value":1629},{"type":56,"tag":382,"props":11419,"children":11420},{"style":531},[11421],{"type":62,"value":11212},{"type":56,"tag":382,"props":11423,"children":11424},{"style":411},[11425],{"type":62,"value":2179},{"type":56,"tag":382,"props":11427,"children":11428},{"style":531},[11429],{"type":62,"value":782},{"type":56,"tag":382,"props":11431,"children":11432},{"style":411},[11433],{"type":62,"value":2195},{"type":56,"tag":382,"props":11435,"children":11436},{"class":384,"line":1691},[11437],{"type":56,"tag":382,"props":11438,"children":11439},{"style":389},[11440],{"type":62,"value":11441},"\u002F\u002F Note: do NOT set Content-Type header — browser sets boundary automatically\n",{"type":56,"tag":82,"props":11443,"children":11445},{"id":11444},"decision",[11446],{"type":62,"value":191},{"type":56,"tag":175,"props":11448,"children":11449},{},[11450,11476],{"type":56,"tag":179,"props":11451,"children":11452},{},[11453],{"type":56,"tag":183,"props":11454,"children":11455},{},[11456,11461,11466,11471],{"type":56,"tag":187,"props":11457,"children":11458},{},[11459],{"type":62,"value":11460},"Method",{"type":56,"tag":187,"props":11462,"children":11463},{},[11464],{"type":62,"value":11465},"File Size",{"type":56,"tag":187,"props":11467,"children":11468},{},[11469],{"type":62,"value":11470},"Server Load",{"type":56,"tag":187,"props":11472,"children":11473},{},[11474],{"type":62,"value":11475},"Complexity",{"type":56,"tag":203,"props":11477,"children":11478},{},[11479,11501,11523],{"type":56,"tag":183,"props":11480,"children":11481},{},[11482,11487,11492,11497],{"type":56,"tag":210,"props":11483,"children":11484},{},[11485],{"type":62,"value":11486},"Presigned URL",{"type":56,"tag":210,"props":11488,"children":11489},{},[11490],{"type":62,"value":11491},"Any (recommended > 5MB)",{"type":56,"tag":210,"props":11493,"children":11494},{},[11495],{"type":62,"value":11496},"None (direct to storage)",{"type":56,"tag":210,"props":11498,"children":11499},{},[11500],{"type":62,"value":7970},{"type":56,"tag":183,"props":11502,"children":11503},{},[11504,11509,11514,11519],{"type":56,"tag":210,"props":11505,"children":11506},{},[11507],{"type":62,"value":11508},"Multipart",{"type":56,"tag":210,"props":11510,"children":11511},{},[11512],{"type":62,"value":11513},"\u003C 10MB",{"type":56,"tag":210,"props":11515,"children":11516},{},[11517],{"type":62,"value":11518},"High (streams through server)",{"type":56,"tag":210,"props":11520,"children":11521},{},[11522],{"type":62,"value":7948},{"type":56,"tag":183,"props":11524,"children":11525},{},[11526,11531,11536,11540],{"type":56,"tag":210,"props":11527,"children":11528},{},[11529],{"type":62,"value":11530},"Chunked \u002F Resumable",{"type":56,"tag":210,"props":11532,"children":11533},{},[11534],{"type":62,"value":11535},"> 100MB",{"type":56,"tag":210,"props":11537,"children":11538},{},[11539],{"type":62,"value":7970},{"type":56,"tag":210,"props":11541,"children":11542},{},[11543],{"type":62,"value":11544},"High",{"type":56,"tag":621,"props":11546,"children":11547},{},[],{"type":56,"tag":65,"props":11549,"children":11551},{"id":11550},"_11-real-time-patterns-medium",[11552],{"type":62,"value":11553},"11. Real-Time Patterns (MEDIUM)",{"type":56,"tag":82,"props":11555,"children":11557},{"id":11556},"option-a-server-sent-events-sse-one-way-server-client",[11558],{"type":62,"value":11559},"Option A: Server-Sent Events (SSE) — One-Way Server → Client",{"type":56,"tag":72,"props":11561,"children":11562},{},[11563],{"type":62,"value":11564},"Best for: notifications, live feeds, streaming AI responses.",{"type":56,"tag":72,"props":11566,"children":11567},{},[11568],{"type":56,"tag":76,"props":11569,"children":11570},{},[11571],{"type":62,"value":11572},"Backend (Express):",{"type":56,"tag":370,"props":11574,"children":11576},{"className":1567,"code":11575,"language":1569,"meta":375,"style":375},"app.get('\u002Fapi\u002Fevents', authenticate, (req, res) => {\n  res.writeHead(200, {\n    'Content-Type': 'text\u002Fevent-stream',\n    'Cache-Control': 'no-cache',\n    Connection: 'keep-alive',\n  });\n  const send = (event: string, data: unknown) => {\n    res.write(`event: ${event}\\ndata: ${JSON.stringify(data)}\\n\\n`);\n  };\n  const unsubscribe = eventBus.subscribe(req.user.id, (event) => {\n    send(event.type, event.payload);\n  });\n  req.on('close', () => unsubscribe());\n});\n",[11577],{"type":56,"tag":378,"props":11578,"children":11579},{"__ignoreMap":375},[11580,11652,11685,11722,11759,11788,11803,11864,11959,11966,12044,12094,12109,12168],{"type":56,"tag":382,"props":11581,"children":11582},{"class":384,"line":385},[11583,11587,11591,11595,11599,11603,11608,11612,11616,11620,11624,11628,11632,11636,11640,11644,11648],{"type":56,"tag":382,"props":11584,"children":11585},{"style":531},[11586],{"type":62,"value":3161},{"type":56,"tag":382,"props":11588,"children":11589},{"style":411},[11590],{"type":62,"value":1906},{"type":56,"tag":382,"props":11592,"children":11593},{"style":399},[11594],{"type":62,"value":6534},{"type":56,"tag":382,"props":11596,"children":11597},{"style":531},[11598],{"type":62,"value":1994},{"type":56,"tag":382,"props":11600,"children":11601},{"style":411},[11602],{"type":62,"value":1940},{"type":56,"tag":382,"props":11604,"children":11605},{"style":405},[11606],{"type":62,"value":11607},"\u002Fapi\u002Fevents",{"type":56,"tag":382,"props":11609,"children":11610},{"style":411},[11611],{"type":62,"value":1940},{"type":56,"tag":382,"props":11613,"children":11614},{"style":411},[11615],{"type":62,"value":1639},{"type":56,"tag":382,"props":11617,"children":11618},{"style":531},[11619],{"type":62,"value":8423},{"type":56,"tag":382,"props":11621,"children":11622},{"style":411},[11623],{"type":62,"value":1639},{"type":56,"tag":382,"props":11625,"children":11626},{"style":411},[11627],{"type":62,"value":2307},{"type":56,"tag":382,"props":11629,"children":11630},{"style":1621},[11631],{"type":62,"value":8164},{"type":56,"tag":382,"props":11633,"children":11634},{"style":411},[11635],{"type":62,"value":1639},{"type":56,"tag":382,"props":11637,"children":11638},{"style":1621},[11639],{"type":62,"value":3201},{"type":56,"tag":382,"props":11641,"children":11642},{"style":411},[11643],{"type":62,"value":782},{"type":56,"tag":382,"props":11645,"children":11646},{"style":1579},[11647],{"type":62,"value":3219},{"type":56,"tag":382,"props":11649,"children":11650},{"style":411},[11651],{"type":62,"value":1592},{"type":56,"tag":382,"props":11653,"children":11654},{"class":384,"line":395},[11655,11659,11663,11668,11672,11677,11681],{"type":56,"tag":382,"props":11656,"children":11657},{"style":531},[11658],{"type":62,"value":3596},{"type":56,"tag":382,"props":11660,"children":11661},{"style":411},[11662],{"type":62,"value":1906},{"type":56,"tag":382,"props":11664,"children":11665},{"style":399},[11666],{"type":62,"value":11667},"writeHead",{"type":56,"tag":382,"props":11669,"children":11670},{"style":1884},[11671],{"type":62,"value":1994},{"type":56,"tag":382,"props":11673,"children":11674},{"style":1947},[11675],{"type":62,"value":11676},"200",{"type":56,"tag":382,"props":11678,"children":11679},{"style":411},[11680],{"type":62,"value":1639},{"type":56,"tag":382,"props":11682,"children":11683},{"style":411},[11684],{"type":62,"value":1592},{"type":56,"tag":382,"props":11686,"children":11687},{"class":384,"line":433},[11688,11693,11697,11701,11705,11709,11714,11718],{"type":56,"tag":382,"props":11689,"children":11690},{"style":411},[11691],{"type":62,"value":11692},"    '",{"type":56,"tag":382,"props":11694,"children":11695},{"style":1884},[11696],{"type":62,"value":5036},{"type":56,"tag":382,"props":11698,"children":11699},{"style":411},[11700],{"type":62,"value":1940},{"type":56,"tag":382,"props":11702,"children":11703},{"style":411},[11704],{"type":62,"value":1629},{"type":56,"tag":382,"props":11706,"children":11707},{"style":411},[11708],{"type":62,"value":1930},{"type":56,"tag":382,"props":11710,"children":11711},{"style":405},[11712],{"type":62,"value":11713},"text\u002Fevent-stream",{"type":56,"tag":382,"props":11715,"children":11716},{"style":411},[11717],{"type":62,"value":1940},{"type":56,"tag":382,"props":11719,"children":11720},{"style":411},[11721],{"type":62,"value":1674},{"type":56,"tag":382,"props":11723,"children":11724},{"class":384,"line":442},[11725,11729,11734,11738,11742,11746,11751,11755],{"type":56,"tag":382,"props":11726,"children":11727},{"style":411},[11728],{"type":62,"value":11692},{"type":56,"tag":382,"props":11730,"children":11731},{"style":1884},[11732],{"type":62,"value":11733},"Cache-Control",{"type":56,"tag":382,"props":11735,"children":11736},{"style":411},[11737],{"type":62,"value":1940},{"type":56,"tag":382,"props":11739,"children":11740},{"style":411},[11741],{"type":62,"value":1629},{"type":56,"tag":382,"props":11743,"children":11744},{"style":411},[11745],{"type":62,"value":1930},{"type":56,"tag":382,"props":11747,"children":11748},{"style":405},[11749],{"type":62,"value":11750},"no-cache",{"type":56,"tag":382,"props":11752,"children":11753},{"style":411},[11754],{"type":62,"value":1940},{"type":56,"tag":382,"props":11756,"children":11757},{"style":411},[11758],{"type":62,"value":1674},{"type":56,"tag":382,"props":11760,"children":11761},{"class":384,"line":1677},[11762,11767,11771,11775,11780,11784],{"type":56,"tag":382,"props":11763,"children":11764},{"style":1884},[11765],{"type":62,"value":11766},"    Connection",{"type":56,"tag":382,"props":11768,"children":11769},{"style":411},[11770],{"type":62,"value":1629},{"type":56,"tag":382,"props":11772,"children":11773},{"style":411},[11774],{"type":62,"value":1930},{"type":56,"tag":382,"props":11776,"children":11777},{"style":405},[11778],{"type":62,"value":11779},"keep-alive",{"type":56,"tag":382,"props":11781,"children":11782},{"style":411},[11783],{"type":62,"value":1940},{"type":56,"tag":382,"props":11785,"children":11786},{"style":411},[11787],{"type":62,"value":1674},{"type":56,"tag":382,"props":11789,"children":11790},{"class":384,"line":1691},[11791,11795,11799],{"type":56,"tag":382,"props":11792,"children":11793},{"style":411},[11794],{"type":62,"value":5180},{"type":56,"tag":382,"props":11796,"children":11797},{"style":1884},[11798],{"type":62,"value":782},{"type":56,"tag":382,"props":11800,"children":11801},{"style":411},[11802],{"type":62,"value":2195},{"type":56,"tag":382,"props":11804,"children":11805},{"class":384,"line":1813},[11806,11810,11815,11819,11823,11828,11832,11836,11840,11844,11848,11852,11856,11860],{"type":56,"tag":382,"props":11807,"children":11808},{"style":1579},[11809],{"type":62,"value":2253},{"type":56,"tag":382,"props":11811,"children":11812},{"style":531},[11813],{"type":62,"value":11814}," send",{"type":56,"tag":382,"props":11816,"children":11817},{"style":411},[11818],{"type":62,"value":2263},{"type":56,"tag":382,"props":11820,"children":11821},{"style":411},[11822],{"type":62,"value":2307},{"type":56,"tag":382,"props":11824,"children":11825},{"style":1621},[11826],{"type":62,"value":11827},"event",{"type":56,"tag":382,"props":11829,"children":11830},{"style":411},[11831],{"type":62,"value":1629},{"type":56,"tag":382,"props":11833,"children":11834},{"style":417},[11835],{"type":62,"value":2232},{"type":56,"tag":382,"props":11837,"children":11838},{"style":411},[11839],{"type":62,"value":1639},{"type":56,"tag":382,"props":11841,"children":11842},{"style":1621},[11843],{"type":62,"value":4322},{"type":56,"tag":382,"props":11845,"children":11846},{"style":411},[11847],{"type":62,"value":1629},{"type":56,"tag":382,"props":11849,"children":11850},{"style":417},[11851],{"type":62,"value":5626},{"type":56,"tag":382,"props":11853,"children":11854},{"style":411},[11855],{"type":62,"value":782},{"type":56,"tag":382,"props":11857,"children":11858},{"style":1579},[11859],{"type":62,"value":3219},{"type":56,"tag":382,"props":11861,"children":11862},{"style":411},[11863],{"type":62,"value":1592},{"type":56,"tag":382,"props":11865,"children":11866},{"class":384,"line":1822},[11867,11872,11876,11881,11885,11889,11894,11898,11902,11906,11911,11916,11920,11925,11929,11933,11938,11942,11947,11951,11955],{"type":56,"tag":382,"props":11868,"children":11869},{"style":531},[11870],{"type":62,"value":11871},"    res",{"type":56,"tag":382,"props":11873,"children":11874},{"style":411},[11875],{"type":62,"value":1906},{"type":56,"tag":382,"props":11877,"children":11878},{"style":399},[11879],{"type":62,"value":11880},"write",{"type":56,"tag":382,"props":11882,"children":11883},{"style":1884},[11884],{"type":62,"value":1994},{"type":56,"tag":382,"props":11886,"children":11887},{"style":411},[11888],{"type":62,"value":2345},{"type":56,"tag":382,"props":11890,"children":11891},{"style":405},[11892],{"type":62,"value":11893},"event: ",{"type":56,"tag":382,"props":11895,"children":11896},{"style":411},[11897],{"type":62,"value":2355},{"type":56,"tag":382,"props":11899,"children":11900},{"style":531},[11901],{"type":62,"value":11827},{"type":56,"tag":382,"props":11903,"children":11904},{"style":411},[11905],{"type":62,"value":2179},{"type":56,"tag":382,"props":11907,"children":11908},{"style":531},[11909],{"type":62,"value":11910},"\\n",{"type":56,"tag":382,"props":11912,"children":11913},{"style":405},[11914],{"type":62,"value":11915},"data: ",{"type":56,"tag":382,"props":11917,"children":11918},{"style":411},[11919],{"type":62,"value":2355},{"type":56,"tag":382,"props":11921,"children":11922},{"style":531},[11923],{"type":62,"value":11924},"JSON",{"type":56,"tag":382,"props":11926,"children":11927},{"style":411},[11928],{"type":62,"value":1906},{"type":56,"tag":382,"props":11930,"children":11931},{"style":399},[11932],{"type":62,"value":5711},{"type":56,"tag":382,"props":11934,"children":11935},{"style":531},[11936],{"type":62,"value":11937},"(data)",{"type":56,"tag":382,"props":11939,"children":11940},{"style":411},[11941],{"type":62,"value":2179},{"type":56,"tag":382,"props":11943,"children":11944},{"style":531},[11945],{"type":62,"value":11946},"\\n\\n",{"type":56,"tag":382,"props":11948,"children":11949},{"style":411},[11950],{"type":62,"value":2345},{"type":56,"tag":382,"props":11952,"children":11953},{"style":1884},[11954],{"type":62,"value":782},{"type":56,"tag":382,"props":11956,"children":11957},{"style":411},[11958],{"type":62,"value":2195},{"type":56,"tag":382,"props":11960,"children":11961},{"class":384,"line":2296},[11962],{"type":56,"tag":382,"props":11963,"children":11964},{"style":411},[11965],{"type":62,"value":8373},{"type":56,"tag":382,"props":11967,"children":11968},{"class":384,"line":2381},[11969,11973,11978,11982,11987,11991,11996,12000,12004,12008,12012,12016,12020,12024,12028,12032,12036,12040],{"type":56,"tag":382,"props":11970,"children":11971},{"style":1579},[11972],{"type":62,"value":2253},{"type":56,"tag":382,"props":11974,"children":11975},{"style":531},[11976],{"type":62,"value":11977}," unsubscribe",{"type":56,"tag":382,"props":11979,"children":11980},{"style":411},[11981],{"type":62,"value":2263},{"type":56,"tag":382,"props":11983,"children":11984},{"style":531},[11985],{"type":62,"value":11986}," eventBus",{"type":56,"tag":382,"props":11988,"children":11989},{"style":411},[11990],{"type":62,"value":1906},{"type":56,"tag":382,"props":11992,"children":11993},{"style":399},[11994],{"type":62,"value":11995},"subscribe",{"type":56,"tag":382,"props":11997,"children":11998},{"style":1884},[11999],{"type":62,"value":1994},{"type":56,"tag":382,"props":12001,"children":12002},{"style":531},[12003],{"type":62,"value":8164},{"type":56,"tag":382,"props":12005,"children":12006},{"style":411},[12007],{"type":62,"value":1906},{"type":56,"tag":382,"props":12009,"children":12010},{"style":531},[12011],{"type":62,"value":7574},{"type":56,"tag":382,"props":12013,"children":12014},{"style":411},[12015],{"type":62,"value":1906},{"type":56,"tag":382,"props":12017,"children":12018},{"style":531},[12019],{"type":62,"value":2859},{"type":56,"tag":382,"props":12021,"children":12022},{"style":411},[12023],{"type":62,"value":1639},{"type":56,"tag":382,"props":12025,"children":12026},{"style":411},[12027],{"type":62,"value":2307},{"type":56,"tag":382,"props":12029,"children":12030},{"style":1621},[12031],{"type":62,"value":11827},{"type":56,"tag":382,"props":12033,"children":12034},{"style":411},[12035],{"type":62,"value":782},{"type":56,"tag":382,"props":12037,"children":12038},{"style":1579},[12039],{"type":62,"value":3219},{"type":56,"tag":382,"props":12041,"children":12042},{"style":411},[12043],{"type":62,"value":1592},{"type":56,"tag":382,"props":12045,"children":12046},{"class":384,"line":2398},[12047,12052,12056,12060,12064,12068,12072,12077,12081,12086,12090],{"type":56,"tag":382,"props":12048,"children":12049},{"style":399},[12050],{"type":62,"value":12051},"    send",{"type":56,"tag":382,"props":12053,"children":12054},{"style":1884},[12055],{"type":62,"value":1994},{"type":56,"tag":382,"props":12057,"children":12058},{"style":531},[12059],{"type":62,"value":11827},{"type":56,"tag":382,"props":12061,"children":12062},{"style":411},[12063],{"type":62,"value":1906},{"type":56,"tag":382,"props":12065,"children":12066},{"style":531},[12067],{"type":62,"value":10970},{"type":56,"tag":382,"props":12069,"children":12070},{"style":411},[12071],{"type":62,"value":1639},{"type":56,"tag":382,"props":12073,"children":12074},{"style":531},[12075],{"type":62,"value":12076}," event",{"type":56,"tag":382,"props":12078,"children":12079},{"style":411},[12080],{"type":62,"value":1906},{"type":56,"tag":382,"props":12082,"children":12083},{"style":531},[12084],{"type":62,"value":12085},"payload",{"type":56,"tag":382,"props":12087,"children":12088},{"style":1884},[12089],{"type":62,"value":782},{"type":56,"tag":382,"props":12091,"children":12092},{"style":411},[12093],{"type":62,"value":2195},{"type":56,"tag":382,"props":12095,"children":12096},{"class":384,"line":2822},[12097,12101,12105],{"type":56,"tag":382,"props":12098,"children":12099},{"style":411},[12100],{"type":62,"value":5180},{"type":56,"tag":382,"props":12102,"children":12103},{"style":1884},[12104],{"type":62,"value":782},{"type":56,"tag":382,"props":12106,"children":12107},{"style":411},[12108],{"type":62,"value":2195},{"type":56,"tag":382,"props":12110,"children":12111},{"class":384,"line":2900},[12112,12117,12121,12126,12130,12134,12139,12143,12147,12151,12155,12159,12164],{"type":56,"tag":382,"props":12113,"children":12114},{"style":531},[12115],{"type":62,"value":12116},"  req",{"type":56,"tag":382,"props":12118,"children":12119},{"style":411},[12120],{"type":62,"value":1906},{"type":56,"tag":382,"props":12122,"children":12123},{"style":399},[12124],{"type":62,"value":12125},"on",{"type":56,"tag":382,"props":12127,"children":12128},{"style":1884},[12129],{"type":62,"value":1994},{"type":56,"tag":382,"props":12131,"children":12132},{"style":411},[12133],{"type":62,"value":1940},{"type":56,"tag":382,"props":12135,"children":12136},{"style":405},[12137],{"type":62,"value":12138},"close",{"type":56,"tag":382,"props":12140,"children":12141},{"style":411},[12142],{"type":62,"value":1940},{"type":56,"tag":382,"props":12144,"children":12145},{"style":411},[12146],{"type":62,"value":1639},{"type":56,"tag":382,"props":12148,"children":12149},{"style":411},[12150],{"type":62,"value":6517},{"type":56,"tag":382,"props":12152,"children":12153},{"style":1579},[12154],{"type":62,"value":3219},{"type":56,"tag":382,"props":12156,"children":12157},{"style":399},[12158],{"type":62,"value":11977},{"type":56,"tag":382,"props":12160,"children":12161},{"style":1884},[12162],{"type":62,"value":12163},"())",{"type":56,"tag":382,"props":12165,"children":12166},{"style":411},[12167],{"type":62,"value":2195},{"type":56,"tag":382,"props":12169,"children":12170},{"class":384,"line":2909},[12171,12175,12179],{"type":56,"tag":382,"props":12172,"children":12173},{"style":411},[12174],{"type":62,"value":2179},{"type":56,"tag":382,"props":12176,"children":12177},{"style":531},[12178],{"type":62,"value":782},{"type":56,"tag":382,"props":12180,"children":12181},{"style":411},[12182],{"type":62,"value":2195},{"type":56,"tag":72,"props":12184,"children":12185},{},[12186],{"type":56,"tag":76,"props":12187,"children":12188},{},[12189],{"type":62,"value":10802},{"type":56,"tag":370,"props":12191,"children":12193},{"className":1567,"code":12192,"language":1569,"meta":375,"style":375},"function useServerEvents(userId: string) {\n  useEffect(() => {\n    const source = new EventSource(`\u002Fapi\u002Fevents?userId=${userId}`);\n    source.addEventListener('notification', (e) => {\n      showToast(JSON.parse(e.data).message);\n    });\n    source.onerror = () => { source.close(); setTimeout(() => \u002F* reconnect *\u002F, 3000); };\n    return () => source.close();\n  }, [userId]);\n}\n",[12194],{"type":56,"tag":378,"props":12195,"children":12196},{"__ignoreMap":375},[12197,12234,12258,12316,12374,12434,12449,12545,12580,12605],{"type":56,"tag":382,"props":12198,"children":12199},{"class":384,"line":385},[12200,12204,12209,12213,12218,12222,12226,12230],{"type":56,"tag":382,"props":12201,"children":12202},{"style":1579},[12203],{"type":62,"value":2210},{"type":56,"tag":382,"props":12205,"children":12206},{"style":399},[12207],{"type":62,"value":12208}," useServerEvents",{"type":56,"tag":382,"props":12210,"children":12211},{"style":411},[12212],{"type":62,"value":1994},{"type":56,"tag":382,"props":12214,"children":12215},{"style":1621},[12216],{"type":62,"value":12217},"userId",{"type":56,"tag":382,"props":12219,"children":12220},{"style":411},[12221],{"type":62,"value":1629},{"type":56,"tag":382,"props":12223,"children":12224},{"style":417},[12225],{"type":62,"value":2232},{"type":56,"tag":382,"props":12227,"children":12228},{"style":411},[12229],{"type":62,"value":782},{"type":56,"tag":382,"props":12231,"children":12232},{"style":411},[12233],{"type":62,"value":1592},{"type":56,"tag":382,"props":12235,"children":12236},{"class":384,"line":395},[12237,12242,12246,12250,12254],{"type":56,"tag":382,"props":12238,"children":12239},{"style":399},[12240],{"type":62,"value":12241},"  useEffect",{"type":56,"tag":382,"props":12243,"children":12244},{"style":1884},[12245],{"type":62,"value":1994},{"type":56,"tag":382,"props":12247,"children":12248},{"style":411},[12249],{"type":62,"value":3955},{"type":56,"tag":382,"props":12251,"children":12252},{"style":1579},[12253],{"type":62,"value":3219},{"type":56,"tag":382,"props":12255,"children":12256},{"style":411},[12257],{"type":62,"value":1592},{"type":56,"tag":382,"props":12259,"children":12260},{"class":384,"line":433},[12261,12265,12270,12274,12278,12283,12287,12291,12296,12300,12304,12308,12312],{"type":56,"tag":382,"props":12262,"children":12263},{"style":1579},[12264],{"type":62,"value":5243},{"type":56,"tag":382,"props":12266,"children":12267},{"style":531},[12268],{"type":62,"value":12269}," source",{"type":56,"tag":382,"props":12271,"children":12272},{"style":411},[12273],{"type":62,"value":2263},{"type":56,"tag":382,"props":12275,"children":12276},{"style":411},[12277],{"type":62,"value":2331},{"type":56,"tag":382,"props":12279,"children":12280},{"style":399},[12281],{"type":62,"value":12282}," EventSource",{"type":56,"tag":382,"props":12284,"children":12285},{"style":1884},[12286],{"type":62,"value":1994},{"type":56,"tag":382,"props":12288,"children":12289},{"style":411},[12290],{"type":62,"value":2345},{"type":56,"tag":382,"props":12292,"children":12293},{"style":405},[12294],{"type":62,"value":12295},"\u002Fapi\u002Fevents?userId=",{"type":56,"tag":382,"props":12297,"children":12298},{"style":411},[12299],{"type":62,"value":2355},{"type":56,"tag":382,"props":12301,"children":12302},{"style":531},[12303],{"type":62,"value":12217},{"type":56,"tag":382,"props":12305,"children":12306},{"style":411},[12307],{"type":62,"value":2364},{"type":56,"tag":382,"props":12309,"children":12310},{"style":1884},[12311],{"type":62,"value":782},{"type":56,"tag":382,"props":12313,"children":12314},{"style":411},[12315],{"type":62,"value":2195},{"type":56,"tag":382,"props":12317,"children":12318},{"class":384,"line":442},[12319,12324,12328,12333,12337,12341,12346,12350,12354,12358,12362,12366,12370],{"type":56,"tag":382,"props":12320,"children":12321},{"style":531},[12322],{"type":62,"value":12323},"    source",{"type":56,"tag":382,"props":12325,"children":12326},{"style":411},[12327],{"type":62,"value":1906},{"type":56,"tag":382,"props":12329,"children":12330},{"style":399},[12331],{"type":62,"value":12332},"addEventListener",{"type":56,"tag":382,"props":12334,"children":12335},{"style":1884},[12336],{"type":62,"value":1994},{"type":56,"tag":382,"props":12338,"children":12339},{"style":411},[12340],{"type":62,"value":1940},{"type":56,"tag":382,"props":12342,"children":12343},{"style":405},[12344],{"type":62,"value":12345},"notification",{"type":56,"tag":382,"props":12347,"children":12348},{"style":411},[12349],{"type":62,"value":1940},{"type":56,"tag":382,"props":12351,"children":12352},{"style":411},[12353],{"type":62,"value":1639},{"type":56,"tag":382,"props":12355,"children":12356},{"style":411},[12357],{"type":62,"value":2307},{"type":56,"tag":382,"props":12359,"children":12360},{"style":1621},[12361],{"type":62,"value":534},{"type":56,"tag":382,"props":12363,"children":12364},{"style":411},[12365],{"type":62,"value":782},{"type":56,"tag":382,"props":12367,"children":12368},{"style":1579},[12369],{"type":62,"value":3219},{"type":56,"tag":382,"props":12371,"children":12372},{"style":411},[12373],{"type":62,"value":1592},{"type":56,"tag":382,"props":12375,"children":12376},{"class":384,"line":1677},[12377,12382,12386,12390,12394,12398,12402,12406,12410,12414,12418,12422,12426,12430],{"type":56,"tag":382,"props":12378,"children":12379},{"style":399},[12380],{"type":62,"value":12381},"      showToast",{"type":56,"tag":382,"props":12383,"children":12384},{"style":1884},[12385],{"type":62,"value":1994},{"type":56,"tag":382,"props":12387,"children":12388},{"style":531},[12389],{"type":62,"value":11924},{"type":56,"tag":382,"props":12391,"children":12392},{"style":411},[12393],{"type":62,"value":1906},{"type":56,"tag":382,"props":12395,"children":12396},{"style":399},[12397],{"type":62,"value":9942},{"type":56,"tag":382,"props":12399,"children":12400},{"style":1884},[12401],{"type":62,"value":1994},{"type":56,"tag":382,"props":12403,"children":12404},{"style":531},[12405],{"type":62,"value":534},{"type":56,"tag":382,"props":12407,"children":12408},{"style":411},[12409],{"type":62,"value":1906},{"type":56,"tag":382,"props":12411,"children":12412},{"style":531},[12413],{"type":62,"value":6742},{"type":56,"tag":382,"props":12415,"children":12416},{"style":1884},[12417],{"type":62,"value":782},{"type":56,"tag":382,"props":12419,"children":12420},{"style":411},[12421],{"type":62,"value":1906},{"type":56,"tag":382,"props":12423,"children":12424},{"style":531},[12425],{"type":62,"value":2726},{"type":56,"tag":382,"props":12427,"children":12428},{"style":1884},[12429],{"type":62,"value":782},{"type":56,"tag":382,"props":12431,"children":12432},{"style":411},[12433],{"type":62,"value":2195},{"type":56,"tag":382,"props":12435,"children":12436},{"class":384,"line":1691},[12437,12441,12445],{"type":56,"tag":382,"props":12438,"children":12439},{"style":411},[12440],{"type":62,"value":3447},{"type":56,"tag":382,"props":12442,"children":12443},{"style":1884},[12444],{"type":62,"value":782},{"type":56,"tag":382,"props":12446,"children":12447},{"style":411},[12448],{"type":62,"value":2195},{"type":56,"tag":382,"props":12450,"children":12451},{"class":384,"line":1813},[12452,12456,12460,12465,12469,12473,12477,12481,12485,12489,12493,12497,12501,12506,12510,12514,12518,12523,12527,12532,12536,12540],{"type":56,"tag":382,"props":12453,"children":12454},{"style":531},[12455],{"type":62,"value":12323},{"type":56,"tag":382,"props":12457,"children":12458},{"style":411},[12459],{"type":62,"value":1906},{"type":56,"tag":382,"props":12461,"children":12462},{"style":399},[12463],{"type":62,"value":12464},"onerror",{"type":56,"tag":382,"props":12466,"children":12467},{"style":411},[12468],{"type":62,"value":2263},{"type":56,"tag":382,"props":12470,"children":12471},{"style":411},[12472],{"type":62,"value":6517},{"type":56,"tag":382,"props":12474,"children":12475},{"style":1579},[12476],{"type":62,"value":3219},{"type":56,"tag":382,"props":12478,"children":12479},{"style":411},[12480],{"type":62,"value":1975},{"type":56,"tag":382,"props":12482,"children":12483},{"style":531},[12484],{"type":62,"value":12269},{"type":56,"tag":382,"props":12486,"children":12487},{"style":411},[12488],{"type":62,"value":1906},{"type":56,"tag":382,"props":12490,"children":12491},{"style":399},[12492],{"type":62,"value":12138},{"type":56,"tag":382,"props":12494,"children":12495},{"style":1884},[12496],{"type":62,"value":3955},{"type":56,"tag":382,"props":12498,"children":12499},{"style":411},[12500],{"type":62,"value":2373},{"type":56,"tag":382,"props":12502,"children":12503},{"style":399},[12504],{"type":62,"value":12505}," setTimeout",{"type":56,"tag":382,"props":12507,"children":12508},{"style":1884},[12509],{"type":62,"value":1994},{"type":56,"tag":382,"props":12511,"children":12512},{"style":411},[12513],{"type":62,"value":3955},{"type":56,"tag":382,"props":12515,"children":12516},{"style":1579},[12517],{"type":62,"value":3219},{"type":56,"tag":382,"props":12519,"children":12520},{"style":389},[12521],{"type":62,"value":12522}," \u002F* reconnect *\u002F",{"type":56,"tag":382,"props":12524,"children":12525},{"style":411},[12526],{"type":62,"value":1639},{"type":56,"tag":382,"props":12528,"children":12529},{"style":1947},[12530],{"type":62,"value":12531}," 3000",{"type":56,"tag":382,"props":12533,"children":12534},{"style":1884},[12535],{"type":62,"value":782},{"type":56,"tag":382,"props":12537,"children":12538},{"style":411},[12539],{"type":62,"value":2373},{"type":56,"tag":382,"props":12541,"children":12542},{"style":411},[12543],{"type":62,"value":12544}," };\n",{"type":56,"tag":382,"props":12546,"children":12547},{"class":384,"line":1822},[12548,12552,12556,12560,12564,12568,12572,12576],{"type":56,"tag":382,"props":12549,"children":12550},{"style":2182},[12551],{"type":62,"value":3282},{"type":56,"tag":382,"props":12553,"children":12554},{"style":411},[12555],{"type":62,"value":6517},{"type":56,"tag":382,"props":12557,"children":12558},{"style":1579},[12559],{"type":62,"value":3219},{"type":56,"tag":382,"props":12561,"children":12562},{"style":531},[12563],{"type":62,"value":12269},{"type":56,"tag":382,"props":12565,"children":12566},{"style":411},[12567],{"type":62,"value":1906},{"type":56,"tag":382,"props":12569,"children":12570},{"style":399},[12571],{"type":62,"value":12138},{"type":56,"tag":382,"props":12573,"children":12574},{"style":1884},[12575],{"type":62,"value":3955},{"type":56,"tag":382,"props":12577,"children":12578},{"style":411},[12579],{"type":62,"value":2195},{"type":56,"tag":382,"props":12581,"children":12582},{"class":384,"line":2296},[12583,12588,12592,12596,12601],{"type":56,"tag":382,"props":12584,"children":12585},{"style":411},[12586],{"type":62,"value":12587},"  },",{"type":56,"tag":382,"props":12589,"children":12590},{"style":1884},[12591],{"type":62,"value":6479},{"type":56,"tag":382,"props":12593,"children":12594},{"style":531},[12595],{"type":62,"value":12217},{"type":56,"tag":382,"props":12597,"children":12598},{"style":1884},[12599],{"type":62,"value":12600},"])",{"type":56,"tag":382,"props":12602,"children":12603},{"style":411},[12604],{"type":62,"value":2195},{"type":56,"tag":382,"props":12606,"children":12607},{"class":384,"line":2381},[12608],{"type":56,"tag":382,"props":12609,"children":12610},{"style":411},[12611],{"type":62,"value":1697},{"type":56,"tag":82,"props":12613,"children":12615},{"id":12614},"option-b-websocket-bidirectional",[12616],{"type":62,"value":12617},"Option B: WebSocket — Bidirectional",{"type":56,"tag":72,"props":12619,"children":12620},{},[12621],{"type":62,"value":12622},"Best for: chat, collaborative editing, gaming.",{"type":56,"tag":72,"props":12624,"children":12625},{},[12626],{"type":56,"tag":76,"props":12627,"children":12628},{},[12629],{"type":62,"value":12630},"Backend (ws library):",{"type":56,"tag":370,"props":12632,"children":12634},{"className":1567,"code":12633,"language":1569,"meta":375,"style":375},"import { WebSocketServer } from 'ws';\nconst wss = new WebSocketServer({ server: httpServer, path: '\u002Fws' });\nwss.on('connection', (ws, req) => {\n  const userId = authenticateWs(req);\n  if (!userId) { ws.close(4001, 'Unauthorized'); return; }\n  ws.on('message', (raw) => handleMessage(userId, JSON.parse(raw.toString())));\n  ws.on('close', () => cleanupUser(userId));\n  const interval = setInterval(() => ws.ping(), 30000);\n  ws.on('pong', () => { \u002F* alive *\u002F });\n  ws.on('close', () => clearInterval(interval));\n});\n",[12635],{"type":56,"tag":378,"props":12636,"children":12637},{"__ignoreMap":375},[12638,12679,12762,12827,12863,12950,13058,13123,13190,13255,13320],{"type":56,"tag":382,"props":12639,"children":12640},{"class":384,"line":385},[12641,12645,12649,12654,12658,12662,12666,12671,12675],{"type":56,"tag":382,"props":12642,"children":12643},{"style":2182},[12644],{"type":62,"value":6172},{"type":56,"tag":382,"props":12646,"children":12647},{"style":411},[12648],{"type":62,"value":1975},{"type":56,"tag":382,"props":12650,"children":12651},{"style":531},[12652],{"type":62,"value":12653}," WebSocketServer",{"type":56,"tag":382,"props":12655,"children":12656},{"style":411},[12657],{"type":62,"value":3580},{"type":56,"tag":382,"props":12659,"children":12660},{"style":2182},[12661],{"type":62,"value":6208},{"type":56,"tag":382,"props":12663,"children":12664},{"style":411},[12665],{"type":62,"value":1930},{"type":56,"tag":382,"props":12667,"children":12668},{"style":405},[12669],{"type":62,"value":12670},"ws",{"type":56,"tag":382,"props":12672,"children":12673},{"style":411},[12674],{"type":62,"value":1940},{"type":56,"tag":382,"props":12676,"children":12677},{"style":411},[12678],{"type":62,"value":2195},{"type":56,"tag":382,"props":12680,"children":12681},{"class":384,"line":395},[12682,12686,12691,12695,12699,12703,12707,12711,12715,12719,12724,12728,12733,12737,12741,12746,12750,12754,12758],{"type":56,"tag":382,"props":12683,"children":12684},{"style":1579},[12685],{"type":62,"value":1864},{"type":56,"tag":382,"props":12687,"children":12688},{"style":531},[12689],{"type":62,"value":12690}," wss ",{"type":56,"tag":382,"props":12692,"children":12693},{"style":411},[12694],{"type":62,"value":1874},{"type":56,"tag":382,"props":12696,"children":12697},{"style":411},[12698],{"type":62,"value":2331},{"type":56,"tag":382,"props":12700,"children":12701},{"style":399},[12702],{"type":62,"value":12653},{"type":56,"tag":382,"props":12704,"children":12705},{"style":531},[12706],{"type":62,"value":1994},{"type":56,"tag":382,"props":12708,"children":12709},{"style":411},[12710],{"type":62,"value":3634},{"type":56,"tag":382,"props":12712,"children":12713},{"style":1884},[12714],{"type":62,"value":408},{"type":56,"tag":382,"props":12716,"children":12717},{"style":411},[12718],{"type":62,"value":1629},{"type":56,"tag":382,"props":12720,"children":12721},{"style":531},[12722],{"type":62,"value":12723}," httpServer",{"type":56,"tag":382,"props":12725,"children":12726},{"style":411},[12727],{"type":62,"value":1639},{"type":56,"tag":382,"props":12729,"children":12730},{"style":1884},[12731],{"type":62,"value":12732}," path",{"type":56,"tag":382,"props":12734,"children":12735},{"style":411},[12736],{"type":62,"value":1629},{"type":56,"tag":382,"props":12738,"children":12739},{"style":411},[12740],{"type":62,"value":1930},{"type":56,"tag":382,"props":12742,"children":12743},{"style":405},[12744],{"type":62,"value":12745},"\u002Fws",{"type":56,"tag":382,"props":12747,"children":12748},{"style":411},[12749],{"type":62,"value":1940},{"type":56,"tag":382,"props":12751,"children":12752},{"style":411},[12753],{"type":62,"value":3580},{"type":56,"tag":382,"props":12755,"children":12756},{"style":531},[12757],{"type":62,"value":782},{"type":56,"tag":382,"props":12759,"children":12760},{"style":411},[12761],{"type":62,"value":2195},{"type":56,"tag":382,"props":12763,"children":12764},{"class":384,"line":433},[12765,12770,12774,12778,12782,12786,12791,12795,12799,12803,12807,12811,12815,12819,12823],{"type":56,"tag":382,"props":12766,"children":12767},{"style":531},[12768],{"type":62,"value":12769},"wss",{"type":56,"tag":382,"props":12771,"children":12772},{"style":411},[12773],{"type":62,"value":1906},{"type":56,"tag":382,"props":12775,"children":12776},{"style":399},[12777],{"type":62,"value":12125},{"type":56,"tag":382,"props":12779,"children":12780},{"style":531},[12781],{"type":62,"value":1994},{"type":56,"tag":382,"props":12783,"children":12784},{"style":411},[12785],{"type":62,"value":1940},{"type":56,"tag":382,"props":12787,"children":12788},{"style":405},[12789],{"type":62,"value":12790},"connection",{"type":56,"tag":382,"props":12792,"children":12793},{"style":411},[12794],{"type":62,"value":1940},{"type":56,"tag":382,"props":12796,"children":12797},{"style":411},[12798],{"type":62,"value":1639},{"type":56,"tag":382,"props":12800,"children":12801},{"style":411},[12802],{"type":62,"value":2307},{"type":56,"tag":382,"props":12804,"children":12805},{"style":1621},[12806],{"type":62,"value":12670},{"type":56,"tag":382,"props":12808,"children":12809},{"style":411},[12810],{"type":62,"value":1639},{"type":56,"tag":382,"props":12812,"children":12813},{"style":1621},[12814],{"type":62,"value":3192},{"type":56,"tag":382,"props":12816,"children":12817},{"style":411},[12818],{"type":62,"value":782},{"type":56,"tag":382,"props":12820,"children":12821},{"style":1579},[12822],{"type":62,"value":3219},{"type":56,"tag":382,"props":12824,"children":12825},{"style":411},[12826],{"type":62,"value":1592},{"type":56,"tag":382,"props":12828,"children":12829},{"class":384,"line":442},[12830,12834,12838,12842,12847,12851,12855,12859],{"type":56,"tag":382,"props":12831,"children":12832},{"style":1579},[12833],{"type":62,"value":2253},{"type":56,"tag":382,"props":12835,"children":12836},{"style":531},[12837],{"type":62,"value":9093},{"type":56,"tag":382,"props":12839,"children":12840},{"style":411},[12841],{"type":62,"value":2263},{"type":56,"tag":382,"props":12843,"children":12844},{"style":399},[12845],{"type":62,"value":12846}," authenticateWs",{"type":56,"tag":382,"props":12848,"children":12849},{"style":1884},[12850],{"type":62,"value":1994},{"type":56,"tag":382,"props":12852,"children":12853},{"style":531},[12854],{"type":62,"value":8164},{"type":56,"tag":382,"props":12856,"children":12857},{"style":1884},[12858],{"type":62,"value":782},{"type":56,"tag":382,"props":12860,"children":12861},{"style":411},[12862],{"type":62,"value":2195},{"type":56,"tag":382,"props":12864,"children":12865},{"class":384,"line":1677},[12866,12870,12874,12878,12882,12886,12890,12895,12899,12903,12907,12912,12916,12920,12925,12929,12933,12937,12942,12946],{"type":56,"tag":382,"props":12867,"children":12868},{"style":2182},[12869],{"type":62,"value":2302},{"type":56,"tag":382,"props":12871,"children":12872},{"style":1884},[12873],{"type":62,"value":2307},{"type":56,"tag":382,"props":12875,"children":12876},{"style":411},[12877],{"type":62,"value":2312},{"type":56,"tag":382,"props":12879,"children":12880},{"style":531},[12881],{"type":62,"value":12217},{"type":56,"tag":382,"props":12883,"children":12884},{"style":1884},[12885],{"type":62,"value":2059},{"type":56,"tag":382,"props":12887,"children":12888},{"style":411},[12889],{"type":62,"value":3634},{"type":56,"tag":382,"props":12891,"children":12892},{"style":531},[12893],{"type":62,"value":12894}," ws",{"type":56,"tag":382,"props":12896,"children":12897},{"style":411},[12898],{"type":62,"value":1906},{"type":56,"tag":382,"props":12900,"children":12901},{"style":399},[12902],{"type":62,"value":12138},{"type":56,"tag":382,"props":12904,"children":12905},{"style":1884},[12906],{"type":62,"value":1994},{"type":56,"tag":382,"props":12908,"children":12909},{"style":1947},[12910],{"type":62,"value":12911},"4001",{"type":56,"tag":382,"props":12913,"children":12914},{"style":411},[12915],{"type":62,"value":1639},{"type":56,"tag":382,"props":12917,"children":12918},{"style":411},[12919],{"type":62,"value":1930},{"type":56,"tag":382,"props":12921,"children":12922},{"style":405},[12923],{"type":62,"value":12924},"Unauthorized",{"type":56,"tag":382,"props":12926,"children":12927},{"style":411},[12928],{"type":62,"value":1940},{"type":56,"tag":382,"props":12930,"children":12931},{"style":1884},[12932],{"type":62,"value":782},{"type":56,"tag":382,"props":12934,"children":12935},{"style":411},[12936],{"type":62,"value":2373},{"type":56,"tag":382,"props":12938,"children":12939},{"style":2182},[12940],{"type":62,"value":12941}," return",{"type":56,"tag":382,"props":12943,"children":12944},{"style":411},[12945],{"type":62,"value":2373},{"type":56,"tag":382,"props":12947,"children":12948},{"style":411},[12949],{"type":62,"value":2739},{"type":56,"tag":382,"props":12951,"children":12952},{"class":384,"line":1691},[12953,12958,12962,12966,12970,12974,12978,12982,12986,12990,12995,12999,13003,13008,13012,13016,13020,13024,13028,13032,13036,13040,13044,13049,13054],{"type":56,"tag":382,"props":12954,"children":12955},{"style":531},[12956],{"type":62,"value":12957},"  ws",{"type":56,"tag":382,"props":12959,"children":12960},{"style":411},[12961],{"type":62,"value":1906},{"type":56,"tag":382,"props":12963,"children":12964},{"style":399},[12965],{"type":62,"value":12125},{"type":56,"tag":382,"props":12967,"children":12968},{"style":1884},[12969],{"type":62,"value":1994},{"type":56,"tag":382,"props":12971,"children":12972},{"style":411},[12973],{"type":62,"value":1940},{"type":56,"tag":382,"props":12975,"children":12976},{"style":405},[12977],{"type":62,"value":2726},{"type":56,"tag":382,"props":12979,"children":12980},{"style":411},[12981],{"type":62,"value":1940},{"type":56,"tag":382,"props":12983,"children":12984},{"style":411},[12985],{"type":62,"value":1639},{"type":56,"tag":382,"props":12987,"children":12988},{"style":411},[12989],{"type":62,"value":2307},{"type":56,"tag":382,"props":12991,"children":12992},{"style":1621},[12993],{"type":62,"value":12994},"raw",{"type":56,"tag":382,"props":12996,"children":12997},{"style":411},[12998],{"type":62,"value":782},{"type":56,"tag":382,"props":13000,"children":13001},{"style":1579},[13002],{"type":62,"value":3219},{"type":56,"tag":382,"props":13004,"children":13005},{"style":399},[13006],{"type":62,"value":13007}," handleMessage",{"type":56,"tag":382,"props":13009,"children":13010},{"style":1884},[13011],{"type":62,"value":1994},{"type":56,"tag":382,"props":13013,"children":13014},{"style":531},[13015],{"type":62,"value":12217},{"type":56,"tag":382,"props":13017,"children":13018},{"style":411},[13019],{"type":62,"value":1639},{"type":56,"tag":382,"props":13021,"children":13022},{"style":531},[13023],{"type":62,"value":5702},{"type":56,"tag":382,"props":13025,"children":13026},{"style":411},[13027],{"type":62,"value":1906},{"type":56,"tag":382,"props":13029,"children":13030},{"style":399},[13031],{"type":62,"value":9942},{"type":56,"tag":382,"props":13033,"children":13034},{"style":1884},[13035],{"type":62,"value":1994},{"type":56,"tag":382,"props":13037,"children":13038},{"style":531},[13039],{"type":62,"value":12994},{"type":56,"tag":382,"props":13041,"children":13042},{"style":411},[13043],{"type":62,"value":1906},{"type":56,"tag":382,"props":13045,"children":13046},{"style":399},[13047],{"type":62,"value":13048},"toString",{"type":56,"tag":382,"props":13050,"children":13051},{"style":1884},[13052],{"type":62,"value":13053},"())))",{"type":56,"tag":382,"props":13055,"children":13056},{"style":411},[13057],{"type":62,"value":2195},{"type":56,"tag":382,"props":13059,"children":13060},{"class":384,"line":1813},[13061,13065,13069,13073,13077,13081,13085,13089,13093,13097,13101,13106,13110,13114,13119],{"type":56,"tag":382,"props":13062,"children":13063},{"style":531},[13064],{"type":62,"value":12957},{"type":56,"tag":382,"props":13066,"children":13067},{"style":411},[13068],{"type":62,"value":1906},{"type":56,"tag":382,"props":13070,"children":13071},{"style":399},[13072],{"type":62,"value":12125},{"type":56,"tag":382,"props":13074,"children":13075},{"style":1884},[13076],{"type":62,"value":1994},{"type":56,"tag":382,"props":13078,"children":13079},{"style":411},[13080],{"type":62,"value":1940},{"type":56,"tag":382,"props":13082,"children":13083},{"style":405},[13084],{"type":62,"value":12138},{"type":56,"tag":382,"props":13086,"children":13087},{"style":411},[13088],{"type":62,"value":1940},{"type":56,"tag":382,"props":13090,"children":13091},{"style":411},[13092],{"type":62,"value":1639},{"type":56,"tag":382,"props":13094,"children":13095},{"style":411},[13096],{"type":62,"value":6517},{"type":56,"tag":382,"props":13098,"children":13099},{"style":1579},[13100],{"type":62,"value":3219},{"type":56,"tag":382,"props":13102,"children":13103},{"style":399},[13104],{"type":62,"value":13105}," cleanupUser",{"type":56,"tag":382,"props":13107,"children":13108},{"style":1884},[13109],{"type":62,"value":1994},{"type":56,"tag":382,"props":13111,"children":13112},{"style":531},[13113],{"type":62,"value":12217},{"type":56,"tag":382,"props":13115,"children":13116},{"style":1884},[13117],{"type":62,"value":13118},"))",{"type":56,"tag":382,"props":13120,"children":13121},{"style":411},[13122],{"type":62,"value":2195},{"type":56,"tag":382,"props":13124,"children":13125},{"class":384,"line":1822},[13126,13130,13135,13139,13144,13148,13152,13156,13160,13164,13169,13173,13177,13182,13186],{"type":56,"tag":382,"props":13127,"children":13128},{"style":1579},[13129],{"type":62,"value":2253},{"type":56,"tag":382,"props":13131,"children":13132},{"style":531},[13133],{"type":62,"value":13134}," interval",{"type":56,"tag":382,"props":13136,"children":13137},{"style":411},[13138],{"type":62,"value":2263},{"type":56,"tag":382,"props":13140,"children":13141},{"style":399},[13142],{"type":62,"value":13143}," setInterval",{"type":56,"tag":382,"props":13145,"children":13146},{"style":1884},[13147],{"type":62,"value":1994},{"type":56,"tag":382,"props":13149,"children":13150},{"style":411},[13151],{"type":62,"value":3955},{"type":56,"tag":382,"props":13153,"children":13154},{"style":1579},[13155],{"type":62,"value":3219},{"type":56,"tag":382,"props":13157,"children":13158},{"style":531},[13159],{"type":62,"value":12894},{"type":56,"tag":382,"props":13161,"children":13162},{"style":411},[13163],{"type":62,"value":1906},{"type":56,"tag":382,"props":13165,"children":13166},{"style":399},[13167],{"type":62,"value":13168},"ping",{"type":56,"tag":382,"props":13170,"children":13171},{"style":1884},[13172],{"type":62,"value":3955},{"type":56,"tag":382,"props":13174,"children":13175},{"style":411},[13176],{"type":62,"value":1639},{"type":56,"tag":382,"props":13178,"children":13179},{"style":1947},[13180],{"type":62,"value":13181}," 30000",{"type":56,"tag":382,"props":13183,"children":13184},{"style":1884},[13185],{"type":62,"value":782},{"type":56,"tag":382,"props":13187,"children":13188},{"style":411},[13189],{"type":62,"value":2195},{"type":56,"tag":382,"props":13191,"children":13192},{"class":384,"line":2296},[13193,13197,13201,13205,13209,13213,13218,13222,13226,13230,13234,13238,13243,13247,13251],{"type":56,"tag":382,"props":13194,"children":13195},{"style":531},[13196],{"type":62,"value":12957},{"type":56,"tag":382,"props":13198,"children":13199},{"style":411},[13200],{"type":62,"value":1906},{"type":56,"tag":382,"props":13202,"children":13203},{"style":399},[13204],{"type":62,"value":12125},{"type":56,"tag":382,"props":13206,"children":13207},{"style":1884},[13208],{"type":62,"value":1994},{"type":56,"tag":382,"props":13210,"children":13211},{"style":411},[13212],{"type":62,"value":1940},{"type":56,"tag":382,"props":13214,"children":13215},{"style":405},[13216],{"type":62,"value":13217},"pong",{"type":56,"tag":382,"props":13219,"children":13220},{"style":411},[13221],{"type":62,"value":1940},{"type":56,"tag":382,"props":13223,"children":13224},{"style":411},[13225],{"type":62,"value":1639},{"type":56,"tag":382,"props":13227,"children":13228},{"style":411},[13229],{"type":62,"value":6517},{"type":56,"tag":382,"props":13231,"children":13232},{"style":1579},[13233],{"type":62,"value":3219},{"type":56,"tag":382,"props":13235,"children":13236},{"style":411},[13237],{"type":62,"value":1975},{"type":56,"tag":382,"props":13239,"children":13240},{"style":389},[13241],{"type":62,"value":13242}," \u002F* alive *\u002F",{"type":56,"tag":382,"props":13244,"children":13245},{"style":411},[13246],{"type":62,"value":3580},{"type":56,"tag":382,"props":13248,"children":13249},{"style":1884},[13250],{"type":62,"value":782},{"type":56,"tag":382,"props":13252,"children":13253},{"style":411},[13254],{"type":62,"value":2195},{"type":56,"tag":382,"props":13256,"children":13257},{"class":384,"line":2381},[13258,13262,13266,13270,13274,13278,13282,13286,13290,13294,13298,13303,13307,13312,13316],{"type":56,"tag":382,"props":13259,"children":13260},{"style":531},[13261],{"type":62,"value":12957},{"type":56,"tag":382,"props":13263,"children":13264},{"style":411},[13265],{"type":62,"value":1906},{"type":56,"tag":382,"props":13267,"children":13268},{"style":399},[13269],{"type":62,"value":12125},{"type":56,"tag":382,"props":13271,"children":13272},{"style":1884},[13273],{"type":62,"value":1994},{"type":56,"tag":382,"props":13275,"children":13276},{"style":411},[13277],{"type":62,"value":1940},{"type":56,"tag":382,"props":13279,"children":13280},{"style":405},[13281],{"type":62,"value":12138},{"type":56,"tag":382,"props":13283,"children":13284},{"style":411},[13285],{"type":62,"value":1940},{"type":56,"tag":382,"props":13287,"children":13288},{"style":411},[13289],{"type":62,"value":1639},{"type":56,"tag":382,"props":13291,"children":13292},{"style":411},[13293],{"type":62,"value":6517},{"type":56,"tag":382,"props":13295,"children":13296},{"style":1579},[13297],{"type":62,"value":3219},{"type":56,"tag":382,"props":13299,"children":13300},{"style":399},[13301],{"type":62,"value":13302}," clearInterval",{"type":56,"tag":382,"props":13304,"children":13305},{"style":1884},[13306],{"type":62,"value":1994},{"type":56,"tag":382,"props":13308,"children":13309},{"style":531},[13310],{"type":62,"value":13311},"interval",{"type":56,"tag":382,"props":13313,"children":13314},{"style":1884},[13315],{"type":62,"value":13118},{"type":56,"tag":382,"props":13317,"children":13318},{"style":411},[13319],{"type":62,"value":2195},{"type":56,"tag":382,"props":13321,"children":13322},{"class":384,"line":2398},[13323,13327,13331],{"type":56,"tag":382,"props":13324,"children":13325},{"style":411},[13326],{"type":62,"value":2179},{"type":56,"tag":382,"props":13328,"children":13329},{"style":531},[13330],{"type":62,"value":782},{"type":56,"tag":382,"props":13332,"children":13333},{"style":411},[13334],{"type":62,"value":2195},{"type":56,"tag":72,"props":13336,"children":13337},{},[13338],{"type":56,"tag":76,"props":13339,"children":13340},{},[13341],{"type":62,"value":10802},{"type":56,"tag":370,"props":13343,"children":13345},{"className":1567,"code":13344,"language":1569,"meta":375,"style":375},"function useWebSocket(url: string) {\n  const [ws, setWs] = useState\u003CWebSocket | null>(null);\n  useEffect(() => {\n    const socket = new WebSocket(url);\n    socket.onopen = () => setWs(socket);\n    socket.onclose = () => setTimeout(() => \u002F* reconnect *\u002F, 3000);\n    return () => socket.close();\n  }, [url]);\n  const send = useCallback((data: unknown) => ws?.send(JSON.stringify(data)), [ws]);\n  return { ws, send };\n}\n",[13346],{"type":56,"tag":378,"props":13347,"children":13348},{"__ignoreMap":375},[13349,13386,13462,13485,13526,13576,13640,13675,13698,13807,13834],{"type":56,"tag":382,"props":13350,"children":13351},{"class":384,"line":385},[13352,13356,13361,13365,13370,13374,13378,13382],{"type":56,"tag":382,"props":13353,"children":13354},{"style":1579},[13355],{"type":62,"value":2210},{"type":56,"tag":382,"props":13357,"children":13358},{"style":399},[13359],{"type":62,"value":13360}," useWebSocket",{"type":56,"tag":382,"props":13362,"children":13363},{"style":411},[13364],{"type":62,"value":1994},{"type":56,"tag":382,"props":13366,"children":13367},{"style":1621},[13368],{"type":62,"value":13369},"url",{"type":56,"tag":382,"props":13371,"children":13372},{"style":411},[13373],{"type":62,"value":1629},{"type":56,"tag":382,"props":13375,"children":13376},{"style":417},[13377],{"type":62,"value":2232},{"type":56,"tag":382,"props":13379,"children":13380},{"style":411},[13381],{"type":62,"value":782},{"type":56,"tag":382,"props":13383,"children":13384},{"style":411},[13385],{"type":62,"value":1592},{"type":56,"tag":382,"props":13387,"children":13388},{"class":384,"line":395},[13389,13393,13397,13401,13405,13410,13414,13418,13423,13427,13432,13437,13441,13445,13449,13454,13458],{"type":56,"tag":382,"props":13390,"children":13391},{"style":1579},[13392],{"type":62,"value":2253},{"type":56,"tag":382,"props":13394,"children":13395},{"style":411},[13396],{"type":62,"value":6479},{"type":56,"tag":382,"props":13398,"children":13399},{"style":531},[13400],{"type":62,"value":12670},{"type":56,"tag":382,"props":13402,"children":13403},{"style":411},[13404],{"type":62,"value":1639},{"type":56,"tag":382,"props":13406,"children":13407},{"style":531},[13408],{"type":62,"value":13409}," setWs",{"type":56,"tag":382,"props":13411,"children":13412},{"style":411},[13413],{"type":62,"value":2289},{"type":56,"tag":382,"props":13415,"children":13416},{"style":411},[13417],{"type":62,"value":2263},{"type":56,"tag":382,"props":13419,"children":13420},{"style":399},[13421],{"type":62,"value":13422}," useState",{"type":56,"tag":382,"props":13424,"children":13425},{"style":411},[13426],{"type":62,"value":523},{"type":56,"tag":382,"props":13428,"children":13429},{"style":417},[13430],{"type":62,"value":13431},"WebSocket",{"type":56,"tag":382,"props":13433,"children":13434},{"style":411},[13435],{"type":62,"value":13436}," |",{"type":56,"tag":382,"props":13438,"children":13439},{"style":417},[13440],{"type":62,"value":5297},{"type":56,"tag":382,"props":13442,"children":13443},{"style":411},[13444],{"type":62,"value":4887},{"type":56,"tag":382,"props":13446,"children":13447},{"style":1884},[13448],{"type":62,"value":1994},{"type":56,"tag":382,"props":13450,"children":13451},{"style":411},[13452],{"type":62,"value":13453},"null",{"type":56,"tag":382,"props":13455,"children":13456},{"style":1884},[13457],{"type":62,"value":782},{"type":56,"tag":382,"props":13459,"children":13460},{"style":411},[13461],{"type":62,"value":2195},{"type":56,"tag":382,"props":13463,"children":13464},{"class":384,"line":433},[13465,13469,13473,13477,13481],{"type":56,"tag":382,"props":13466,"children":13467},{"style":399},[13468],{"type":62,"value":12241},{"type":56,"tag":382,"props":13470,"children":13471},{"style":1884},[13472],{"type":62,"value":1994},{"type":56,"tag":382,"props":13474,"children":13475},{"style":411},[13476],{"type":62,"value":3955},{"type":56,"tag":382,"props":13478,"children":13479},{"style":1579},[13480],{"type":62,"value":3219},{"type":56,"tag":382,"props":13482,"children":13483},{"style":411},[13484],{"type":62,"value":1592},{"type":56,"tag":382,"props":13486,"children":13487},{"class":384,"line":442},[13488,13492,13497,13501,13505,13510,13514,13518,13522],{"type":56,"tag":382,"props":13489,"children":13490},{"style":1579},[13491],{"type":62,"value":5243},{"type":56,"tag":382,"props":13493,"children":13494},{"style":531},[13495],{"type":62,"value":13496}," socket",{"type":56,"tag":382,"props":13498,"children":13499},{"style":411},[13500],{"type":62,"value":2263},{"type":56,"tag":382,"props":13502,"children":13503},{"style":411},[13504],{"type":62,"value":2331},{"type":56,"tag":382,"props":13506,"children":13507},{"style":399},[13508],{"type":62,"value":13509}," WebSocket",{"type":56,"tag":382,"props":13511,"children":13512},{"style":1884},[13513],{"type":62,"value":1994},{"type":56,"tag":382,"props":13515,"children":13516},{"style":531},[13517],{"type":62,"value":13369},{"type":56,"tag":382,"props":13519,"children":13520},{"style":1884},[13521],{"type":62,"value":782},{"type":56,"tag":382,"props":13523,"children":13524},{"style":411},[13525],{"type":62,"value":2195},{"type":56,"tag":382,"props":13527,"children":13528},{"class":384,"line":1677},[13529,13534,13538,13543,13547,13551,13555,13559,13563,13568,13572],{"type":56,"tag":382,"props":13530,"children":13531},{"style":531},[13532],{"type":62,"value":13533},"    socket",{"type":56,"tag":382,"props":13535,"children":13536},{"style":411},[13537],{"type":62,"value":1906},{"type":56,"tag":382,"props":13539,"children":13540},{"style":399},[13541],{"type":62,"value":13542},"onopen",{"type":56,"tag":382,"props":13544,"children":13545},{"style":411},[13546],{"type":62,"value":2263},{"type":56,"tag":382,"props":13548,"children":13549},{"style":411},[13550],{"type":62,"value":6517},{"type":56,"tag":382,"props":13552,"children":13553},{"style":1579},[13554],{"type":62,"value":3219},{"type":56,"tag":382,"props":13556,"children":13557},{"style":399},[13558],{"type":62,"value":13409},{"type":56,"tag":382,"props":13560,"children":13561},{"style":1884},[13562],{"type":62,"value":1994},{"type":56,"tag":382,"props":13564,"children":13565},{"style":531},[13566],{"type":62,"value":13567},"socket",{"type":56,"tag":382,"props":13569,"children":13570},{"style":1884},[13571],{"type":62,"value":782},{"type":56,"tag":382,"props":13573,"children":13574},{"style":411},[13575],{"type":62,"value":2195},{"type":56,"tag":382,"props":13577,"children":13578},{"class":384,"line":1691},[13579,13583,13587,13592,13596,13600,13604,13608,13612,13616,13620,13624,13628,13632,13636],{"type":56,"tag":382,"props":13580,"children":13581},{"style":531},[13582],{"type":62,"value":13533},{"type":56,"tag":382,"props":13584,"children":13585},{"style":411},[13586],{"type":62,"value":1906},{"type":56,"tag":382,"props":13588,"children":13589},{"style":399},[13590],{"type":62,"value":13591},"onclose",{"type":56,"tag":382,"props":13593,"children":13594},{"style":411},[13595],{"type":62,"value":2263},{"type":56,"tag":382,"props":13597,"children":13598},{"style":411},[13599],{"type":62,"value":6517},{"type":56,"tag":382,"props":13601,"children":13602},{"style":1579},[13603],{"type":62,"value":3219},{"type":56,"tag":382,"props":13605,"children":13606},{"style":399},[13607],{"type":62,"value":12505},{"type":56,"tag":382,"props":13609,"children":13610},{"style":1884},[13611],{"type":62,"value":1994},{"type":56,"tag":382,"props":13613,"children":13614},{"style":411},[13615],{"type":62,"value":3955},{"type":56,"tag":382,"props":13617,"children":13618},{"style":1579},[13619],{"type":62,"value":3219},{"type":56,"tag":382,"props":13621,"children":13622},{"style":389},[13623],{"type":62,"value":12522},{"type":56,"tag":382,"props":13625,"children":13626},{"style":411},[13627],{"type":62,"value":1639},{"type":56,"tag":382,"props":13629,"children":13630},{"style":1947},[13631],{"type":62,"value":12531},{"type":56,"tag":382,"props":13633,"children":13634},{"style":1884},[13635],{"type":62,"value":782},{"type":56,"tag":382,"props":13637,"children":13638},{"style":411},[13639],{"type":62,"value":2195},{"type":56,"tag":382,"props":13641,"children":13642},{"class":384,"line":1813},[13643,13647,13651,13655,13659,13663,13667,13671],{"type":56,"tag":382,"props":13644,"children":13645},{"style":2182},[13646],{"type":62,"value":3282},{"type":56,"tag":382,"props":13648,"children":13649},{"style":411},[13650],{"type":62,"value":6517},{"type":56,"tag":382,"props":13652,"children":13653},{"style":1579},[13654],{"type":62,"value":3219},{"type":56,"tag":382,"props":13656,"children":13657},{"style":531},[13658],{"type":62,"value":13496},{"type":56,"tag":382,"props":13660,"children":13661},{"style":411},[13662],{"type":62,"value":1906},{"type":56,"tag":382,"props":13664,"children":13665},{"style":399},[13666],{"type":62,"value":12138},{"type":56,"tag":382,"props":13668,"children":13669},{"style":1884},[13670],{"type":62,"value":3955},{"type":56,"tag":382,"props":13672,"children":13673},{"style":411},[13674],{"type":62,"value":2195},{"type":56,"tag":382,"props":13676,"children":13677},{"class":384,"line":1822},[13678,13682,13686,13690,13694],{"type":56,"tag":382,"props":13679,"children":13680},{"style":411},[13681],{"type":62,"value":12587},{"type":56,"tag":382,"props":13683,"children":13684},{"style":1884},[13685],{"type":62,"value":6479},{"type":56,"tag":382,"props":13687,"children":13688},{"style":531},[13689],{"type":62,"value":13369},{"type":56,"tag":382,"props":13691,"children":13692},{"style":1884},[13693],{"type":62,"value":12600},{"type":56,"tag":382,"props":13695,"children":13696},{"style":411},[13697],{"type":62,"value":2195},{"type":56,"tag":382,"props":13699,"children":13700},{"class":384,"line":2296},[13701,13705,13709,13713,13718,13722,13726,13730,13734,13738,13742,13746,13750,13754,13759,13763,13767,13771,13775,13779,13783,13787,13791,13795,13799,13803],{"type":56,"tag":382,"props":13702,"children":13703},{"style":1579},[13704],{"type":62,"value":2253},{"type":56,"tag":382,"props":13706,"children":13707},{"style":531},[13708],{"type":62,"value":11814},{"type":56,"tag":382,"props":13710,"children":13711},{"style":411},[13712],{"type":62,"value":2263},{"type":56,"tag":382,"props":13714,"children":13715},{"style":399},[13716],{"type":62,"value":13717}," useCallback",{"type":56,"tag":382,"props":13719,"children":13720},{"style":1884},[13721],{"type":62,"value":1994},{"type":56,"tag":382,"props":13723,"children":13724},{"style":411},[13725],{"type":62,"value":1994},{"type":56,"tag":382,"props":13727,"children":13728},{"style":1621},[13729],{"type":62,"value":6742},{"type":56,"tag":382,"props":13731,"children":13732},{"style":411},[13733],{"type":62,"value":1629},{"type":56,"tag":382,"props":13735,"children":13736},{"style":417},[13737],{"type":62,"value":5626},{"type":56,"tag":382,"props":13739,"children":13740},{"style":411},[13741],{"type":62,"value":782},{"type":56,"tag":382,"props":13743,"children":13744},{"style":1579},[13745],{"type":62,"value":3219},{"type":56,"tag":382,"props":13747,"children":13748},{"style":531},[13749],{"type":62,"value":12894},{"type":56,"tag":382,"props":13751,"children":13752},{"style":411},[13753],{"type":62,"value":4721},{"type":56,"tag":382,"props":13755,"children":13756},{"style":399},[13757],{"type":62,"value":13758},"send",{"type":56,"tag":382,"props":13760,"children":13761},{"style":1884},[13762],{"type":62,"value":1994},{"type":56,"tag":382,"props":13764,"children":13765},{"style":531},[13766],{"type":62,"value":11924},{"type":56,"tag":382,"props":13768,"children":13769},{"style":411},[13770],{"type":62,"value":1906},{"type":56,"tag":382,"props":13772,"children":13773},{"style":399},[13774],{"type":62,"value":5711},{"type":56,"tag":382,"props":13776,"children":13777},{"style":1884},[13778],{"type":62,"value":1994},{"type":56,"tag":382,"props":13780,"children":13781},{"style":531},[13782],{"type":62,"value":6742},{"type":56,"tag":382,"props":13784,"children":13785},{"style":1884},[13786],{"type":62,"value":13118},{"type":56,"tag":382,"props":13788,"children":13789},{"style":411},[13790],{"type":62,"value":1639},{"type":56,"tag":382,"props":13792,"children":13793},{"style":1884},[13794],{"type":62,"value":6479},{"type":56,"tag":382,"props":13796,"children":13797},{"style":531},[13798],{"type":62,"value":12670},{"type":56,"tag":382,"props":13800,"children":13801},{"style":1884},[13802],{"type":62,"value":12600},{"type":56,"tag":382,"props":13804,"children":13805},{"style":411},[13806],{"type":62,"value":2195},{"type":56,"tag":382,"props":13808,"children":13809},{"class":384,"line":2381},[13810,13814,13818,13822,13826,13830],{"type":56,"tag":382,"props":13811,"children":13812},{"style":2182},[13813],{"type":62,"value":2387},{"type":56,"tag":382,"props":13815,"children":13816},{"style":411},[13817],{"type":62,"value":1975},{"type":56,"tag":382,"props":13819,"children":13820},{"style":531},[13821],{"type":62,"value":12894},{"type":56,"tag":382,"props":13823,"children":13824},{"style":411},[13825],{"type":62,"value":1639},{"type":56,"tag":382,"props":13827,"children":13828},{"style":531},[13829],{"type":62,"value":11814},{"type":56,"tag":382,"props":13831,"children":13832},{"style":411},[13833],{"type":62,"value":12544},{"type":56,"tag":382,"props":13835,"children":13836},{"class":384,"line":2398},[13837],{"type":56,"tag":382,"props":13838,"children":13839},{"style":411},[13840],{"type":62,"value":1697},{"type":56,"tag":82,"props":13842,"children":13844},{"id":13843},"option-c-polling-simplest-no-infrastructure",[13845],{"type":62,"value":13846},"Option C: Polling (Simplest, No Infrastructure)",{"type":56,"tag":370,"props":13848,"children":13850},{"className":1567,"code":13849,"language":1569,"meta":375,"style":375},"function useOrderStatus(orderId: string) {\n  return useQuery({\n    queryKey: ['order-status', orderId],\n    queryFn: () => apiClient.get\u003COrder>(`\u002Fapi\u002Forders\u002F${orderId}`),\n    refetchInterval: (query) => {\n      if (query.state.data?.status === 'completed') return false;\n      return 5000;\n    },\n  });\n}\n",[13851],{"type":56,"tag":378,"props":13852,"children":13853},{"__ignoreMap":375},[13854,13890,13909,13953,14030,14062,14136,14152,14159,14174],{"type":56,"tag":382,"props":13855,"children":13856},{"class":384,"line":385},[13857,13861,13866,13870,13874,13878,13882,13886],{"type":56,"tag":382,"props":13858,"children":13859},{"style":1579},[13860],{"type":62,"value":2210},{"type":56,"tag":382,"props":13862,"children":13863},{"style":399},[13864],{"type":62,"value":13865}," useOrderStatus",{"type":56,"tag":382,"props":13867,"children":13868},{"style":411},[13869],{"type":62,"value":1994},{"type":56,"tag":382,"props":13871,"children":13872},{"style":1621},[13873],{"type":62,"value":9590},{"type":56,"tag":382,"props":13875,"children":13876},{"style":411},[13877],{"type":62,"value":1629},{"type":56,"tag":382,"props":13879,"children":13880},{"style":417},[13881],{"type":62,"value":2232},{"type":56,"tag":382,"props":13883,"children":13884},{"style":411},[13885],{"type":62,"value":782},{"type":56,"tag":382,"props":13887,"children":13888},{"style":411},[13889],{"type":62,"value":1592},{"type":56,"tag":382,"props":13891,"children":13892},{"class":384,"line":395},[13893,13897,13901,13905],{"type":56,"tag":382,"props":13894,"children":13895},{"style":2182},[13896],{"type":62,"value":2387},{"type":56,"tag":382,"props":13898,"children":13899},{"style":399},[13900],{"type":62,"value":6181},{"type":56,"tag":382,"props":13902,"children":13903},{"style":1884},[13904],{"type":62,"value":1994},{"type":56,"tag":382,"props":13906,"children":13907},{"style":411},[13908],{"type":62,"value":3274},{"type":56,"tag":382,"props":13910,"children":13911},{"class":384,"line":433},[13912,13916,13920,13924,13928,13933,13937,13941,13945,13949],{"type":56,"tag":382,"props":13913,"children":13914},{"style":1884},[13915],{"type":62,"value":6470},{"type":56,"tag":382,"props":13917,"children":13918},{"style":411},[13919],{"type":62,"value":1629},{"type":56,"tag":382,"props":13921,"children":13922},{"style":1884},[13923],{"type":62,"value":6479},{"type":56,"tag":382,"props":13925,"children":13926},{"style":411},[13927],{"type":62,"value":1940},{"type":56,"tag":382,"props":13929,"children":13930},{"style":405},[13931],{"type":62,"value":13932},"order-status",{"type":56,"tag":382,"props":13934,"children":13935},{"style":411},[13936],{"type":62,"value":1940},{"type":56,"tag":382,"props":13938,"children":13939},{"style":411},[13940],{"type":62,"value":1639},{"type":56,"tag":382,"props":13942,"children":13943},{"style":531},[13944],{"type":62,"value":4063},{"type":56,"tag":382,"props":13946,"children":13947},{"style":1884},[13948],{"type":62,"value":2289},{"type":56,"tag":382,"props":13950,"children":13951},{"style":411},[13952],{"type":62,"value":1674},{"type":56,"tag":382,"props":13954,"children":13955},{"class":384,"line":442},[13956,13960,13964,13968,13972,13976,13980,13984,13988,13993,13997,14001,14005,14010,14014,14018,14022,14026],{"type":56,"tag":382,"props":13957,"children":13958},{"style":399},[13959],{"type":62,"value":6508},{"type":56,"tag":382,"props":13961,"children":13962},{"style":411},[13963],{"type":62,"value":1629},{"type":56,"tag":382,"props":13965,"children":13966},{"style":411},[13967],{"type":62,"value":6517},{"type":56,"tag":382,"props":13969,"children":13970},{"style":1579},[13971],{"type":62,"value":3219},{"type":56,"tag":382,"props":13973,"children":13974},{"style":531},[13975],{"type":62,"value":6241},{"type":56,"tag":382,"props":13977,"children":13978},{"style":411},[13979],{"type":62,"value":1906},{"type":56,"tag":382,"props":13981,"children":13982},{"style":399},[13983],{"type":62,"value":6534},{"type":56,"tag":382,"props":13985,"children":13986},{"style":411},[13987],{"type":62,"value":523},{"type":56,"tag":382,"props":13989,"children":13990},{"style":417},[13991],{"type":62,"value":13992},"Order",{"type":56,"tag":382,"props":13994,"children":13995},{"style":411},[13996],{"type":62,"value":4887},{"type":56,"tag":382,"props":13998,"children":13999},{"style":1884},[14000],{"type":62,"value":1994},{"type":56,"tag":382,"props":14002,"children":14003},{"style":411},[14004],{"type":62,"value":2345},{"type":56,"tag":382,"props":14006,"children":14007},{"style":405},[14008],{"type":62,"value":14009},"\u002Fapi\u002Forders\u002F",{"type":56,"tag":382,"props":14011,"children":14012},{"style":411},[14013],{"type":62,"value":2355},{"type":56,"tag":382,"props":14015,"children":14016},{"style":531},[14017],{"type":62,"value":9590},{"type":56,"tag":382,"props":14019,"children":14020},{"style":411},[14021],{"type":62,"value":2364},{"type":56,"tag":382,"props":14023,"children":14024},{"style":1884},[14025],{"type":62,"value":782},{"type":56,"tag":382,"props":14027,"children":14028},{"style":411},[14029],{"type":62,"value":1674},{"type":56,"tag":382,"props":14031,"children":14032},{"class":384,"line":1677},[14033,14038,14042,14046,14050,14054,14058],{"type":56,"tag":382,"props":14034,"children":14035},{"style":399},[14036],{"type":62,"value":14037},"    refetchInterval",{"type":56,"tag":382,"props":14039,"children":14040},{"style":411},[14041],{"type":62,"value":1629},{"type":56,"tag":382,"props":14043,"children":14044},{"style":411},[14045],{"type":62,"value":2307},{"type":56,"tag":382,"props":14047,"children":14048},{"style":1621},[14049],{"type":62,"value":7285},{"type":56,"tag":382,"props":14051,"children":14052},{"style":411},[14053],{"type":62,"value":782},{"type":56,"tag":382,"props":14055,"children":14056},{"style":1579},[14057],{"type":62,"value":3219},{"type":56,"tag":382,"props":14059,"children":14060},{"style":411},[14061],{"type":62,"value":1592},{"type":56,"tag":382,"props":14063,"children":14064},{"class":384,"line":1691},[14065,14070,14074,14078,14082,14087,14091,14095,14099,14103,14107,14111,14115,14119,14123,14127,14132],{"type":56,"tag":382,"props":14066,"children":14067},{"style":2182},[14068],{"type":62,"value":14069},"      if",{"type":56,"tag":382,"props":14071,"children":14072},{"style":1884},[14073],{"type":62,"value":2307},{"type":56,"tag":382,"props":14075,"children":14076},{"style":531},[14077],{"type":62,"value":7285},{"type":56,"tag":382,"props":14079,"children":14080},{"style":411},[14081],{"type":62,"value":1906},{"type":56,"tag":382,"props":14083,"children":14084},{"style":531},[14085],{"type":62,"value":14086},"state",{"type":56,"tag":382,"props":14088,"children":14089},{"style":411},[14090],{"type":62,"value":1906},{"type":56,"tag":382,"props":14092,"children":14093},{"style":531},[14094],{"type":62,"value":6742},{"type":56,"tag":382,"props":14096,"children":14097},{"style":411},[14098],{"type":62,"value":4721},{"type":56,"tag":382,"props":14100,"children":14101},{"style":531},[14102],{"type":62,"value":3295},{"type":56,"tag":382,"props":14104,"children":14105},{"style":411},[14106],{"type":62,"value":5399},{"type":56,"tag":382,"props":14108,"children":14109},{"style":411},[14110],{"type":62,"value":1930},{"type":56,"tag":382,"props":14112,"children":14113},{"style":405},[14114],{"type":62,"value":9635},{"type":56,"tag":382,"props":14116,"children":14117},{"style":411},[14118],{"type":62,"value":1940},{"type":56,"tag":382,"props":14120,"children":14121},{"style":1884},[14122],{"type":62,"value":2059},{"type":56,"tag":382,"props":14124,"children":14125},{"style":2182},[14126],{"type":62,"value":5413},{"type":56,"tag":382,"props":14128,"children":14129},{"style":2694},[14130],{"type":62,"value":14131}," false",{"type":56,"tag":382,"props":14133,"children":14134},{"style":411},[14135],{"type":62,"value":2195},{"type":56,"tag":382,"props":14137,"children":14138},{"class":384,"line":1813},[14139,14143,14148],{"type":56,"tag":382,"props":14140,"children":14141},{"style":2182},[14142],{"type":62,"value":7313},{"type":56,"tag":382,"props":14144,"children":14145},{"style":1947},[14146],{"type":62,"value":14147}," 5000",{"type":56,"tag":382,"props":14149,"children":14150},{"style":411},[14151],{"type":62,"value":2195},{"type":56,"tag":382,"props":14153,"children":14154},{"class":384,"line":1822},[14155],{"type":56,"tag":382,"props":14156,"children":14157},{"style":411},[14158],{"type":62,"value":5171},{"type":56,"tag":382,"props":14160,"children":14161},{"class":384,"line":2296},[14162,14166,14170],{"type":56,"tag":382,"props":14163,"children":14164},{"style":411},[14165],{"type":62,"value":5180},{"type":56,"tag":382,"props":14167,"children":14168},{"style":1884},[14169],{"type":62,"value":782},{"type":56,"tag":382,"props":14171,"children":14172},{"style":411},[14173],{"type":62,"value":2195},{"type":56,"tag":382,"props":14175,"children":14176},{"class":384,"line":2381},[14177],{"type":56,"tag":382,"props":14178,"children":14179},{"style":411},[14180],{"type":62,"value":1697},{"type":56,"tag":82,"props":14182,"children":14184},{"id":14183},"decision-1",[14185],{"type":62,"value":191},{"type":56,"tag":175,"props":14187,"children":14188},{},[14189,14212],{"type":56,"tag":179,"props":14190,"children":14191},{},[14192],{"type":56,"tag":183,"props":14193,"children":14194},{},[14195,14199,14204,14208],{"type":56,"tag":187,"props":14196,"children":14197},{},[14198],{"type":62,"value":11460},{"type":56,"tag":187,"props":14200,"children":14201},{},[14202],{"type":62,"value":14203},"Direction",{"type":56,"tag":187,"props":14205,"children":14206},{},[14207],{"type":62,"value":11475},{"type":56,"tag":187,"props":14209,"children":14210},{},[14211],{"type":62,"value":7912},{"type":56,"tag":203,"props":14213,"children":14214},{},[14215,14237,14259],{"type":56,"tag":183,"props":14216,"children":14217},{},[14218,14223,14228,14232],{"type":56,"tag":210,"props":14219,"children":14220},{},[14221],{"type":62,"value":14222},"Polling",{"type":56,"tag":210,"props":14224,"children":14225},{},[14226],{"type":62,"value":14227},"Client → Server",{"type":56,"tag":210,"props":14229,"children":14230},{},[14231],{"type":62,"value":7948},{"type":56,"tag":210,"props":14233,"children":14234},{},[14235],{"type":62,"value":14236},"Simple status checks, \u003C 10 clients",{"type":56,"tag":183,"props":14238,"children":14239},{},[14240,14245,14250,14254],{"type":56,"tag":210,"props":14241,"children":14242},{},[14243],{"type":62,"value":14244},"SSE",{"type":56,"tag":210,"props":14246,"children":14247},{},[14248],{"type":62,"value":14249},"Server → Client",{"type":56,"tag":210,"props":14251,"children":14252},{},[14253],{"type":62,"value":7970},{"type":56,"tag":210,"props":14255,"children":14256},{},[14257],{"type":62,"value":14258},"Notifications, feeds, AI streaming",{"type":56,"tag":183,"props":14260,"children":14261},{},[14262,14266,14271,14275],{"type":56,"tag":210,"props":14263,"children":14264},{},[14265],{"type":62,"value":13431},{"type":56,"tag":210,"props":14267,"children":14268},{},[14269],{"type":62,"value":14270},"Bidirectional",{"type":56,"tag":210,"props":14272,"children":14273},{},[14274],{"type":62,"value":11544},{"type":56,"tag":210,"props":14276,"children":14277},{},[14278],{"type":62,"value":14279},"Chat, collaboration, gaming",{"type":56,"tag":621,"props":14281,"children":14282},{},[],{"type":56,"tag":65,"props":14284,"children":14286},{"id":14285},"_12-cross-boundary-error-handling-medium",[14287],{"type":62,"value":14288},"12. Cross-Boundary Error Handling (MEDIUM)",{"type":56,"tag":82,"props":14290,"children":14292},{"id":14291},"api-error-user-facing-message",[14293],{"type":62,"value":14294},"API Error → User-Facing Message",{"type":56,"tag":370,"props":14296,"children":14298},{"className":1567,"code":14297,"language":1569,"meta":375,"style":375},"\u002F\u002F lib\u002Ferror-handler.ts\nexport function getErrorMessage(error: unknown): string {\n  if (error instanceof ApiError) {\n    switch (error.status) {\n      case 401: return 'Please log in to continue.';\n      case 403: return 'You don\\'t have permission to do this.';\n      case 404: return 'The item you\\'re looking for doesn\\'t exist.';\n      case 409: return 'This conflicts with an existing item.';\n      case 422:\n        const fields = error.body?.errors;\n        if (fields?.length) return fields.map((f: any) => f.message).join('. ');\n        return 'Please check your input.';\n      case 429: return 'Too many requests. Please wait a moment.';\n      default: return 'Something went wrong. Please try again.';\n    }\n  }\n  if (error instanceof TypeError && error.message === 'Failed to fetch') {\n    return 'Cannot connect to server. Check your internet connection.';\n  }\n  return 'An unexpected error occurred.';\n}\n",[14299],{"type":56,"tag":378,"props":14300,"children":14301},{"__ignoreMap":375},[14302,14310,14354,14385,14417,14454,14501,14555,14592,14608,14650,14776,14800,14837,14870,14877,14884,14949,14973,14980,15004],{"type":56,"tag":382,"props":14303,"children":14304},{"class":384,"line":385},[14305],{"type":56,"tag":382,"props":14306,"children":14307},{"style":389},[14308],{"type":62,"value":14309},"\u002F\u002F lib\u002Ferror-handler.ts\n",{"type":56,"tag":382,"props":14311,"children":14312},{"class":384,"line":395},[14313,14317,14321,14326,14330,14334,14338,14342,14346,14350],{"type":56,"tag":382,"props":14314,"children":14315},{"style":2182},[14316],{"type":62,"value":5484},{"type":56,"tag":382,"props":14318,"children":14319},{"style":1579},[14320],{"type":62,"value":4810},{"type":56,"tag":382,"props":14322,"children":14323},{"style":399},[14324],{"type":62,"value":14325}," getErrorMessage",{"type":56,"tag":382,"props":14327,"children":14328},{"style":411},[14329],{"type":62,"value":1994},{"type":56,"tag":382,"props":14331,"children":14332},{"style":1621},[14333],{"type":62,"value":3479},{"type":56,"tag":382,"props":14335,"children":14336},{"style":411},[14337],{"type":62,"value":1629},{"type":56,"tag":382,"props":14339,"children":14340},{"style":417},[14341],{"type":62,"value":5626},{"type":56,"tag":382,"props":14343,"children":14344},{"style":411},[14345],{"type":62,"value":2237},{"type":56,"tag":382,"props":14347,"children":14348},{"style":417},[14349],{"type":62,"value":2232},{"type":56,"tag":382,"props":14351,"children":14352},{"style":411},[14353],{"type":62,"value":1592},{"type":56,"tag":382,"props":14355,"children":14356},{"class":384,"line":433},[14357,14361,14365,14369,14373,14377,14381],{"type":56,"tag":382,"props":14358,"children":14359},{"style":2182},[14360],{"type":62,"value":2302},{"type":56,"tag":382,"props":14362,"children":14363},{"style":1884},[14364],{"type":62,"value":2307},{"type":56,"tag":382,"props":14366,"children":14367},{"style":531},[14368],{"type":62,"value":3479},{"type":56,"tag":382,"props":14370,"children":14371},{"style":411},[14372],{"type":62,"value":3243},{"type":56,"tag":382,"props":14374,"children":14375},{"style":417},[14376],{"type":62,"value":4630},{"type":56,"tag":382,"props":14378,"children":14379},{"style":1884},[14380],{"type":62,"value":2059},{"type":56,"tag":382,"props":14382,"children":14383},{"style":411},[14384],{"type":62,"value":3274},{"type":56,"tag":382,"props":14386,"children":14387},{"class":384,"line":442},[14388,14393,14397,14401,14405,14409,14413],{"type":56,"tag":382,"props":14389,"children":14390},{"style":2182},[14391],{"type":62,"value":14392},"    switch",{"type":56,"tag":382,"props":14394,"children":14395},{"style":1884},[14396],{"type":62,"value":2307},{"type":56,"tag":382,"props":14398,"children":14399},{"style":531},[14400],{"type":62,"value":3479},{"type":56,"tag":382,"props":14402,"children":14403},{"style":411},[14404],{"type":62,"value":1906},{"type":56,"tag":382,"props":14406,"children":14407},{"style":531},[14408],{"type":62,"value":3295},{"type":56,"tag":382,"props":14410,"children":14411},{"style":1884},[14412],{"type":62,"value":2059},{"type":56,"tag":382,"props":14414,"children":14415},{"style":411},[14416],{"type":62,"value":3274},{"type":56,"tag":382,"props":14418,"children":14419},{"class":384,"line":1677},[14420,14425,14429,14433,14437,14441,14446,14450],{"type":56,"tag":382,"props":14421,"children":14422},{"style":2182},[14423],{"type":62,"value":14424},"      case",{"type":56,"tag":382,"props":14426,"children":14427},{"style":1947},[14428],{"type":62,"value":8709},{"type":56,"tag":382,"props":14430,"children":14431},{"style":411},[14432],{"type":62,"value":1629},{"type":56,"tag":382,"props":14434,"children":14435},{"style":2182},[14436],{"type":62,"value":12941},{"type":56,"tag":382,"props":14438,"children":14439},{"style":411},[14440],{"type":62,"value":1930},{"type":56,"tag":382,"props":14442,"children":14443},{"style":405},[14444],{"type":62,"value":14445},"Please log in to continue.",{"type":56,"tag":382,"props":14447,"children":14448},{"style":411},[14449],{"type":62,"value":1940},{"type":56,"tag":382,"props":14451,"children":14452},{"style":411},[14453],{"type":62,"value":2195},{"type":56,"tag":382,"props":14455,"children":14456},{"class":384,"line":1691},[14457,14461,14466,14470,14474,14478,14483,14488,14493,14497],{"type":56,"tag":382,"props":14458,"children":14459},{"style":2182},[14460],{"type":62,"value":14424},{"type":56,"tag":382,"props":14462,"children":14463},{"style":1947},[14464],{"type":62,"value":14465}," 403",{"type":56,"tag":382,"props":14467,"children":14468},{"style":411},[14469],{"type":62,"value":1629},{"type":56,"tag":382,"props":14471,"children":14472},{"style":2182},[14473],{"type":62,"value":12941},{"type":56,"tag":382,"props":14475,"children":14476},{"style":411},[14477],{"type":62,"value":1930},{"type":56,"tag":382,"props":14479,"children":14480},{"style":405},[14481],{"type":62,"value":14482},"You don",{"type":56,"tag":382,"props":14484,"children":14485},{"style":531},[14486],{"type":62,"value":14487},"\\'",{"type":56,"tag":382,"props":14489,"children":14490},{"style":405},[14491],{"type":62,"value":14492},"t have permission to do this.",{"type":56,"tag":382,"props":14494,"children":14495},{"style":411},[14496],{"type":62,"value":1940},{"type":56,"tag":382,"props":14498,"children":14499},{"style":411},[14500],{"type":62,"value":2195},{"type":56,"tag":382,"props":14502,"children":14503},{"class":384,"line":1813},[14504,14508,14512,14516,14520,14524,14529,14533,14538,14542,14547,14551],{"type":56,"tag":382,"props":14505,"children":14506},{"style":2182},[14507],{"type":62,"value":14424},{"type":56,"tag":382,"props":14509,"children":14510},{"style":1947},[14511],{"type":62,"value":2889},{"type":56,"tag":382,"props":14513,"children":14514},{"style":411},[14515],{"type":62,"value":1629},{"type":56,"tag":382,"props":14517,"children":14518},{"style":2182},[14519],{"type":62,"value":12941},{"type":56,"tag":382,"props":14521,"children":14522},{"style":411},[14523],{"type":62,"value":1930},{"type":56,"tag":382,"props":14525,"children":14526},{"style":405},[14527],{"type":62,"value":14528},"The item you",{"type":56,"tag":382,"props":14530,"children":14531},{"style":531},[14532],{"type":62,"value":14487},{"type":56,"tag":382,"props":14534,"children":14535},{"style":405},[14536],{"type":62,"value":14537},"re looking for doesn",{"type":56,"tag":382,"props":14539,"children":14540},{"style":531},[14541],{"type":62,"value":14487},{"type":56,"tag":382,"props":14543,"children":14544},{"style":405},[14545],{"type":62,"value":14546},"t exist.",{"type":56,"tag":382,"props":14548,"children":14549},{"style":411},[14550],{"type":62,"value":1940},{"type":56,"tag":382,"props":14552,"children":14553},{"style":411},[14554],{"type":62,"value":2195},{"type":56,"tag":382,"props":14556,"children":14557},{"class":384,"line":1822},[14558,14562,14567,14571,14575,14579,14584,14588],{"type":56,"tag":382,"props":14559,"children":14560},{"style":2182},[14561],{"type":62,"value":14424},{"type":56,"tag":382,"props":14563,"children":14564},{"style":1947},[14565],{"type":62,"value":14566}," 409",{"type":56,"tag":382,"props":14568,"children":14569},{"style":411},[14570],{"type":62,"value":1629},{"type":56,"tag":382,"props":14572,"children":14573},{"style":2182},[14574],{"type":62,"value":12941},{"type":56,"tag":382,"props":14576,"children":14577},{"style":411},[14578],{"type":62,"value":1930},{"type":56,"tag":382,"props":14580,"children":14581},{"style":405},[14582],{"type":62,"value":14583},"This conflicts with an existing item.",{"type":56,"tag":382,"props":14585,"children":14586},{"style":411},[14587],{"type":62,"value":1940},{"type":56,"tag":382,"props":14589,"children":14590},{"style":411},[14591],{"type":62,"value":2195},{"type":56,"tag":382,"props":14593,"children":14594},{"class":384,"line":2296},[14595,14599,14603],{"type":56,"tag":382,"props":14596,"children":14597},{"style":2182},[14598],{"type":62,"value":14424},{"type":56,"tag":382,"props":14600,"children":14601},{"style":1947},[14602],{"type":62,"value":3038},{"type":56,"tag":382,"props":14604,"children":14605},{"style":411},[14606],{"type":62,"value":14607},":\n",{"type":56,"tag":382,"props":14609,"children":14610},{"class":384,"line":2381},[14611,14616,14621,14625,14629,14633,14637,14641,14646],{"type":56,"tag":382,"props":14612,"children":14613},{"style":1579},[14614],{"type":62,"value":14615},"        const",{"type":56,"tag":382,"props":14617,"children":14618},{"style":531},[14619],{"type":62,"value":14620}," fields",{"type":56,"tag":382,"props":14622,"children":14623},{"style":411},[14624],{"type":62,"value":2263},{"type":56,"tag":382,"props":14626,"children":14627},{"style":531},[14628],{"type":62,"value":3509},{"type":56,"tag":382,"props":14630,"children":14631},{"style":411},[14632],{"type":62,"value":1906},{"type":56,"tag":382,"props":14634,"children":14635},{"style":531},[14636],{"type":62,"value":4716},{"type":56,"tag":382,"props":14638,"children":14639},{"style":411},[14640],{"type":62,"value":4721},{"type":56,"tag":382,"props":14642,"children":14643},{"style":531},[14644],{"type":62,"value":14645},"errors",{"type":56,"tag":382,"props":14647,"children":14648},{"style":411},[14649],{"type":62,"value":2195},{"type":56,"tag":382,"props":14651,"children":14652},{"class":384,"line":2398},[14653,14658,14662,14667,14671,14675,14679,14683,14687,14691,14696,14700,14704,14709,14713,14717,14721,14725,14730,14734,14738,14742,14746,14751,14755,14759,14764,14768,14772],{"type":56,"tag":382,"props":14654,"children":14655},{"style":2182},[14656],{"type":62,"value":14657},"        if",{"type":56,"tag":382,"props":14659,"children":14660},{"style":1884},[14661],{"type":62,"value":2307},{"type":56,"tag":382,"props":14663,"children":14664},{"style":531},[14665],{"type":62,"value":14666},"fields",{"type":56,"tag":382,"props":14668,"children":14669},{"style":411},[14670],{"type":62,"value":4721},{"type":56,"tag":382,"props":14672,"children":14673},{"style":531},[14674],{"type":62,"value":9172},{"type":56,"tag":382,"props":14676,"children":14677},{"style":1884},[14678],{"type":62,"value":2059},{"type":56,"tag":382,"props":14680,"children":14681},{"style":2182},[14682],{"type":62,"value":5413},{"type":56,"tag":382,"props":14684,"children":14685},{"style":531},[14686],{"type":62,"value":14620},{"type":56,"tag":382,"props":14688,"children":14689},{"style":411},[14690],{"type":62,"value":1906},{"type":56,"tag":382,"props":14692,"children":14693},{"style":399},[14694],{"type":62,"value":14695},"map",{"type":56,"tag":382,"props":14697,"children":14698},{"style":1884},[14699],{"type":62,"value":1994},{"type":56,"tag":382,"props":14701,"children":14702},{"style":411},[14703],{"type":62,"value":1994},{"type":56,"tag":382,"props":14705,"children":14706},{"style":1621},[14707],{"type":62,"value":14708},"f",{"type":56,"tag":382,"props":14710,"children":14711},{"style":411},[14712],{"type":62,"value":1629},{"type":56,"tag":382,"props":14714,"children":14715},{"style":417},[14716],{"type":62,"value":4692},{"type":56,"tag":382,"props":14718,"children":14719},{"style":411},[14720],{"type":62,"value":782},{"type":56,"tag":382,"props":14722,"children":14723},{"style":1579},[14724],{"type":62,"value":3219},{"type":56,"tag":382,"props":14726,"children":14727},{"style":531},[14728],{"type":62,"value":14729}," f",{"type":56,"tag":382,"props":14731,"children":14732},{"style":411},[14733],{"type":62,"value":1906},{"type":56,"tag":382,"props":14735,"children":14736},{"style":531},[14737],{"type":62,"value":2726},{"type":56,"tag":382,"props":14739,"children":14740},{"style":1884},[14741],{"type":62,"value":782},{"type":56,"tag":382,"props":14743,"children":14744},{"style":411},[14745],{"type":62,"value":1906},{"type":56,"tag":382,"props":14747,"children":14748},{"style":399},[14749],{"type":62,"value":14750},"join",{"type":56,"tag":382,"props":14752,"children":14753},{"style":1884},[14754],{"type":62,"value":1994},{"type":56,"tag":382,"props":14756,"children":14757},{"style":411},[14758],{"type":62,"value":1940},{"type":56,"tag":382,"props":14760,"children":14761},{"style":405},[14762],{"type":62,"value":14763},". ",{"type":56,"tag":382,"props":14765,"children":14766},{"style":411},[14767],{"type":62,"value":1940},{"type":56,"tag":382,"props":14769,"children":14770},{"style":1884},[14771],{"type":62,"value":782},{"type":56,"tag":382,"props":14773,"children":14774},{"style":411},[14775],{"type":62,"value":2195},{"type":56,"tag":382,"props":14777,"children":14778},{"class":384,"line":2822},[14779,14783,14787,14792,14796],{"type":56,"tag":382,"props":14780,"children":14781},{"style":2182},[14782],{"type":62,"value":7543},{"type":56,"tag":382,"props":14784,"children":14785},{"style":411},[14786],{"type":62,"value":1930},{"type":56,"tag":382,"props":14788,"children":14789},{"style":405},[14790],{"type":62,"value":14791},"Please check your input.",{"type":56,"tag":382,"props":14793,"children":14794},{"style":411},[14795],{"type":62,"value":1940},{"type":56,"tag":382,"props":14797,"children":14798},{"style":411},[14799],{"type":62,"value":2195},{"type":56,"tag":382,"props":14801,"children":14802},{"class":384,"line":2900},[14803,14807,14812,14816,14820,14824,14829,14833],{"type":56,"tag":382,"props":14804,"children":14805},{"style":2182},[14806],{"type":62,"value":14424},{"type":56,"tag":382,"props":14808,"children":14809},{"style":1947},[14810],{"type":62,"value":14811}," 429",{"type":56,"tag":382,"props":14813,"children":14814},{"style":411},[14815],{"type":62,"value":1629},{"type":56,"tag":382,"props":14817,"children":14818},{"style":2182},[14819],{"type":62,"value":12941},{"type":56,"tag":382,"props":14821,"children":14822},{"style":411},[14823],{"type":62,"value":1930},{"type":56,"tag":382,"props":14825,"children":14826},{"style":405},[14827],{"type":62,"value":14828},"Too many requests. Please wait a moment.",{"type":56,"tag":382,"props":14830,"children":14831},{"style":411},[14832],{"type":62,"value":1940},{"type":56,"tag":382,"props":14834,"children":14835},{"style":411},[14836],{"type":62,"value":2195},{"type":56,"tag":382,"props":14838,"children":14839},{"class":384,"line":2909},[14840,14845,14849,14853,14857,14862,14866],{"type":56,"tag":382,"props":14841,"children":14842},{"style":2182},[14843],{"type":62,"value":14844},"      default",{"type":56,"tag":382,"props":14846,"children":14847},{"style":411},[14848],{"type":62,"value":1629},{"type":56,"tag":382,"props":14850,"children":14851},{"style":2182},[14852],{"type":62,"value":12941},{"type":56,"tag":382,"props":14854,"children":14855},{"style":411},[14856],{"type":62,"value":1930},{"type":56,"tag":382,"props":14858,"children":14859},{"style":405},[14860],{"type":62,"value":14861},"Something went wrong. Please try again.",{"type":56,"tag":382,"props":14863,"children":14864},{"style":411},[14865],{"type":62,"value":1940},{"type":56,"tag":382,"props":14867,"children":14868},{"style":411},[14869],{"type":62,"value":2195},{"type":56,"tag":382,"props":14871,"children":14872},{"class":384,"line":2917},[14873],{"type":56,"tag":382,"props":14874,"children":14875},{"style":411},[14876],{"type":62,"value":8959},{"type":56,"tag":382,"props":14878,"children":14879},{"class":384,"line":2942},[14880],{"type":56,"tag":382,"props":14881,"children":14882},{"style":411},[14883],{"type":62,"value":2906},{"type":56,"tag":382,"props":14885,"children":14886},{"class":384,"line":2990},[14887,14891,14895,14899,14903,14908,14912,14916,14920,14924,14928,14932,14937,14941,14945],{"type":56,"tag":382,"props":14888,"children":14889},{"style":2182},[14890],{"type":62,"value":2302},{"type":56,"tag":382,"props":14892,"children":14893},{"style":1884},[14894],{"type":62,"value":2307},{"type":56,"tag":382,"props":14896,"children":14897},{"style":531},[14898],{"type":62,"value":3479},{"type":56,"tag":382,"props":14900,"children":14901},{"style":411},[14902],{"type":62,"value":3243},{"type":56,"tag":382,"props":14904,"children":14905},{"style":417},[14906],{"type":62,"value":14907}," TypeError",{"type":56,"tag":382,"props":14909,"children":14910},{"style":411},[14911],{"type":62,"value":414},{"type":56,"tag":382,"props":14913,"children":14914},{"style":531},[14915],{"type":62,"value":3509},{"type":56,"tag":382,"props":14917,"children":14918},{"style":411},[14919],{"type":62,"value":1906},{"type":56,"tag":382,"props":14921,"children":14922},{"style":531},[14923],{"type":62,"value":2726},{"type":56,"tag":382,"props":14925,"children":14926},{"style":411},[14927],{"type":62,"value":5399},{"type":56,"tag":382,"props":14929,"children":14930},{"style":411},[14931],{"type":62,"value":1930},{"type":56,"tag":382,"props":14933,"children":14934},{"style":405},[14935],{"type":62,"value":14936},"Failed to fetch",{"type":56,"tag":382,"props":14938,"children":14939},{"style":411},[14940],{"type":62,"value":1940},{"type":56,"tag":382,"props":14942,"children":14943},{"style":1884},[14944],{"type":62,"value":2059},{"type":56,"tag":382,"props":14946,"children":14947},{"style":411},[14948],{"type":62,"value":3274},{"type":56,"tag":382,"props":14950,"children":14951},{"class":384,"line":3049},[14952,14956,14960,14965,14969],{"type":56,"tag":382,"props":14953,"children":14954},{"style":2182},[14955],{"type":62,"value":3282},{"type":56,"tag":382,"props":14957,"children":14958},{"style":411},[14959],{"type":62,"value":1930},{"type":56,"tag":382,"props":14961,"children":14962},{"style":405},[14963],{"type":62,"value":14964},"Cannot connect to server. Check your internet connection.",{"type":56,"tag":382,"props":14966,"children":14967},{"style":411},[14968],{"type":62,"value":1940},{"type":56,"tag":382,"props":14970,"children":14971},{"style":411},[14972],{"type":62,"value":2195},{"type":56,"tag":382,"props":14974,"children":14975},{"class":384,"line":3057},[14976],{"type":56,"tag":382,"props":14977,"children":14978},{"style":411},[14979],{"type":62,"value":2906},{"type":56,"tag":382,"props":14981,"children":14982},{"class":384,"line":5174},[14983,14987,14991,14996,15000],{"type":56,"tag":382,"props":14984,"children":14985},{"style":2182},[14986],{"type":62,"value":2387},{"type":56,"tag":382,"props":14988,"children":14989},{"style":411},[14990],{"type":62,"value":1930},{"type":56,"tag":382,"props":14992,"children":14993},{"style":405},[14994],{"type":62,"value":14995},"An unexpected error occurred.",{"type":56,"tag":382,"props":14997,"children":14998},{"style":411},[14999],{"type":62,"value":1940},{"type":56,"tag":382,"props":15001,"children":15002},{"style":411},[15003],{"type":62,"value":2195},{"type":56,"tag":382,"props":15005,"children":15006},{"class":384,"line":5191},[15007],{"type":56,"tag":382,"props":15008,"children":15009},{"style":411},[15010],{"type":62,"value":1697},{"type":56,"tag":82,"props":15012,"children":15014},{"id":15013},"react-query-global-error-handler",[15015],{"type":62,"value":15016},"React Query Global Error Handler",{"type":56,"tag":370,"props":15018,"children":15020},{"className":1567,"code":15019,"language":1569,"meta":375,"style":375},"const queryClient = new QueryClient({\n  defaultOptions: {\n    mutations: { onError: (error) => toast.error(getErrorMessage(error)) },\n    queries: {\n      retry: (failureCount, error) => {\n        if (error instanceof ApiError && error.status \u003C 500) return false;\n        return failureCount \u003C 3;\n      },\n    },\n  },\n});\n",[15021],{"type":56,"tag":378,"props":15022,"children":15023},{"__ignoreMap":375},[15024,15057,15073,15145,15161,15202,15265,15290,15298,15305,15313],{"type":56,"tag":382,"props":15025,"children":15026},{"class":384,"line":385},[15027,15031,15036,15040,15044,15049,15053],{"type":56,"tag":382,"props":15028,"children":15029},{"style":1579},[15030],{"type":62,"value":1864},{"type":56,"tag":382,"props":15032,"children":15033},{"style":531},[15034],{"type":62,"value":15035}," queryClient ",{"type":56,"tag":382,"props":15037,"children":15038},{"style":411},[15039],{"type":62,"value":1874},{"type":56,"tag":382,"props":15041,"children":15042},{"style":411},[15043],{"type":62,"value":2331},{"type":56,"tag":382,"props":15045,"children":15046},{"style":399},[15047],{"type":62,"value":15048}," QueryClient",{"type":56,"tag":382,"props":15050,"children":15051},{"style":531},[15052],{"type":62,"value":1994},{"type":56,"tag":382,"props":15054,"children":15055},{"style":411},[15056],{"type":62,"value":3274},{"type":56,"tag":382,"props":15058,"children":15059},{"class":384,"line":395},[15060,15065,15069],{"type":56,"tag":382,"props":15061,"children":15062},{"style":1884},[15063],{"type":62,"value":15064},"  defaultOptions",{"type":56,"tag":382,"props":15066,"children":15067},{"style":411},[15068],{"type":62,"value":1629},{"type":56,"tag":382,"props":15070,"children":15071},{"style":411},[15072],{"type":62,"value":1592},{"type":56,"tag":382,"props":15074,"children":15075},{"class":384,"line":433},[15076,15081,15085,15089,15094,15098,15102,15106,15110,15114,15119,15123,15127,15131,15136,15141],{"type":56,"tag":382,"props":15077,"children":15078},{"style":1884},[15079],{"type":62,"value":15080},"    mutations",{"type":56,"tag":382,"props":15082,"children":15083},{"style":411},[15084],{"type":62,"value":1629},{"type":56,"tag":382,"props":15086,"children":15087},{"style":411},[15088],{"type":62,"value":1975},{"type":56,"tag":382,"props":15090,"children":15091},{"style":399},[15092],{"type":62,"value":15093}," onError",{"type":56,"tag":382,"props":15095,"children":15096},{"style":411},[15097],{"type":62,"value":1629},{"type":56,"tag":382,"props":15099,"children":15100},{"style":411},[15101],{"type":62,"value":2307},{"type":56,"tag":382,"props":15103,"children":15104},{"style":1621},[15105],{"type":62,"value":3479},{"type":56,"tag":382,"props":15107,"children":15108},{"style":411},[15109],{"type":62,"value":782},{"type":56,"tag":382,"props":15111,"children":15112},{"style":1579},[15113],{"type":62,"value":3219},{"type":56,"tag":382,"props":15115,"children":15116},{"style":531},[15117],{"type":62,"value":15118}," toast",{"type":56,"tag":382,"props":15120,"children":15121},{"style":411},[15122],{"type":62,"value":1906},{"type":56,"tag":382,"props":15124,"children":15125},{"style":399},[15126],{"type":62,"value":3479},{"type":56,"tag":382,"props":15128,"children":15129},{"style":531},[15130],{"type":62,"value":1994},{"type":56,"tag":382,"props":15132,"children":15133},{"style":399},[15134],{"type":62,"value":15135},"getErrorMessage",{"type":56,"tag":382,"props":15137,"children":15138},{"style":531},[15139],{"type":62,"value":15140},"(error)) ",{"type":56,"tag":382,"props":15142,"children":15143},{"style":411},[15144],{"type":62,"value":2064},{"type":56,"tag":382,"props":15146,"children":15147},{"class":384,"line":442},[15148,15153,15157],{"type":56,"tag":382,"props":15149,"children":15150},{"style":1884},[15151],{"type":62,"value":15152},"    queries",{"type":56,"tag":382,"props":15154,"children":15155},{"style":411},[15156],{"type":62,"value":1629},{"type":56,"tag":382,"props":15158,"children":15159},{"style":411},[15160],{"type":62,"value":1592},{"type":56,"tag":382,"props":15162,"children":15163},{"class":384,"line":1677},[15164,15169,15173,15177,15182,15186,15190,15194,15198],{"type":56,"tag":382,"props":15165,"children":15166},{"style":399},[15167],{"type":62,"value":15168},"      retry",{"type":56,"tag":382,"props":15170,"children":15171},{"style":411},[15172],{"type":62,"value":1629},{"type":56,"tag":382,"props":15174,"children":15175},{"style":411},[15176],{"type":62,"value":2307},{"type":56,"tag":382,"props":15178,"children":15179},{"style":1621},[15180],{"type":62,"value":15181},"failureCount",{"type":56,"tag":382,"props":15183,"children":15184},{"style":411},[15185],{"type":62,"value":1639},{"type":56,"tag":382,"props":15187,"children":15188},{"style":1621},[15189],{"type":62,"value":3509},{"type":56,"tag":382,"props":15191,"children":15192},{"style":411},[15193],{"type":62,"value":782},{"type":56,"tag":382,"props":15195,"children":15196},{"style":1579},[15197],{"type":62,"value":3219},{"type":56,"tag":382,"props":15199,"children":15200},{"style":411},[15201],{"type":62,"value":1592},{"type":56,"tag":382,"props":15203,"children":15204},{"class":384,"line":1691},[15205,15209,15213,15217,15221,15225,15229,15233,15237,15241,15245,15249,15253,15257,15261],{"type":56,"tag":382,"props":15206,"children":15207},{"style":2182},[15208],{"type":62,"value":14657},{"type":56,"tag":382,"props":15210,"children":15211},{"style":1884},[15212],{"type":62,"value":2307},{"type":56,"tag":382,"props":15214,"children":15215},{"style":531},[15216],{"type":62,"value":3479},{"type":56,"tag":382,"props":15218,"children":15219},{"style":411},[15220],{"type":62,"value":3243},{"type":56,"tag":382,"props":15222,"children":15223},{"style":417},[15224],{"type":62,"value":4630},{"type":56,"tag":382,"props":15226,"children":15227},{"style":411},[15228],{"type":62,"value":414},{"type":56,"tag":382,"props":15230,"children":15231},{"style":531},[15232],{"type":62,"value":3509},{"type":56,"tag":382,"props":15234,"children":15235},{"style":411},[15236],{"type":62,"value":1906},{"type":56,"tag":382,"props":15238,"children":15239},{"style":531},[15240],{"type":62,"value":3295},{"type":56,"tag":382,"props":15242,"children":15243},{"style":411},[15244],{"type":62,"value":5519},{"type":56,"tag":382,"props":15246,"children":15247},{"style":1947},[15248],{"type":62,"value":3673},{"type":56,"tag":382,"props":15250,"children":15251},{"style":1884},[15252],{"type":62,"value":2059},{"type":56,"tag":382,"props":15254,"children":15255},{"style":2182},[15256],{"type":62,"value":5413},{"type":56,"tag":382,"props":15258,"children":15259},{"style":2694},[15260],{"type":62,"value":14131},{"type":56,"tag":382,"props":15262,"children":15263},{"style":411},[15264],{"type":62,"value":2195},{"type":56,"tag":382,"props":15266,"children":15267},{"class":384,"line":1813},[15268,15272,15277,15281,15286],{"type":56,"tag":382,"props":15269,"children":15270},{"style":2182},[15271],{"type":62,"value":7543},{"type":56,"tag":382,"props":15273,"children":15274},{"style":531},[15275],{"type":62,"value":15276}," failureCount",{"type":56,"tag":382,"props":15278,"children":15279},{"style":411},[15280],{"type":62,"value":5519},{"type":56,"tag":382,"props":15282,"children":15283},{"style":1947},[15284],{"type":62,"value":15285}," 3",{"type":56,"tag":382,"props":15287,"children":15288},{"style":411},[15289],{"type":62,"value":2195},{"type":56,"tag":382,"props":15291,"children":15292},{"class":384,"line":1822},[15293],{"type":56,"tag":382,"props":15294,"children":15295},{"style":411},[15296],{"type":62,"value":15297},"      },\n",{"type":56,"tag":382,"props":15299,"children":15300},{"class":384,"line":2296},[15301],{"type":56,"tag":382,"props":15302,"children":15303},{"style":411},[15304],{"type":62,"value":5171},{"type":56,"tag":382,"props":15306,"children":15307},{"class":384,"line":2381},[15308],{"type":56,"tag":382,"props":15309,"children":15310},{"style":411},[15311],{"type":62,"value":15312},"  },\n",{"type":56,"tag":382,"props":15314,"children":15315},{"class":384,"line":2398},[15316,15320,15324],{"type":56,"tag":382,"props":15317,"children":15318},{"style":411},[15319],{"type":62,"value":2179},{"type":56,"tag":382,"props":15321,"children":15322},{"style":531},[15323],{"type":62,"value":782},{"type":56,"tag":382,"props":15325,"children":15326},{"style":411},[15327],{"type":62,"value":2195},{"type":56,"tag":82,"props":15329,"children":15331},{"id":15330},"rules-5",[15332],{"type":62,"value":2509},{"type":56,"tag":370,"props":15334,"children":15337},{"className":15335,"code":15336,"language":62},[1424],"✅ Map every API error code to a human-readable message\n✅ Show field-level validation errors next to form inputs\n✅ Auto-retry on 5xx (max 3, with backoff), never on 4xx\n✅ Redirect to login on 401 (after refresh attempt fails)\n✅ Show \"offline\" banner when fetch fails with TypeError\n\n❌ Never show raw API error messages to users (\"NullPointerException\")\n❌ Never silently swallow errors (show toast or log)\n❌ Never retry 4xx errors (client is wrong, retrying won't help)\n",[15338],{"type":56,"tag":378,"props":15339,"children":15340},{"__ignoreMap":375},[15341],{"type":62,"value":15336},{"type":56,"tag":82,"props":15343,"children":15345},{"id":15344},"integration-decision-tree",[15346],{"type":62,"value":15347},"Integration Decision Tree",{"type":56,"tag":370,"props":15349,"children":15352},{"className":15350,"code":15351,"language":62},[1424],"Same team owns frontend + backend?\n│\n├─ YES, both TypeScript\n│   └─ tRPC (end-to-end type safety, zero codegen)\n│\n├─ YES, different languages\n│   └─ OpenAPI spec → generated client (type safety via codegen)\n│\n├─ NO, public API\n│   └─ REST + OpenAPI → generated SDKs for consumers\n│\n└─ Complex data needs, multiple frontends\n    └─ GraphQL + codegen (flexible queries per client)\n\nReal-time needed?\n│\n├─ Server → Client only (notifications, feeds, AI streaming)\n│   └─ SSE (simplest, auto-reconnect, works through proxies)\n│\n├─ Bidirectional (chat, collaboration)\n│   └─ WebSocket (need heartbeat + reconnection logic)\n│\n└─ Simple status polling (\u003C 10 clients)\n    └─ React Query refetchInterval (no infrastructure needed)\n",[15353],{"type":56,"tag":378,"props":15354,"children":15355},{"__ignoreMap":375},[15356],{"type":62,"value":15351},{"type":56,"tag":621,"props":15358,"children":15359},{},[],{"type":56,"tag":65,"props":15361,"children":15363},{"id":15362},"_13-production-hardening-medium",[15364],{"type":62,"value":15365},"13. Production Hardening (MEDIUM)",{"type":56,"tag":82,"props":15367,"children":15369},{"id":15368},"health-checks",[15370],{"type":62,"value":15371},"Health Checks",{"type":56,"tag":370,"props":15373,"children":15375},{"className":1567,"code":15374,"language":1569,"meta":375,"style":375},"app.get('\u002Fhealth', (req, res) => res.json({ status: 'ok' }));           \u002F\u002F liveness\napp.get('\u002Fready', async (req, res) => {                                   \u002F\u002F readiness\n  const checks = {\n    database: await checkDb(), redis: await checkRedis(), \n  };\n  const ok = Object.values(checks).every(c => c.status === 'ok');\n  res.status(ok ? 200 : 503).json({ status: ok ? 'ok' : 'degraded', checks });\n});\n",[15376],{"type":56,"tag":378,"props":15377,"children":15378},{"__ignoreMap":375},[15379,15495,15567,15587,15646,15653,15755,15881],{"type":56,"tag":382,"props":15380,"children":15381},{"class":384,"line":385},[15382,15386,15390,15394,15398,15402,15406,15410,15414,15418,15422,15426,15430,15434,15438,15442,15446,15450,15454,15458,15462,15466,15470,15474,15478,15482,15486,15490],{"type":56,"tag":382,"props":15383,"children":15384},{"style":531},[15385],{"type":62,"value":3161},{"type":56,"tag":382,"props":15387,"children":15388},{"style":411},[15389],{"type":62,"value":1906},{"type":56,"tag":382,"props":15391,"children":15392},{"style":399},[15393],{"type":62,"value":6534},{"type":56,"tag":382,"props":15395,"children":15396},{"style":531},[15397],{"type":62,"value":1994},{"type":56,"tag":382,"props":15399,"children":15400},{"style":411},[15401],{"type":62,"value":1940},{"type":56,"tag":382,"props":15403,"children":15404},{"style":405},[15405],{"type":62,"value":886},{"type":56,"tag":382,"props":15407,"children":15408},{"style":411},[15409],{"type":62,"value":1940},{"type":56,"tag":382,"props":15411,"children":15412},{"style":411},[15413],{"type":62,"value":1639},{"type":56,"tag":382,"props":15415,"children":15416},{"style":411},[15417],{"type":62,"value":2307},{"type":56,"tag":382,"props":15419,"children":15420},{"style":1621},[15421],{"type":62,"value":8164},{"type":56,"tag":382,"props":15423,"children":15424},{"style":411},[15425],{"type":62,"value":1639},{"type":56,"tag":382,"props":15427,"children":15428},{"style":1621},[15429],{"type":62,"value":3201},{"type":56,"tag":382,"props":15431,"children":15432},{"style":411},[15433],{"type":62,"value":782},{"type":56,"tag":382,"props":15435,"children":15436},{"style":1579},[15437],{"type":62,"value":3219},{"type":56,"tag":382,"props":15439,"children":15440},{"style":531},[15441],{"type":62,"value":3201},{"type":56,"tag":382,"props":15443,"children":15444},{"style":411},[15445],{"type":62,"value":1906},{"type":56,"tag":382,"props":15447,"children":15448},{"style":399},[15449],{"type":62,"value":3325},{"type":56,"tag":382,"props":15451,"children":15452},{"style":531},[15453],{"type":62,"value":1994},{"type":56,"tag":382,"props":15455,"children":15456},{"style":411},[15457],{"type":62,"value":3634},{"type":56,"tag":382,"props":15459,"children":15460},{"style":1884},[15461],{"type":62,"value":3366},{"type":56,"tag":382,"props":15463,"children":15464},{"style":411},[15465],{"type":62,"value":1629},{"type":56,"tag":382,"props":15467,"children":15468},{"style":411},[15469],{"type":62,"value":1930},{"type":56,"tag":382,"props":15471,"children":15472},{"style":405},[15473],{"type":62,"value":5226},{"type":56,"tag":382,"props":15475,"children":15476},{"style":411},[15477],{"type":62,"value":1940},{"type":56,"tag":382,"props":15479,"children":15480},{"style":411},[15481],{"type":62,"value":3580},{"type":56,"tag":382,"props":15483,"children":15484},{"style":531},[15485],{"type":62,"value":13118},{"type":56,"tag":382,"props":15487,"children":15488},{"style":411},[15489],{"type":62,"value":2373},{"type":56,"tag":382,"props":15491,"children":15492},{"style":389},[15493],{"type":62,"value":15494},"           \u002F\u002F liveness\n",{"type":56,"tag":382,"props":15496,"children":15497},{"class":384,"line":395},[15498,15502,15506,15510,15514,15518,15522,15526,15530,15534,15538,15542,15546,15550,15554,15558,15562],{"type":56,"tag":382,"props":15499,"children":15500},{"style":531},[15501],{"type":62,"value":3161},{"type":56,"tag":382,"props":15503,"children":15504},{"style":411},[15505],{"type":62,"value":1906},{"type":56,"tag":382,"props":15507,"children":15508},{"style":399},[15509],{"type":62,"value":6534},{"type":56,"tag":382,"props":15511,"children":15512},{"style":531},[15513],{"type":62,"value":1994},{"type":56,"tag":382,"props":15515,"children":15516},{"style":411},[15517],{"type":62,"value":1940},{"type":56,"tag":382,"props":15519,"children":15520},{"style":405},[15521],{"type":62,"value":894},{"type":56,"tag":382,"props":15523,"children":15524},{"style":411},[15525],{"type":62,"value":1940},{"type":56,"tag":382,"props":15527,"children":15528},{"style":411},[15529],{"type":62,"value":1639},{"type":56,"tag":382,"props":15531,"children":15532},{"style":1579},[15533],{"type":62,"value":10396},{"type":56,"tag":382,"props":15535,"children":15536},{"style":411},[15537],{"type":62,"value":2307},{"type":56,"tag":382,"props":15539,"children":15540},{"style":1621},[15541],{"type":62,"value":8164},{"type":56,"tag":382,"props":15543,"children":15544},{"style":411},[15545],{"type":62,"value":1639},{"type":56,"tag":382,"props":15547,"children":15548},{"style":1621},[15549],{"type":62,"value":3201},{"type":56,"tag":382,"props":15551,"children":15552},{"style":411},[15553],{"type":62,"value":782},{"type":56,"tag":382,"props":15555,"children":15556},{"style":1579},[15557],{"type":62,"value":3219},{"type":56,"tag":382,"props":15559,"children":15560},{"style":411},[15561],{"type":62,"value":1975},{"type":56,"tag":382,"props":15563,"children":15564},{"style":389},[15565],{"type":62,"value":15566},"                                   \u002F\u002F readiness\n",{"type":56,"tag":382,"props":15568,"children":15569},{"class":384,"line":433},[15570,15574,15579,15583],{"type":56,"tag":382,"props":15571,"children":15572},{"style":1579},[15573],{"type":62,"value":2253},{"type":56,"tag":382,"props":15575,"children":15576},{"style":531},[15577],{"type":62,"value":15578}," checks",{"type":56,"tag":382,"props":15580,"children":15581},{"style":411},[15582],{"type":62,"value":2263},{"type":56,"tag":382,"props":15584,"children":15585},{"style":411},[15586],{"type":62,"value":1592},{"type":56,"tag":382,"props":15588,"children":15589},{"class":384,"line":442},[15590,15595,15599,15603,15608,15612,15616,15620,15624,15628,15633,15637,15641],{"type":56,"tag":382,"props":15591,"children":15592},{"style":1884},[15593],{"type":62,"value":15594},"    database",{"type":56,"tag":382,"props":15596,"children":15597},{"style":411},[15598],{"type":62,"value":1629},{"type":56,"tag":382,"props":15600,"children":15601},{"style":2182},[15602],{"type":62,"value":3927},{"type":56,"tag":382,"props":15604,"children":15605},{"style":399},[15606],{"type":62,"value":15607}," checkDb",{"type":56,"tag":382,"props":15609,"children":15610},{"style":1884},[15611],{"type":62,"value":3955},{"type":56,"tag":382,"props":15613,"children":15614},{"style":411},[15615],{"type":62,"value":1639},{"type":56,"tag":382,"props":15617,"children":15618},{"style":1884},[15619],{"type":62,"value":9864},{"type":56,"tag":382,"props":15621,"children":15622},{"style":411},[15623],{"type":62,"value":1629},{"type":56,"tag":382,"props":15625,"children":15626},{"style":2182},[15627],{"type":62,"value":3927},{"type":56,"tag":382,"props":15629,"children":15630},{"style":399},[15631],{"type":62,"value":15632}," checkRedis",{"type":56,"tag":382,"props":15634,"children":15635},{"style":1884},[15636],{"type":62,"value":3955},{"type":56,"tag":382,"props":15638,"children":15639},{"style":411},[15640],{"type":62,"value":1639},{"type":56,"tag":382,"props":15642,"children":15643},{"style":1884},[15644],{"type":62,"value":15645}," \n",{"type":56,"tag":382,"props":15647,"children":15648},{"class":384,"line":1677},[15649],{"type":56,"tag":382,"props":15650,"children":15651},{"style":411},[15652],{"type":62,"value":8373},{"type":56,"tag":382,"props":15654,"children":15655},{"class":384,"line":1691},[15656,15660,15665,15669,15674,15678,15683,15687,15692,15696,15700,15705,15709,15714,15718,15723,15727,15731,15735,15739,15743,15747,15751],{"type":56,"tag":382,"props":15657,"children":15658},{"style":1579},[15659],{"type":62,"value":2253},{"type":56,"tag":382,"props":15661,"children":15662},{"style":531},[15663],{"type":62,"value":15664}," ok",{"type":56,"tag":382,"props":15666,"children":15667},{"style":411},[15668],{"type":62,"value":2263},{"type":56,"tag":382,"props":15670,"children":15671},{"style":531},[15672],{"type":62,"value":15673}," Object",{"type":56,"tag":382,"props":15675,"children":15676},{"style":411},[15677],{"type":62,"value":1906},{"type":56,"tag":382,"props":15679,"children":15680},{"style":399},[15681],{"type":62,"value":15682},"values",{"type":56,"tag":382,"props":15684,"children":15685},{"style":1884},[15686],{"type":62,"value":1994},{"type":56,"tag":382,"props":15688,"children":15689},{"style":531},[15690],{"type":62,"value":15691},"checks",{"type":56,"tag":382,"props":15693,"children":15694},{"style":1884},[15695],{"type":62,"value":782},{"type":56,"tag":382,"props":15697,"children":15698},{"style":411},[15699],{"type":62,"value":1906},{"type":56,"tag":382,"props":15701,"children":15702},{"style":399},[15703],{"type":62,"value":15704},"every",{"type":56,"tag":382,"props":15706,"children":15707},{"style":1884},[15708],{"type":62,"value":1994},{"type":56,"tag":382,"props":15710,"children":15711},{"style":1621},[15712],{"type":62,"value":15713},"c",{"type":56,"tag":382,"props":15715,"children":15716},{"style":1579},[15717],{"type":62,"value":3219},{"type":56,"tag":382,"props":15719,"children":15720},{"style":531},[15721],{"type":62,"value":15722}," c",{"type":56,"tag":382,"props":15724,"children":15725},{"style":411},[15726],{"type":62,"value":1906},{"type":56,"tag":382,"props":15728,"children":15729},{"style":531},[15730],{"type":62,"value":3295},{"type":56,"tag":382,"props":15732,"children":15733},{"style":411},[15734],{"type":62,"value":5399},{"type":56,"tag":382,"props":15736,"children":15737},{"style":411},[15738],{"type":62,"value":1930},{"type":56,"tag":382,"props":15740,"children":15741},{"style":405},[15742],{"type":62,"value":5226},{"type":56,"tag":382,"props":15744,"children":15745},{"style":411},[15746],{"type":62,"value":1940},{"type":56,"tag":382,"props":15748,"children":15749},{"style":1884},[15750],{"type":62,"value":782},{"type":56,"tag":382,"props":15752,"children":15753},{"style":411},[15754],{"type":62,"value":2195},{"type":56,"tag":382,"props":15756,"children":15757},{"class":384,"line":1813},[15758,15762,15766,15770,15774,15778,15782,15787,15791,15796,15800,15804,15808,15812,15816,15820,15824,15828,15832,15836,15840,15844,15848,15852,15857,15861,15865,15869,15873,15877],{"type":56,"tag":382,"props":15759,"children":15760},{"style":531},[15761],{"type":62,"value":3596},{"type":56,"tag":382,"props":15763,"children":15764},{"style":411},[15765],{"type":62,"value":1906},{"type":56,"tag":382,"props":15767,"children":15768},{"style":399},[15769],{"type":62,"value":3295},{"type":56,"tag":382,"props":15771,"children":15772},{"style":1884},[15773],{"type":62,"value":1994},{"type":56,"tag":382,"props":15775,"children":15776},{"style":531},[15777],{"type":62,"value":5226},{"type":56,"tag":382,"props":15779,"children":15780},{"style":411},[15781],{"type":62,"value":5083},{"type":56,"tag":382,"props":15783,"children":15784},{"style":1947},[15785],{"type":62,"value":15786}," 200",{"type":56,"tag":382,"props":15788,"children":15789},{"style":411},[15790],{"type":62,"value":5126},{"type":56,"tag":382,"props":15792,"children":15793},{"style":1947},[15794],{"type":62,"value":15795}," 503",{"type":56,"tag":382,"props":15797,"children":15798},{"style":1884},[15799],{"type":62,"value":782},{"type":56,"tag":382,"props":15801,"children":15802},{"style":411},[15803],{"type":62,"value":1906},{"type":56,"tag":382,"props":15805,"children":15806},{"style":399},[15807],{"type":62,"value":3325},{"type":56,"tag":382,"props":15809,"children":15810},{"style":1884},[15811],{"type":62,"value":1994},{"type":56,"tag":382,"props":15813,"children":15814},{"style":411},[15815],{"type":62,"value":3634},{"type":56,"tag":382,"props":15817,"children":15818},{"style":1884},[15819],{"type":62,"value":3366},{"type":56,"tag":382,"props":15821,"children":15822},{"style":411},[15823],{"type":62,"value":1629},{"type":56,"tag":382,"props":15825,"children":15826},{"style":531},[15827],{"type":62,"value":15664},{"type":56,"tag":382,"props":15829,"children":15830},{"style":411},[15831],{"type":62,"value":5083},{"type":56,"tag":382,"props":15833,"children":15834},{"style":411},[15835],{"type":62,"value":1930},{"type":56,"tag":382,"props":15837,"children":15838},{"style":405},[15839],{"type":62,"value":5226},{"type":56,"tag":382,"props":15841,"children":15842},{"style":411},[15843],{"type":62,"value":1940},{"type":56,"tag":382,"props":15845,"children":15846},{"style":411},[15847],{"type":62,"value":5126},{"type":56,"tag":382,"props":15849,"children":15850},{"style":411},[15851],{"type":62,"value":1930},{"type":56,"tag":382,"props":15853,"children":15854},{"style":405},[15855],{"type":62,"value":15856},"degraded",{"type":56,"tag":382,"props":15858,"children":15859},{"style":411},[15860],{"type":62,"value":1940},{"type":56,"tag":382,"props":15862,"children":15863},{"style":411},[15864],{"type":62,"value":1639},{"type":56,"tag":382,"props":15866,"children":15867},{"style":531},[15868],{"type":62,"value":15578},{"type":56,"tag":382,"props":15870,"children":15871},{"style":411},[15872],{"type":62,"value":3580},{"type":56,"tag":382,"props":15874,"children":15875},{"style":1884},[15876],{"type":62,"value":782},{"type":56,"tag":382,"props":15878,"children":15879},{"style":411},[15880],{"type":62,"value":2195},{"type":56,"tag":382,"props":15882,"children":15883},{"class":384,"line":1822},[15884,15888,15892],{"type":56,"tag":382,"props":15885,"children":15886},{"style":411},[15887],{"type":62,"value":2179},{"type":56,"tag":382,"props":15889,"children":15890},{"style":531},[15891],{"type":62,"value":782},{"type":56,"tag":382,"props":15893,"children":15894},{"style":411},[15895],{"type":62,"value":2195},{"type":56,"tag":82,"props":15897,"children":15899},{"id":15898},"graceful-shutdown",[15900],{"type":62,"value":15901},"Graceful Shutdown",{"type":56,"tag":370,"props":15903,"children":15905},{"className":1567,"code":15904,"language":1569,"meta":375,"style":375},"process.on('SIGTERM', async () => {\n  logger.info('SIGTERM received');\n  server.close();              \u002F\u002F stop new connections\n  await drainConnections();    \u002F\u002F finish in-flight\n  await closeDatabase();\n  process.exit(0);\n});\n",[15906],{"type":56,"tag":378,"props":15907,"children":15908},{"__ignoreMap":375},[15909,15962,16002,16031,16056,16076,16110],{"type":56,"tag":382,"props":15910,"children":15911},{"class":384,"line":385},[15912,15917,15921,15925,15929,15933,15938,15942,15946,15950,15954,15958],{"type":56,"tag":382,"props":15913,"children":15914},{"style":531},[15915],{"type":62,"value":15916},"process",{"type":56,"tag":382,"props":15918,"children":15919},{"style":411},[15920],{"type":62,"value":1906},{"type":56,"tag":382,"props":15922,"children":15923},{"style":399},[15924],{"type":62,"value":12125},{"type":56,"tag":382,"props":15926,"children":15927},{"style":531},[15928],{"type":62,"value":1994},{"type":56,"tag":382,"props":15930,"children":15931},{"style":411},[15932],{"type":62,"value":1940},{"type":56,"tag":382,"props":15934,"children":15935},{"style":405},[15936],{"type":62,"value":15937},"SIGTERM",{"type":56,"tag":382,"props":15939,"children":15940},{"style":411},[15941],{"type":62,"value":1940},{"type":56,"tag":382,"props":15943,"children":15944},{"style":411},[15945],{"type":62,"value":1639},{"type":56,"tag":382,"props":15947,"children":15948},{"style":1579},[15949],{"type":62,"value":10396},{"type":56,"tag":382,"props":15951,"children":15952},{"style":411},[15953],{"type":62,"value":6517},{"type":56,"tag":382,"props":15955,"children":15956},{"style":1579},[15957],{"type":62,"value":3219},{"type":56,"tag":382,"props":15959,"children":15960},{"style":411},[15961],{"type":62,"value":1592},{"type":56,"tag":382,"props":15963,"children":15964},{"class":384,"line":395},[15965,15969,15973,15977,15981,15985,15990,15994,15998],{"type":56,"tag":382,"props":15966,"children":15967},{"style":531},[15968],{"type":62,"value":3470},{"type":56,"tag":382,"props":15970,"children":15971},{"style":411},[15972],{"type":62,"value":1906},{"type":56,"tag":382,"props":15974,"children":15975},{"style":399},[15976],{"type":62,"value":9035},{"type":56,"tag":382,"props":15978,"children":15979},{"style":1884},[15980],{"type":62,"value":1994},{"type":56,"tag":382,"props":15982,"children":15983},{"style":411},[15984],{"type":62,"value":1940},{"type":56,"tag":382,"props":15986,"children":15987},{"style":405},[15988],{"type":62,"value":15989},"SIGTERM received",{"type":56,"tag":382,"props":15991,"children":15992},{"style":411},[15993],{"type":62,"value":1940},{"type":56,"tag":382,"props":15995,"children":15996},{"style":1884},[15997],{"type":62,"value":782},{"type":56,"tag":382,"props":15999,"children":16000},{"style":411},[16001],{"type":62,"value":2195},{"type":56,"tag":382,"props":16003,"children":16004},{"class":384,"line":433},[16005,16010,16014,16018,16022,16026],{"type":56,"tag":382,"props":16006,"children":16007},{"style":531},[16008],{"type":62,"value":16009},"  server",{"type":56,"tag":382,"props":16011,"children":16012},{"style":411},[16013],{"type":62,"value":1906},{"type":56,"tag":382,"props":16015,"children":16016},{"style":399},[16017],{"type":62,"value":12138},{"type":56,"tag":382,"props":16019,"children":16020},{"style":1884},[16021],{"type":62,"value":3955},{"type":56,"tag":382,"props":16023,"children":16024},{"style":411},[16025],{"type":62,"value":2373},{"type":56,"tag":382,"props":16027,"children":16028},{"style":389},[16029],{"type":62,"value":16030},"              \u002F\u002F stop new connections\n",{"type":56,"tag":382,"props":16032,"children":16033},{"class":384,"line":442},[16034,16038,16043,16047,16051],{"type":56,"tag":382,"props":16035,"children":16036},{"style":2182},[16037],{"type":62,"value":4351},{"type":56,"tag":382,"props":16039,"children":16040},{"style":399},[16041],{"type":62,"value":16042}," drainConnections",{"type":56,"tag":382,"props":16044,"children":16045},{"style":1884},[16046],{"type":62,"value":3955},{"type":56,"tag":382,"props":16048,"children":16049},{"style":411},[16050],{"type":62,"value":2373},{"type":56,"tag":382,"props":16052,"children":16053},{"style":389},[16054],{"type":62,"value":16055},"    \u002F\u002F finish in-flight\n",{"type":56,"tag":382,"props":16057,"children":16058},{"class":384,"line":1677},[16059,16063,16068,16072],{"type":56,"tag":382,"props":16060,"children":16061},{"style":2182},[16062],{"type":62,"value":4351},{"type":56,"tag":382,"props":16064,"children":16065},{"style":399},[16066],{"type":62,"value":16067}," closeDatabase",{"type":56,"tag":382,"props":16069,"children":16070},{"style":1884},[16071],{"type":62,"value":3955},{"type":56,"tag":382,"props":16073,"children":16074},{"style":411},[16075],{"type":62,"value":2195},{"type":56,"tag":382,"props":16077,"children":16078},{"class":384,"line":1691},[16079,16084,16088,16093,16097,16102,16106],{"type":56,"tag":382,"props":16080,"children":16081},{"style":531},[16082],{"type":62,"value":16083},"  process",{"type":56,"tag":382,"props":16085,"children":16086},{"style":411},[16087],{"type":62,"value":1906},{"type":56,"tag":382,"props":16089,"children":16090},{"style":399},[16091],{"type":62,"value":16092},"exit",{"type":56,"tag":382,"props":16094,"children":16095},{"style":1884},[16096],{"type":62,"value":1994},{"type":56,"tag":382,"props":16098,"children":16099},{"style":1947},[16100],{"type":62,"value":16101},"0",{"type":56,"tag":382,"props":16103,"children":16104},{"style":1884},[16105],{"type":62,"value":782},{"type":56,"tag":382,"props":16107,"children":16108},{"style":411},[16109],{"type":62,"value":2195},{"type":56,"tag":382,"props":16111,"children":16112},{"class":384,"line":1813},[16113,16117,16121],{"type":56,"tag":382,"props":16114,"children":16115},{"style":411},[16116],{"type":62,"value":2179},{"type":56,"tag":382,"props":16118,"children":16119},{"style":531},[16120],{"type":62,"value":782},{"type":56,"tag":382,"props":16122,"children":16123},{"style":411},[16124],{"type":62,"value":2195},{"type":56,"tag":82,"props":16126,"children":16128},{"id":16127},"security-checklist",[16129],{"type":62,"value":16130},"Security Checklist",{"type":56,"tag":370,"props":16132,"children":16135},{"className":16133,"code":16134,"language":62},[1424],"✅ CORS: explicit origins (never '*' in production)\n✅ Security headers (helmet \u002F equivalent)\n✅ Rate limiting on public endpoints\n✅ Input validation on ALL endpoints (trust nothing)\n✅ HTTPS enforced\n❌ Never expose internal errors to clients\n",[16136],{"type":56,"tag":378,"props":16137,"children":16138},{"__ignoreMap":375},[16139],{"type":62,"value":16134},{"type":56,"tag":621,"props":16141,"children":16142},{},[],{"type":56,"tag":65,"props":16144,"children":16146},{"id":16145},"anti-patterns",[16147],{"type":62,"value":16148},"Anti-Patterns",{"type":56,"tag":175,"props":16150,"children":16151},{},[16152,16173],{"type":56,"tag":179,"props":16153,"children":16154},{},[16155],{"type":56,"tag":183,"props":16156,"children":16157},{},[16158,16163,16168],{"type":56,"tag":187,"props":16159,"children":16160},{},[16161],{"type":62,"value":16162},"#",{"type":56,"tag":187,"props":16164,"children":16165},{},[16166],{"type":62,"value":16167},"❌ Don't",{"type":56,"tag":187,"props":16169,"children":16170},{},[16171],{"type":62,"value":16172},"✅ Do Instead",{"type":56,"tag":203,"props":16174,"children":16175},{},[16176,16194,16218,16242,16265,16283,16301,16319,16347,16365,16383,16408,16426,16444,16462,16480,16498,16516],{"type":56,"tag":183,"props":16177,"children":16178},{},[16179,16184,16189],{"type":56,"tag":210,"props":16180,"children":16181},{},[16182],{"type":62,"value":16183},"1",{"type":56,"tag":210,"props":16185,"children":16186},{},[16187],{"type":62,"value":16188},"Business logic in routes\u002Fcontrollers",{"type":56,"tag":210,"props":16190,"children":16191},{},[16192],{"type":62,"value":16193},"Move to service layer",{"type":56,"tag":183,"props":16195,"children":16196},{},[16197,16202,16213],{"type":56,"tag":210,"props":16198,"children":16199},{},[16200],{"type":62,"value":16201},"2",{"type":56,"tag":210,"props":16203,"children":16204},{},[16205,16211],{"type":56,"tag":378,"props":16206,"children":16208},{"className":16207},[],[16209],{"type":62,"value":16210},"process.env",{"type":62,"value":16212}," scattered everywhere",{"type":56,"tag":210,"props":16214,"children":16215},{},[16216],{"type":62,"value":16217},"Centralized typed config",{"type":56,"tag":183,"props":16219,"children":16220},{},[16221,16226,16237],{"type":56,"tag":210,"props":16222,"children":16223},{},[16224],{"type":62,"value":16225},"3",{"type":56,"tag":210,"props":16227,"children":16228},{},[16229,16235],{"type":56,"tag":378,"props":16230,"children":16232},{"className":16231},[],[16233],{"type":62,"value":16234},"console.log",{"type":62,"value":16236}," for logging",{"type":56,"tag":210,"props":16238,"children":16239},{},[16240],{"type":62,"value":16241},"Structured JSON logger",{"type":56,"tag":183,"props":16243,"children":16244},{},[16245,16250,16261],{"type":56,"tag":210,"props":16246,"children":16247},{},[16248],{"type":62,"value":16249},"4",{"type":56,"tag":210,"props":16251,"children":16252},{},[16253,16255],{"type":62,"value":16254},"Generic ",{"type":56,"tag":378,"props":16256,"children":16258},{"className":16257},[],[16259],{"type":62,"value":16260},"Error('oops')",{"type":56,"tag":210,"props":16262,"children":16263},{},[16264],{"type":62,"value":772},{"type":56,"tag":183,"props":16266,"children":16267},{},[16268,16273,16278],{"type":56,"tag":210,"props":16269,"children":16270},{},[16271],{"type":62,"value":16272},"5",{"type":56,"tag":210,"props":16274,"children":16275},{},[16276],{"type":62,"value":16277},"Direct DB calls in controllers",{"type":56,"tag":210,"props":16279,"children":16280},{},[16281],{"type":62,"value":16282},"Repository pattern",{"type":56,"tag":183,"props":16284,"children":16285},{},[16286,16291,16296],{"type":56,"tag":210,"props":16287,"children":16288},{},[16289],{"type":62,"value":16290},"6",{"type":56,"tag":210,"props":16292,"children":16293},{},[16294],{"type":62,"value":16295},"No input validation",{"type":56,"tag":210,"props":16297,"children":16298},{},[16299],{"type":62,"value":16300},"Validate at boundary (Zod\u002FPydantic)",{"type":56,"tag":183,"props":16302,"children":16303},{},[16304,16309,16314],{"type":56,"tag":210,"props":16305,"children":16306},{},[16307],{"type":62,"value":16308},"7",{"type":56,"tag":210,"props":16310,"children":16311},{},[16312],{"type":62,"value":16313},"Catching errors silently",{"type":56,"tag":210,"props":16315,"children":16316},{},[16317],{"type":62,"value":16318},"Log + rethrow or return error",{"type":56,"tag":183,"props":16320,"children":16321},{},[16322,16327,16332],{"type":56,"tag":210,"props":16323,"children":16324},{},[16325],{"type":62,"value":16326},"8",{"type":56,"tag":210,"props":16328,"children":16329},{},[16330],{"type":62,"value":16331},"No health check endpoints",{"type":56,"tag":210,"props":16333,"children":16334},{},[16335,16340,16342],{"type":56,"tag":378,"props":16336,"children":16338},{"className":16337},[],[16339],{"type":62,"value":886},{"type":62,"value":16341}," + ",{"type":56,"tag":378,"props":16343,"children":16345},{"className":16344},[],[16346],{"type":62,"value":894},{"type":56,"tag":183,"props":16348,"children":16349},{},[16350,16355,16360],{"type":56,"tag":210,"props":16351,"children":16352},{},[16353],{"type":62,"value":16354},"9",{"type":56,"tag":210,"props":16356,"children":16357},{},[16358],{"type":62,"value":16359},"Hardcoded config\u002Fsecrets",{"type":56,"tag":210,"props":16361,"children":16362},{},[16363],{"type":62,"value":16364},"Environment variables",{"type":56,"tag":183,"props":16366,"children":16367},{},[16368,16373,16378],{"type":56,"tag":210,"props":16369,"children":16370},{},[16371],{"type":62,"value":16372},"10",{"type":56,"tag":210,"props":16374,"children":16375},{},[16376],{"type":62,"value":16377},"No graceful shutdown",{"type":56,"tag":210,"props":16379,"children":16380},{},[16381],{"type":62,"value":16382},"Handle SIGTERM properly",{"type":56,"tag":183,"props":16384,"children":16385},{},[16386,16391,16396],{"type":56,"tag":210,"props":16387,"children":16388},{},[16389],{"type":62,"value":16390},"11",{"type":56,"tag":210,"props":16392,"children":16393},{},[16394],{"type":62,"value":16395},"Hardcode API URL in frontend",{"type":56,"tag":210,"props":16397,"children":16398},{},[16399,16401,16407],{"type":62,"value":16400},"Environment variable (",{"type":56,"tag":378,"props":16402,"children":16404},{"className":16403},[],[16405],{"type":62,"value":16406},"NEXT_PUBLIC_API_URL",{"type":62,"value":782},{"type":56,"tag":183,"props":16409,"children":16410},{},[16411,16416,16421],{"type":56,"tag":210,"props":16412,"children":16413},{},[16414],{"type":62,"value":16415},"12",{"type":56,"tag":210,"props":16417,"children":16418},{},[16419],{"type":62,"value":16420},"Store JWT in localStorage",{"type":56,"tag":210,"props":16422,"children":16423},{},[16424],{"type":62,"value":16425},"Memory + httpOnly refresh cookie",{"type":56,"tag":183,"props":16427,"children":16428},{},[16429,16434,16439],{"type":56,"tag":210,"props":16430,"children":16431},{},[16432],{"type":62,"value":16433},"13",{"type":56,"tag":210,"props":16435,"children":16436},{},[16437],{"type":62,"value":16438},"Show raw API errors to users",{"type":56,"tag":210,"props":16440,"children":16441},{},[16442],{"type":62,"value":16443},"Map to human-readable messages",{"type":56,"tag":183,"props":16445,"children":16446},{},[16447,16452,16457],{"type":56,"tag":210,"props":16448,"children":16449},{},[16450],{"type":62,"value":16451},"14",{"type":56,"tag":210,"props":16453,"children":16454},{},[16455],{"type":62,"value":16456},"Retry 4xx errors",{"type":56,"tag":210,"props":16458,"children":16459},{},[16460],{"type":62,"value":16461},"Only retry 5xx (server failures)",{"type":56,"tag":183,"props":16463,"children":16464},{},[16465,16470,16475],{"type":56,"tag":210,"props":16466,"children":16467},{},[16468],{"type":62,"value":16469},"15",{"type":56,"tag":210,"props":16471,"children":16472},{},[16473],{"type":62,"value":16474},"Skip loading states",{"type":56,"tag":210,"props":16476,"children":16477},{},[16478],{"type":62,"value":16479},"Skeleton\u002Fspinner while fetching",{"type":56,"tag":183,"props":16481,"children":16482},{},[16483,16488,16493],{"type":56,"tag":210,"props":16484,"children":16485},{},[16486],{"type":62,"value":16487},"16",{"type":56,"tag":210,"props":16489,"children":16490},{},[16491],{"type":62,"value":16492},"Upload large files through API server",{"type":56,"tag":210,"props":16494,"children":16495},{},[16496],{"type":62,"value":16497},"Presigned URL → direct to S3",{"type":56,"tag":183,"props":16499,"children":16500},{},[16501,16506,16511],{"type":56,"tag":210,"props":16502,"children":16503},{},[16504],{"type":62,"value":16505},"17",{"type":56,"tag":210,"props":16507,"children":16508},{},[16509],{"type":62,"value":16510},"Poll for real-time data",{"type":56,"tag":210,"props":16512,"children":16513},{},[16514],{"type":62,"value":16515},"SSE or WebSocket",{"type":56,"tag":183,"props":16517,"children":16518},{},[16519,16524,16529],{"type":56,"tag":210,"props":16520,"children":16521},{},[16522],{"type":62,"value":16523},"18",{"type":56,"tag":210,"props":16525,"children":16526},{},[16527],{"type":62,"value":16528},"Duplicate types frontend + backend",{"type":56,"tag":210,"props":16530,"children":16531},{},[16532],{"type":62,"value":16533},"Shared types, tRPC, or OpenAPI codegen",{"type":56,"tag":621,"props":16535,"children":16536},{},[],{"type":56,"tag":65,"props":16538,"children":16540},{"id":16539},"common-issues",[16541],{"type":62,"value":16542},"Common Issues",{"type":56,"tag":82,"props":16544,"children":16546},{"id":16545},"issue-1-where-does-this-business-rule-go",[16547],{"type":62,"value":16548},"Issue 1: \"Where does this business rule go?\"",{"type":56,"tag":72,"props":16550,"children":16551},{},[16552,16557],{"type":56,"tag":76,"props":16553,"children":16554},{},[16555],{"type":62,"value":16556},"Rule:",{"type":62,"value":16558}," If it involves HTTP (request parsing, status codes, headers) → controller. If it involves business decisions (pricing, permissions, rules) → service. If it touches the database → repository.",{"type":56,"tag":82,"props":16560,"children":16562},{"id":16561},"issue-2-service-is-getting-too-big",[16563],{"type":62,"value":16564},"Issue 2: \"Service is getting too big\"",{"type":56,"tag":72,"props":16566,"children":16567},{},[16568,16573],{"type":56,"tag":76,"props":16569,"children":16570},{},[16571],{"type":62,"value":16572},"Symptom:",{"type":62,"value":16574}," One service file > 500 lines with 20+ methods.",{"type":56,"tag":72,"props":16576,"children":16577},{},[16578,16583,16585,16591,16593,16599,16600,16606,16607,16613],{"type":56,"tag":76,"props":16579,"children":16580},{},[16581],{"type":62,"value":16582},"Fix:",{"type":62,"value":16584}," Split by sub-domain. ",{"type":56,"tag":378,"props":16586,"children":16588},{"className":16587},[],[16589],{"type":62,"value":16590},"OrderService",{"type":62,"value":16592}," → ",{"type":56,"tag":378,"props":16594,"children":16596},{"className":16595},[],[16597],{"type":62,"value":16598},"OrderCreationService",{"type":62,"value":16341},{"type":56,"tag":378,"props":16601,"children":16603},{"className":16602},[],[16604],{"type":62,"value":16605},"OrderFulfillmentService",{"type":62,"value":16341},{"type":56,"tag":378,"props":16608,"children":16610},{"className":16609},[],[16611],{"type":62,"value":16612},"OrderQueryService",{"type":62,"value":16614},". Each focused on one workflow.",{"type":56,"tag":82,"props":16616,"children":16618},{"id":16617},"issue-3-tests-are-slow-because-they-hit-the-database",[16619],{"type":62,"value":16620},"Issue 3: \"Tests are slow because they hit the database\"",{"type":56,"tag":72,"props":16622,"children":16623},{},[16624,16628],{"type":56,"tag":76,"props":16625,"children":16626},{},[16627],{"type":62,"value":16582},{"type":62,"value":16629}," Unit tests mock the repository layer (fast). Integration tests use test containers or transaction rollback (real DB, still fast). Never mock the service layer in integration tests.",{"type":56,"tag":621,"props":16631,"children":16632},{},[],{"type":56,"tag":65,"props":16634,"children":16636},{"id":16635},"reference-documents",[16637],{"type":62,"value":16638},"Reference Documents",{"type":56,"tag":72,"props":16640,"children":16641},{},[16642],{"type":62,"value":16643},"This skill includes deep-dive references for specialized topics. Read the relevant reference when you need detailed guidance.",{"type":56,"tag":175,"props":16645,"children":16646},{},[16647,16661],{"type":56,"tag":179,"props":16648,"children":16649},{},[16650],{"type":56,"tag":183,"props":16651,"children":16652},{},[16653,16657],{"type":56,"tag":187,"props":16654,"children":16655},{},[16656],{"type":62,"value":1121},{"type":56,"tag":187,"props":16658,"children":16659},{},[16660],{"type":62,"value":201},{"type":56,"tag":203,"props":16662,"children":16663},{},[16664,16680,16696,16712,16728,16743,16758,16773],{"type":56,"tag":183,"props":16665,"children":16666},{},[16667,16672],{"type":56,"tag":210,"props":16668,"children":16669},{},[16670],{"type":62,"value":16671},"Write backend tests (unit, integration, e2e, contract, performance)",{"type":56,"tag":210,"props":16673,"children":16674},{},[16675],{"type":56,"tag":224,"props":16676,"children":16678},{"href":16677},"references\u002Ftesting-strategy.md",[16679],{"type":62,"value":16677},{"type":56,"tag":183,"props":16681,"children":16682},{},[16683,16688],{"type":56,"tag":210,"props":16684,"children":16685},{},[16686],{"type":62,"value":16687},"Validate a release before deployment (6-gate checklist)",{"type":56,"tag":210,"props":16689,"children":16690},{},[16691],{"type":56,"tag":224,"props":16692,"children":16694},{"href":16693},"references\u002Frelease-checklist.md",[16695],{"type":62,"value":16693},{"type":56,"tag":183,"props":16697,"children":16698},{},[16699,16704],{"type":56,"tag":210,"props":16700,"children":16701},{},[16702],{"type":62,"value":16703},"Choose a tech stack (language, framework, database, infra)",{"type":56,"tag":210,"props":16705,"children":16706},{},[16707],{"type":56,"tag":224,"props":16708,"children":16710},{"href":16709},"references\u002Ftechnology-selection.md",[16711],{"type":62,"value":16709},{"type":56,"tag":183,"props":16713,"children":16714},{},[16715,16720],{"type":56,"tag":210,"props":16716,"children":16717},{},[16718],{"type":62,"value":16719},"Build with Django \u002F DRF (models, views, serializers, admin)",{"type":56,"tag":210,"props":16721,"children":16722},{},[16723],{"type":56,"tag":224,"props":16724,"children":16726},{"href":16725},"references\u002Fdjango-best-practices.md",[16727],{"type":62,"value":16725},{"type":56,"tag":183,"props":16729,"children":16730},{},[16731,16736],{"type":56,"tag":210,"props":16732,"children":16733},{},[16734],{"type":62,"value":16735},"Design REST\u002FGraphQL\u002FgRPC endpoints (URLs, status codes, pagination)",{"type":56,"tag":210,"props":16737,"children":16738},{},[16739],{"type":56,"tag":224,"props":16740,"children":16741},{"href":1359},[16742],{"type":62,"value":1359},{"type":56,"tag":183,"props":16744,"children":16745},{},[16746,16751],{"type":56,"tag":210,"props":16747,"children":16748},{},[16749],{"type":62,"value":16750},"Design database schema, indexes, migrations, multi-tenancy",{"type":56,"tag":210,"props":16752,"children":16753},{},[16754],{"type":56,"tag":224,"props":16755,"children":16756},{"href":1376},[16757],{"type":62,"value":1376},{"type":56,"tag":183,"props":16759,"children":16760},{},[16761,16766],{"type":56,"tag":210,"props":16762,"children":16763},{},[16764],{"type":62,"value":16765},"Auth flow (JWT bearer, token refresh, Next.js SSR, RBAC, middleware order)",{"type":56,"tag":210,"props":16767,"children":16768},{},[16769],{"type":56,"tag":224,"props":16770,"children":16771},{"href":1393},[16772],{"type":62,"value":1393},{"type":56,"tag":183,"props":16774,"children":16775},{},[16776,16781],{"type":56,"tag":210,"props":16777,"children":16778},{},[16779],{"type":62,"value":16780},"CORS config, env vars per environment, common CORS issues",{"type":56,"tag":210,"props":16782,"children":16783},{},[16784],{"type":56,"tag":224,"props":16785,"children":16786},{"href":1409},[16787],{"type":62,"value":1409},{"type":56,"tag":16789,"props":16790,"children":16791},"style",{},[16792],{"type":62,"value":16793},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":16795,"total":5199},[16796,16818,16834,16853,16868,16888,16902],{"slug":16797,"name":16797,"fn":16798,"description":16799,"org":16800,"tags":16801,"stars":29,"repoUrl":30,"updatedAt":16817},"android-native-dev","develop Android native applications","Android native application development and UI design guide. Covers Material Design 3, Kotlin\u002FCompose development, project configuration, accessibility, and build troubleshooting. Read this before Android native application development.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[16802,16805,16808,16811,16814],{"name":16803,"slug":16804,"type":16},"Accessibility","accessibility",{"name":16806,"slug":16807,"type":16},"Android","android",{"name":16809,"slug":16810,"type":16},"Kotlin","kotlin",{"name":16812,"slug":16813,"type":16},"Mobile","mobile",{"name":16815,"slug":16816,"type":16},"UI Components","ui-components","2026-07-13T06:16:54.247834",{"slug":16819,"name":16819,"fn":16820,"description":16821,"org":16822,"tags":16823,"stars":29,"repoUrl":30,"updatedAt":16833},"buddy-sings","generate singing performances for AI companions","Use when user wants their Claude Code pet (\u002Fbuddy) to sing a song. Triggers on any request that combines the concept of their Claude Code buddy, pet, or companion with singing or music. Supports multilingual triggers — match equivalent phrases in any language.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[16824,16827,16830],{"name":16825,"slug":16826,"type":16},"Agents","agents",{"name":16828,"slug":16829,"type":16},"Audio","audio",{"name":16831,"slug":16832,"type":16},"Creative","creative","2026-07-13T06:16:35.130644",{"slug":16835,"name":16835,"fn":16836,"description":16837,"org":16838,"tags":16839,"stars":29,"repoUrl":30,"updatedAt":16852},"color-font-skill","select color palettes and font pairings","Choose presentation-ready color palettes and font pairings for PPT\u002Fdesign tasks. Use when users ask for visual theme choices, brand-safe palettes, or font recommendations. Triggers include: 配色, 色板, 字体, color palette, font, PPT配色, 字体搭配.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[16840,16843,16846,16849],{"name":16841,"slug":16842,"type":16},"Design","design",{"name":16844,"slug":16845,"type":16},"Presentations","presentations",{"name":16847,"slug":16848,"type":16},"Themes","themes",{"name":16850,"slug":16851,"type":16},"Typography","typography","2026-07-13T06:17:02.785587",{"slug":16854,"name":16854,"fn":16855,"description":16856,"org":16857,"tags":16858,"stars":29,"repoUrl":30,"updatedAt":16867},"design-style-skill","select visual design systems for presentations","Select a consistent visual design system for PPT slides using radius\u002Fspacing style recipes. Use when users ask for overall style direction or component styling consistency. Includes Sharp\u002FSoft\u002FRounded\u002FPill recipes, component mappings, typography\u002Fspacing rules, and mixing guidance. Triggers: 风格, style, radius, spacing, 圆角, 间距, PPT风格, 视觉风格, design style, component style.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[16859,16860,16863,16866],{"name":16841,"slug":16842,"type":16},{"name":16861,"slug":16862,"type":16},"Design System","design-system",{"name":16864,"slug":16865,"type":16},"PowerPoint","powerpoint",{"name":16844,"slug":16845,"type":16},"2026-07-13T06:17:10.398389",{"slug":16869,"name":16869,"fn":16870,"description":16871,"org":16872,"tags":16873,"stars":29,"repoUrl":30,"updatedAt":16887},"flutter-dev","build cross-platform apps with Flutter","Flutter cross-platform development guide covering widget patterns, Riverpod\u002FBloc state management, GoRouter navigation, performance optimization, and platform-specific implementations. Includes const optimization, responsive layouts, testing strategies, and DevTools profiling.\nUse when: building Flutter apps, implementing state management (Riverpod\u002FBloc), setting up GoRouter navigation, creating custom widgets, optimizing performance, writing widget tests, cross-platform development.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[16874,16877,16880,16881,16884],{"name":16875,"slug":16876,"type":16},"Dart","dart",{"name":16878,"slug":16879,"type":16},"Flutter","flutter",{"name":16812,"slug":16813,"type":16},{"name":16882,"slug":16883,"type":16},"Performance","performance",{"name":16885,"slug":16886,"type":16},"State Management","state-management","2026-07-13T06:16:36.626679",{"slug":16889,"name":16889,"fn":16890,"description":16891,"org":16892,"tags":16893,"stars":29,"repoUrl":30,"updatedAt":16901},"frontend-dev","build visually striking frontend web pages","Full-stack frontend development combining premium UI design, cinematic animations,\nAI-generated media assets, persuasive copywriting, and visual art. Builds complete,\nvisually striking web pages with real media, advanced motion, and compelling copy.\nUse when: building landing pages, marketing sites, product pages, dashboards,\ngenerating media assets (image\u002Fvideo\u002Faudio\u002Fmusic), writing conversion copy,\ncreating generative art, or implementing cinematic scroll animations.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[16894,16897,16898,16899,16900],{"name":16895,"slug":16896,"type":16},"Animation","animation",{"name":16831,"slug":16832,"type":16},{"name":16841,"slug":16842,"type":16},{"name":27,"slug":28,"type":16},{"name":24,"slug":25,"type":16},"2026-07-13T06:16:39.108827",{"slug":4,"name":4,"fn":5,"description":6,"org":16903,"tags":16904,"stars":29,"repoUrl":30,"updatedAt":31},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[16905,16906,16907,16908,16909],{"name":14,"slug":15,"type":16},{"name":27,"slug":28,"type":16},{"name":18,"slug":19,"type":16},{"name":21,"slug":22,"type":16},{"name":24,"slug":25,"type":16},{"items":16911,"total":6137},[16912,16920,16926,16933,16940,16948,16956,16964,16979,16995,17014,17024],{"slug":16797,"name":16797,"fn":16798,"description":16799,"org":16913,"tags":16914,"stars":29,"repoUrl":30,"updatedAt":16817},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[16915,16916,16917,16918,16919],{"name":16803,"slug":16804,"type":16},{"name":16806,"slug":16807,"type":16},{"name":16809,"slug":16810,"type":16},{"name":16812,"slug":16813,"type":16},{"name":16815,"slug":16816,"type":16},{"slug":16819,"name":16819,"fn":16820,"description":16821,"org":16921,"tags":16922,"stars":29,"repoUrl":30,"updatedAt":16833},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[16923,16924,16925],{"name":16825,"slug":16826,"type":16},{"name":16828,"slug":16829,"type":16},{"name":16831,"slug":16832,"type":16},{"slug":16835,"name":16835,"fn":16836,"description":16837,"org":16927,"tags":16928,"stars":29,"repoUrl":30,"updatedAt":16852},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[16929,16930,16931,16932],{"name":16841,"slug":16842,"type":16},{"name":16844,"slug":16845,"type":16},{"name":16847,"slug":16848,"type":16},{"name":16850,"slug":16851,"type":16},{"slug":16854,"name":16854,"fn":16855,"description":16856,"org":16934,"tags":16935,"stars":29,"repoUrl":30,"updatedAt":16867},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[16936,16937,16938,16939],{"name":16841,"slug":16842,"type":16},{"name":16861,"slug":16862,"type":16},{"name":16864,"slug":16865,"type":16},{"name":16844,"slug":16845,"type":16},{"slug":16869,"name":16869,"fn":16870,"description":16871,"org":16941,"tags":16942,"stars":29,"repoUrl":30,"updatedAt":16887},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[16943,16944,16945,16946,16947],{"name":16875,"slug":16876,"type":16},{"name":16878,"slug":16879,"type":16},{"name":16812,"slug":16813,"type":16},{"name":16882,"slug":16883,"type":16},{"name":16885,"slug":16886,"type":16},{"slug":16889,"name":16889,"fn":16890,"description":16891,"org":16949,"tags":16950,"stars":29,"repoUrl":30,"updatedAt":16901},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[16951,16952,16953,16954,16955],{"name":16895,"slug":16896,"type":16},{"name":16831,"slug":16832,"type":16},{"name":16841,"slug":16842,"type":16},{"name":27,"slug":28,"type":16},{"name":24,"slug":25,"type":16},{"slug":4,"name":4,"fn":5,"description":6,"org":16957,"tags":16958,"stars":29,"repoUrl":30,"updatedAt":31},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[16959,16960,16961,16962,16963],{"name":14,"slug":15,"type":16},{"name":27,"slug":28,"type":16},{"name":18,"slug":19,"type":16},{"name":21,"slug":22,"type":16},{"name":24,"slug":25,"type":16},{"slug":16965,"name":16965,"fn":16966,"description":16967,"org":16968,"tags":16969,"stars":29,"repoUrl":30,"updatedAt":16978},"gif-sticker-maker","create animated GIF stickers from photos","Convert photos (people, pets, objects, logos) into 4 animated GIF stickers with captions.\nUse when: user wants to create cartoon stickers, GIF expressions, emoji packs, animated avatars,\nor convert photos to Funko Pop \u002F Pop Mart blind box style animations.\nTriggers: sticker, GIF, cartoon, emoji, expression pack, avatar animation.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[16970,16971,16972,16975],{"name":16895,"slug":16896,"type":16},{"name":16831,"slug":16832,"type":16},{"name":16973,"slug":16974,"type":16},"Images","images",{"name":16976,"slug":16977,"type":16},"Media","media","2026-07-13T06:16:51.74461",{"slug":16980,"name":16980,"fn":16981,"description":16982,"org":16983,"tags":16984,"stars":29,"repoUrl":30,"updatedAt":16994},"ios-application-dev","develop iOS applications with SwiftUI and UIKit","iOS application development guide covering UIKit, SnapKit, and SwiftUI. Includes touch targets, safe areas, navigation patterns, Dynamic Type, Dark Mode, accessibility, collection views, common UI components, and SwiftUI design guidelines. For detailed references on specific topics, see the reference files.\nUse when: developing iOS apps, implementing UI, reviewing iOS code, working with UIKit\u002FSnapKit\u002FSwiftUI layouts, building iPhone interfaces, Swift mobile development, Apple HIG compliance, iOS accessibility implementation.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[16985,16986,16989,16990,16993],{"name":16803,"slug":16804,"type":16},{"name":16987,"slug":16988,"type":16},"iOS","ios",{"name":16812,"slug":16813,"type":16},{"name":16991,"slug":16992,"type":16},"SwiftUI","swiftui",{"name":16815,"slug":16816,"type":16},"2026-07-13T06:16:55.686092",{"slug":16996,"name":16996,"fn":16997,"description":16998,"org":16999,"tags":17000,"stars":29,"repoUrl":30,"updatedAt":17013},"minimax-docx","create and edit DOCX documents","Professional DOCX document creation, editing, and formatting using OpenXML SDK (.NET). Three pipelines: (A) create new documents from scratch, (B) fill\u002Fedit content in existing documents, (C) apply template formatting with XSD validation gate-check. MUST use this skill whenever the user wants to produce, modify, or format a Word document — including when they say \"write a report\", \"draft a proposal\", \"make a contract\", \"fill in this form\", \"reformat to match this template\", or any task whose final output is a .docx file. Even if the user doesn't mention \"docx\" explicitly, if the task implies a printable\u002Fformal document, use this skill.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[17001,17004,17007,17010],{"name":17002,"slug":17003,"type":16},"Documents","documents",{"name":17005,"slug":17006,"type":16},"DOCX","docx",{"name":17008,"slug":17009,"type":16},"Office","office",{"name":17011,"slug":17012,"type":16},"Templates","templates","2026-07-13T06:16:40.461868",{"slug":17015,"name":17015,"fn":17016,"description":17017,"org":17018,"tags":17019,"stars":29,"repoUrl":30,"updatedAt":17023},"minimax-music-gen","generate music and audio tracks","Use when user wants to generate music, songs, or audio tracks. Triggers on any request involving music creation, song writing, lyrics generation, audio production, or covers. Also triggers when user provides lyrics and wants them turned into a song, or describes a mood\u002Fscene and wants background music. Supports multilingual triggers — match equivalent phrases in any language. Do NOT use for music playback of existing files, music theory questions, or music recommendation without generation.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[17020,17021,17022],{"name":16828,"slug":16829,"type":16},{"name":16831,"slug":16832,"type":16},{"name":16976,"slug":16977,"type":16},"2026-07-13T06:16:50.381758",{"slug":17025,"name":17025,"fn":17026,"description":17027,"org":17028,"tags":17029,"stars":29,"repoUrl":30,"updatedAt":17033},"minimax-music-playlist","generate personalized music playlists","Generate personalized music playlists by analyzing the user's music taste and generation feedback history. Triggers on any request involving playlist generation, music taste profiling, or personalized music recommendations. Supports multilingual triggers — match equivalent phrases in any language.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[17030,17031,17032],{"name":16828,"slug":16829,"type":16},{"name":16831,"slug":16832,"type":16},{"name":16976,"slug":16977,"type":16},"2026-07-13T06:16:57.002997"]