[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-encore-encore-service":3,"mdc-gut0ej-key":37,"related-org-encore-encore-service":2379,"related-repo-encore-encore-service":2552},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":12,"stars":24,"repoUrl":25,"updatedAt":26,"license":27,"forks":28,"topics":29,"repo":32,"sourceUrl":35,"mdContent":36},"encore-service","structure and organize Encore.ts services","Plan how to split an Encore.ts application into services and lay out its directory structure. Architecture and decomposition, not first-time CLI install (that's `encore-getting-started`).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},"encore","Encore","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fencore.png","encoredev",[13,17,20,21],{"name":14,"slug":15,"type":16},"Architecture","architecture","tag",{"name":18,"slug":19,"type":16},"TypeScript","typescript",{"name":9,"slug":8,"type":16},{"name":22,"slug":23,"type":16},"API Development","api-development",26,"https:\u002F\u002Fgithub.com\u002Fencoredev\u002Fskills","2026-04-06T18:09:52.318676",null,5,[30,31],"claude-code","skills",{"repoUrl":25,"stars":24,"forks":28,"topics":33,"description":34},[30,31],"Agent Skills for development with Encore.","https:\u002F\u002Fgithub.com\u002Fencoredev\u002Fskills\u002Ftree\u002FHEAD\u002Fencore\u002Fservice","---\nname: encore-service\ndescription: Plan how to split an Encore.ts application into services and lay out its directory structure. Architecture and decomposition, not first-time CLI install (that's `encore-getting-started`).\nwhen_to_use: >-\n  User is deciding monolith vs. microservices, weighing \"one service or several\", drawing service boundaries, planning a multi-service system (e.g. orders + payments + inventory + shipping), creating an `encore.service.ts`, naming directories\u002Ffolders, designing systems-of-services hierarchies, or asking for an application architecture \u002F project layout recommendation. Trigger phrases: \"lay out the directories\", \"directory structure\", \"service boundaries\", \"one service or several\", \"monolith vs microservices\", \"where to put\", \"systems of services\".\n---\n\n# Encore Service Structure\n\n## Instructions\n\n### Creating a Service\n\nEvery Encore service needs an `encore.service.ts` file:\n\n```typescript\n\u002F\u002F encore.service.ts\nimport { Service } from \"encore.dev\u002Fservice\";\n\nexport default new Service(\"my-service\");\n```\n\n### Minimal Service Structure\n\n```\nmy-service\u002F\n├── encore.service.ts    # Service definition (required)\n├── api.ts               # API endpoints\n└── db.ts                # Database (if needed)\n```\n\n## Application Patterns\n\n### Single Service (Recommended Start)\n\nBest for new projects - start simple, split later if needed:\n\n```\nmy-app\u002F\n├── package.json\n├── encore.app\n├── encore.service.ts\n├── api.ts\n├── db.ts\n└── migrations\u002F\n    └── 001_initial.up.sql\n```\n\n### Multi-Service\n\nFor distributed systems with clear domain boundaries:\n\n```\nmy-app\u002F\n├── encore.app\n├── package.json\n├── user\u002F\n│   ├── encore.service.ts\n│   ├── api.ts\n│   └── db.ts\n├── order\u002F\n│   ├── encore.service.ts\n│   ├── api.ts\n│   └── db.ts\n└── notification\u002F\n    ├── encore.service.ts\n    └── api.ts\n```\n\n### Large Application (System-based)\n\nGroup related services into systems:\n\n```\nmy-app\u002F\n├── encore.app\n├── commerce\u002F\n│   ├── order\u002F\n│   │   └── encore.service.ts\n│   ├── cart\u002F\n│   │   └── encore.service.ts\n│   └── payment\u002F\n│       └── encore.service.ts\n├── identity\u002F\n│   ├── user\u002F\n│   │   └── encore.service.ts\n│   └── auth\u002F\n│       └── encore.service.ts\n└── comms\u002F\n    ├── email\u002F\n    │   └── encore.service.ts\n    └── push\u002F\n        └── encore.service.ts\n```\n\n## Service-to-Service Calls\n\nImport other services from `~encore\u002Fclients`:\n\n```typescript\nimport { user } from \"~encore\u002Fclients\";\n\nexport const getOrderWithUser = api(\n  { method: \"GET\", path: \"\u002Forders\u002F:id\", expose: true },\n  async ({ id }): Promise\u003COrderWithUser> => {\n    const order = await getOrder(id);\n    const orderUser = await user.get({ id: order.userId });\n    return { ...order, user: orderUser };\n  }\n);\n```\n\n## When to Split Services\n\nSplit when you have:\n\n| Signal | Action |\n|--------|--------|\n| Different scaling needs | Split (e.g., auth vs analytics) |\n| Different deployment cycles | Split |\n| Clear domain boundaries | Split |\n| Shared database tables | Keep together |\n| Tightly coupled logic | Keep together |\n| Just organizing code | Use folders, not services |\n\n## Service with Middleware\n\n```typescript\nimport { Service } from \"encore.dev\u002Fservice\";\nimport { middleware } from \"encore.dev\u002Fapi\";\n\nconst loggingMiddleware = middleware(\n  { target: { all: true } },\n  async (req, next) => {\n    console.log(`Request: ${req.requestMeta?.path}`);\n    return next(req);\n  }\n);\n\nexport default new Service(\"my-service\", {\n  middlewares: [loggingMiddleware],\n});\n```\n\n### Middleware Targeting\n\nControl which endpoints middleware applies to:\n\n```typescript\n\u002F\u002F Apply to all endpoints\nmiddleware({ target: { all: true } }, handler);\n\n\u002F\u002F Apply only to authenticated endpoints\nmiddleware({ target: { auth: true } }, handler);\n\n\u002F\u002F Apply only to exposed (public) endpoints\nmiddleware({ target: { expose: true } }, handler);\n\n\u002F\u002F Apply to raw endpoints only\nmiddleware({ target: { isRaw: true } }, handler);\n\n\u002F\u002F Apply to streaming endpoints only\nmiddleware({ target: { isStream: true } }, handler);\n\n\u002F\u002F Apply to endpoints with specific tags\nmiddleware({ target: { tags: [\"admin\", \"internal\"] } }, handler);\n```\n\n### Middleware Request Object\n\nThe request object provides access to:\n\n```typescript\nconst myMiddleware = middleware(\n  { target: { all: true } },\n  async (req, next) => {\n    \u002F\u002F For typed and streaming APIs\n    const meta = req.requestMeta;  \u002F\u002F { method, path, pathParams }\n\n    \u002F\u002F For raw endpoints\n    const rawReq = req.rawRequest;\n    const rawRes = req.rawResponse;\n\n    \u002F\u002F For streaming endpoints\n    const stream = req.stream;\n\n    \u002F\u002F Custom data to pass to handlers\n    req.data = { startTime: Date.now() };\n\n    const resp = await next(req);\n\n    \u002F\u002F Modify response headers\n    resp.header.set(\"X-Response-Time\", `${Date.now() - req.data.startTime}ms`);\n\n    return resp;\n  }\n);\n```\n\n## Guidelines\n\n- Services cannot be nested within other services\n- Start with one service, split when there's a clear reason\n- Use `~encore\u002Fclients` for cross-service calls (never direct imports)\n- Each service can have its own database\n- Service names should be lowercase, descriptive\n- Don't create services just for code organization - use folders instead\n",{"data":38,"body":40},{"name":4,"description":6,"when_to_use":39},"User is deciding monolith vs. microservices, weighing \"one service or several\", drawing service boundaries, planning a multi-service system (e.g. orders + payments + inventory + shipping), creating an `encore.service.ts`, naming directories\u002Ffolders, designing systems-of-services hierarchies, or asking for an application architecture \u002F project layout recommendation. Trigger phrases: \"lay out the directories\", \"directory structure\", \"service boundaries\", \"one service or several\", \"monolith vs microservices\", \"where to put\", \"systems of services\".",{"type":41,"children":42},"root",[43,52,59,66,81,217,223,233,239,245,250,259,265,270,279,285,290,299,305,318,730,736,741,845,851,1258,1264,1269,1735,1741,1746,2325,2331,2373],{"type":44,"tag":45,"props":46,"children":48},"element","h1",{"id":47},"encore-service-structure",[49],{"type":50,"value":51},"text","Encore Service Structure",{"type":44,"tag":53,"props":54,"children":56},"h2",{"id":55},"instructions",[57],{"type":50,"value":58},"Instructions",{"type":44,"tag":60,"props":61,"children":63},"h3",{"id":62},"creating-a-service",[64],{"type":50,"value":65},"Creating a Service",{"type":44,"tag":67,"props":68,"children":69},"p",{},[70,72,79],{"type":50,"value":71},"Every Encore service needs an ",{"type":44,"tag":73,"props":74,"children":76},"code",{"className":75},[],[77],{"type":50,"value":78},"encore.service.ts",{"type":50,"value":80}," file:",{"type":44,"tag":82,"props":83,"children":87},"pre",{"className":84,"code":85,"language":19,"meta":86,"style":86},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F encore.service.ts\nimport { Service } from \"encore.dev\u002Fservice\";\n\nexport default new Service(\"my-service\");\n","",[88],{"type":44,"tag":73,"props":89,"children":90},{"__ignoreMap":86},[91,103,156,166],{"type":44,"tag":92,"props":93,"children":96},"span",{"class":94,"line":95},"line",1,[97],{"type":44,"tag":92,"props":98,"children":100},{"style":99},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[101],{"type":50,"value":102},"\u002F\u002F encore.service.ts\n",{"type":44,"tag":92,"props":104,"children":106},{"class":94,"line":105},2,[107,113,119,125,130,135,140,146,151],{"type":44,"tag":92,"props":108,"children":110},{"style":109},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[111],{"type":50,"value":112},"import",{"type":44,"tag":92,"props":114,"children":116},{"style":115},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[117],{"type":50,"value":118}," {",{"type":44,"tag":92,"props":120,"children":122},{"style":121},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[123],{"type":50,"value":124}," Service",{"type":44,"tag":92,"props":126,"children":127},{"style":115},[128],{"type":50,"value":129}," }",{"type":44,"tag":92,"props":131,"children":132},{"style":109},[133],{"type":50,"value":134}," from",{"type":44,"tag":92,"props":136,"children":137},{"style":115},[138],{"type":50,"value":139}," \"",{"type":44,"tag":92,"props":141,"children":143},{"style":142},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[144],{"type":50,"value":145},"encore.dev\u002Fservice",{"type":44,"tag":92,"props":147,"children":148},{"style":115},[149],{"type":50,"value":150},"\"",{"type":44,"tag":92,"props":152,"children":153},{"style":115},[154],{"type":50,"value":155},";\n",{"type":44,"tag":92,"props":157,"children":159},{"class":94,"line":158},3,[160],{"type":44,"tag":92,"props":161,"children":163},{"emptyLinePlaceholder":162},true,[164],{"type":50,"value":165},"\n",{"type":44,"tag":92,"props":167,"children":169},{"class":94,"line":168},4,[170,175,180,185,190,195,199,204,208,213],{"type":44,"tag":92,"props":171,"children":172},{"style":109},[173],{"type":50,"value":174},"export",{"type":44,"tag":92,"props":176,"children":177},{"style":109},[178],{"type":50,"value":179}," default",{"type":44,"tag":92,"props":181,"children":182},{"style":115},[183],{"type":50,"value":184}," new",{"type":44,"tag":92,"props":186,"children":188},{"style":187},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[189],{"type":50,"value":124},{"type":44,"tag":92,"props":191,"children":192},{"style":121},[193],{"type":50,"value":194},"(",{"type":44,"tag":92,"props":196,"children":197},{"style":115},[198],{"type":50,"value":150},{"type":44,"tag":92,"props":200,"children":201},{"style":142},[202],{"type":50,"value":203},"my-service",{"type":44,"tag":92,"props":205,"children":206},{"style":115},[207],{"type":50,"value":150},{"type":44,"tag":92,"props":209,"children":210},{"style":121},[211],{"type":50,"value":212},")",{"type":44,"tag":92,"props":214,"children":215},{"style":115},[216],{"type":50,"value":155},{"type":44,"tag":60,"props":218,"children":220},{"id":219},"minimal-service-structure",[221],{"type":50,"value":222},"Minimal Service Structure",{"type":44,"tag":82,"props":224,"children":228},{"className":225,"code":227,"language":50},[226],"language-text","my-service\u002F\n├── encore.service.ts    # Service definition (required)\n├── api.ts               # API endpoints\n└── db.ts                # Database (if needed)\n",[229],{"type":44,"tag":73,"props":230,"children":231},{"__ignoreMap":86},[232],{"type":50,"value":227},{"type":44,"tag":53,"props":234,"children":236},{"id":235},"application-patterns",[237],{"type":50,"value":238},"Application Patterns",{"type":44,"tag":60,"props":240,"children":242},{"id":241},"single-service-recommended-start",[243],{"type":50,"value":244},"Single Service (Recommended Start)",{"type":44,"tag":67,"props":246,"children":247},{},[248],{"type":50,"value":249},"Best for new projects - start simple, split later if needed:",{"type":44,"tag":82,"props":251,"children":254},{"className":252,"code":253,"language":50},[226],"my-app\u002F\n├── package.json\n├── encore.app\n├── encore.service.ts\n├── api.ts\n├── db.ts\n└── migrations\u002F\n    └── 001_initial.up.sql\n",[255],{"type":44,"tag":73,"props":256,"children":257},{"__ignoreMap":86},[258],{"type":50,"value":253},{"type":44,"tag":60,"props":260,"children":262},{"id":261},"multi-service",[263],{"type":50,"value":264},"Multi-Service",{"type":44,"tag":67,"props":266,"children":267},{},[268],{"type":50,"value":269},"For distributed systems with clear domain boundaries:",{"type":44,"tag":82,"props":271,"children":274},{"className":272,"code":273,"language":50},[226],"my-app\u002F\n├── encore.app\n├── package.json\n├── user\u002F\n│   ├── encore.service.ts\n│   ├── api.ts\n│   └── db.ts\n├── order\u002F\n│   ├── encore.service.ts\n│   ├── api.ts\n│   └── db.ts\n└── notification\u002F\n    ├── encore.service.ts\n    └── api.ts\n",[275],{"type":44,"tag":73,"props":276,"children":277},{"__ignoreMap":86},[278],{"type":50,"value":273},{"type":44,"tag":60,"props":280,"children":282},{"id":281},"large-application-system-based",[283],{"type":50,"value":284},"Large Application (System-based)",{"type":44,"tag":67,"props":286,"children":287},{},[288],{"type":50,"value":289},"Group related services into systems:",{"type":44,"tag":82,"props":291,"children":294},{"className":292,"code":293,"language":50},[226],"my-app\u002F\n├── encore.app\n├── commerce\u002F\n│   ├── order\u002F\n│   │   └── encore.service.ts\n│   ├── cart\u002F\n│   │   └── encore.service.ts\n│   └── payment\u002F\n│       └── encore.service.ts\n├── identity\u002F\n│   ├── user\u002F\n│   │   └── encore.service.ts\n│   └── auth\u002F\n│       └── encore.service.ts\n└── comms\u002F\n    ├── email\u002F\n    │   └── encore.service.ts\n    └── push\u002F\n        └── encore.service.ts\n",[295],{"type":44,"tag":73,"props":296,"children":297},{"__ignoreMap":86},[298],{"type":50,"value":293},{"type":44,"tag":53,"props":300,"children":302},{"id":301},"service-to-service-calls",[303],{"type":50,"value":304},"Service-to-Service Calls",{"type":44,"tag":67,"props":306,"children":307},{},[308,310,316],{"type":50,"value":309},"Import other services from ",{"type":44,"tag":73,"props":311,"children":313},{"className":312},[],[314],{"type":50,"value":315},"~encore\u002Fclients",{"type":50,"value":317},":",{"type":44,"tag":82,"props":319,"children":321},{"className":84,"code":320,"language":19,"meta":86,"style":86},"import { user } from \"~encore\u002Fclients\";\n\nexport const getOrderWithUser = api(\n  { method: \"GET\", path: \"\u002Forders\u002F:id\", expose: true },\n  async ({ id }): Promise\u003COrderWithUser> => {\n    const order = await getOrder(id);\n    const orderUser = await user.get({ id: order.userId });\n    return { ...order, user: orderUser };\n  }\n);\n",[322],{"type":44,"tag":73,"props":323,"children":324},{"__ignoreMap":86},[325,365,372,405,487,542,588,665,709,718],{"type":44,"tag":92,"props":326,"children":327},{"class":94,"line":95},[328,332,336,341,345,349,353,357,361],{"type":44,"tag":92,"props":329,"children":330},{"style":109},[331],{"type":50,"value":112},{"type":44,"tag":92,"props":333,"children":334},{"style":115},[335],{"type":50,"value":118},{"type":44,"tag":92,"props":337,"children":338},{"style":121},[339],{"type":50,"value":340}," user",{"type":44,"tag":92,"props":342,"children":343},{"style":115},[344],{"type":50,"value":129},{"type":44,"tag":92,"props":346,"children":347},{"style":109},[348],{"type":50,"value":134},{"type":44,"tag":92,"props":350,"children":351},{"style":115},[352],{"type":50,"value":139},{"type":44,"tag":92,"props":354,"children":355},{"style":142},[356],{"type":50,"value":315},{"type":44,"tag":92,"props":358,"children":359},{"style":115},[360],{"type":50,"value":150},{"type":44,"tag":92,"props":362,"children":363},{"style":115},[364],{"type":50,"value":155},{"type":44,"tag":92,"props":366,"children":367},{"class":94,"line":105},[368],{"type":44,"tag":92,"props":369,"children":370},{"emptyLinePlaceholder":162},[371],{"type":50,"value":165},{"type":44,"tag":92,"props":373,"children":374},{"class":94,"line":158},[375,379,385,390,395,400],{"type":44,"tag":92,"props":376,"children":377},{"style":109},[378],{"type":50,"value":174},{"type":44,"tag":92,"props":380,"children":382},{"style":381},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[383],{"type":50,"value":384}," const",{"type":44,"tag":92,"props":386,"children":387},{"style":121},[388],{"type":50,"value":389}," getOrderWithUser ",{"type":44,"tag":92,"props":391,"children":392},{"style":115},[393],{"type":50,"value":394},"=",{"type":44,"tag":92,"props":396,"children":397},{"style":187},[398],{"type":50,"value":399}," api",{"type":44,"tag":92,"props":401,"children":402},{"style":121},[403],{"type":50,"value":404},"(\n",{"type":44,"tag":92,"props":406,"children":407},{"class":94,"line":168},[408,413,419,423,427,432,436,441,446,450,454,459,463,467,472,476,482],{"type":44,"tag":92,"props":409,"children":410},{"style":115},[411],{"type":50,"value":412},"  {",{"type":44,"tag":92,"props":414,"children":416},{"style":415},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[417],{"type":50,"value":418}," method",{"type":44,"tag":92,"props":420,"children":421},{"style":115},[422],{"type":50,"value":317},{"type":44,"tag":92,"props":424,"children":425},{"style":115},[426],{"type":50,"value":139},{"type":44,"tag":92,"props":428,"children":429},{"style":142},[430],{"type":50,"value":431},"GET",{"type":44,"tag":92,"props":433,"children":434},{"style":115},[435],{"type":50,"value":150},{"type":44,"tag":92,"props":437,"children":438},{"style":115},[439],{"type":50,"value":440},",",{"type":44,"tag":92,"props":442,"children":443},{"style":415},[444],{"type":50,"value":445}," path",{"type":44,"tag":92,"props":447,"children":448},{"style":115},[449],{"type":50,"value":317},{"type":44,"tag":92,"props":451,"children":452},{"style":115},[453],{"type":50,"value":139},{"type":44,"tag":92,"props":455,"children":456},{"style":142},[457],{"type":50,"value":458},"\u002Forders\u002F:id",{"type":44,"tag":92,"props":460,"children":461},{"style":115},[462],{"type":50,"value":150},{"type":44,"tag":92,"props":464,"children":465},{"style":115},[466],{"type":50,"value":440},{"type":44,"tag":92,"props":468,"children":469},{"style":415},[470],{"type":50,"value":471}," expose",{"type":44,"tag":92,"props":473,"children":474},{"style":115},[475],{"type":50,"value":317},{"type":44,"tag":92,"props":477,"children":479},{"style":478},"--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC",[480],{"type":50,"value":481}," true",{"type":44,"tag":92,"props":483,"children":484},{"style":115},[485],{"type":50,"value":486}," },\n",{"type":44,"tag":92,"props":488,"children":489},{"class":94,"line":28},[490,495,500,506,511,517,522,527,532,537],{"type":44,"tag":92,"props":491,"children":492},{"style":381},[493],{"type":50,"value":494},"  async",{"type":44,"tag":92,"props":496,"children":497},{"style":115},[498],{"type":50,"value":499}," ({",{"type":44,"tag":92,"props":501,"children":503},{"style":502},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[504],{"type":50,"value":505}," id",{"type":44,"tag":92,"props":507,"children":508},{"style":115},[509],{"type":50,"value":510}," }):",{"type":44,"tag":92,"props":512,"children":514},{"style":513},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[515],{"type":50,"value":516}," Promise",{"type":44,"tag":92,"props":518,"children":519},{"style":115},[520],{"type":50,"value":521},"\u003C",{"type":44,"tag":92,"props":523,"children":524},{"style":513},[525],{"type":50,"value":526},"OrderWithUser",{"type":44,"tag":92,"props":528,"children":529},{"style":115},[530],{"type":50,"value":531},">",{"type":44,"tag":92,"props":533,"children":534},{"style":381},[535],{"type":50,"value":536}," =>",{"type":44,"tag":92,"props":538,"children":539},{"style":115},[540],{"type":50,"value":541}," {\n",{"type":44,"tag":92,"props":543,"children":545},{"class":94,"line":544},6,[546,551,556,561,566,571,575,580,584],{"type":44,"tag":92,"props":547,"children":548},{"style":381},[549],{"type":50,"value":550},"    const",{"type":44,"tag":92,"props":552,"children":553},{"style":121},[554],{"type":50,"value":555}," order",{"type":44,"tag":92,"props":557,"children":558},{"style":115},[559],{"type":50,"value":560}," =",{"type":44,"tag":92,"props":562,"children":563},{"style":109},[564],{"type":50,"value":565}," await",{"type":44,"tag":92,"props":567,"children":568},{"style":187},[569],{"type":50,"value":570}," getOrder",{"type":44,"tag":92,"props":572,"children":573},{"style":415},[574],{"type":50,"value":194},{"type":44,"tag":92,"props":576,"children":577},{"style":121},[578],{"type":50,"value":579},"id",{"type":44,"tag":92,"props":581,"children":582},{"style":415},[583],{"type":50,"value":212},{"type":44,"tag":92,"props":585,"children":586},{"style":115},[587],{"type":50,"value":155},{"type":44,"tag":92,"props":589,"children":591},{"class":94,"line":590},7,[592,596,601,605,609,613,618,623,627,632,636,640,644,648,653,657,661],{"type":44,"tag":92,"props":593,"children":594},{"style":381},[595],{"type":50,"value":550},{"type":44,"tag":92,"props":597,"children":598},{"style":121},[599],{"type":50,"value":600}," orderUser",{"type":44,"tag":92,"props":602,"children":603},{"style":115},[604],{"type":50,"value":560},{"type":44,"tag":92,"props":606,"children":607},{"style":109},[608],{"type":50,"value":565},{"type":44,"tag":92,"props":610,"children":611},{"style":121},[612],{"type":50,"value":340},{"type":44,"tag":92,"props":614,"children":615},{"style":115},[616],{"type":50,"value":617},".",{"type":44,"tag":92,"props":619,"children":620},{"style":187},[621],{"type":50,"value":622},"get",{"type":44,"tag":92,"props":624,"children":625},{"style":415},[626],{"type":50,"value":194},{"type":44,"tag":92,"props":628,"children":629},{"style":115},[630],{"type":50,"value":631},"{",{"type":44,"tag":92,"props":633,"children":634},{"style":415},[635],{"type":50,"value":505},{"type":44,"tag":92,"props":637,"children":638},{"style":115},[639],{"type":50,"value":317},{"type":44,"tag":92,"props":641,"children":642},{"style":121},[643],{"type":50,"value":555},{"type":44,"tag":92,"props":645,"children":646},{"style":115},[647],{"type":50,"value":617},{"type":44,"tag":92,"props":649,"children":650},{"style":121},[651],{"type":50,"value":652},"userId",{"type":44,"tag":92,"props":654,"children":655},{"style":115},[656],{"type":50,"value":129},{"type":44,"tag":92,"props":658,"children":659},{"style":415},[660],{"type":50,"value":212},{"type":44,"tag":92,"props":662,"children":663},{"style":115},[664],{"type":50,"value":155},{"type":44,"tag":92,"props":666,"children":668},{"class":94,"line":667},8,[669,674,678,683,688,692,696,700,704],{"type":44,"tag":92,"props":670,"children":671},{"style":109},[672],{"type":50,"value":673},"    return",{"type":44,"tag":92,"props":675,"children":676},{"style":115},[677],{"type":50,"value":118},{"type":44,"tag":92,"props":679,"children":680},{"style":115},[681],{"type":50,"value":682}," ...",{"type":44,"tag":92,"props":684,"children":685},{"style":121},[686],{"type":50,"value":687},"order",{"type":44,"tag":92,"props":689,"children":690},{"style":115},[691],{"type":50,"value":440},{"type":44,"tag":92,"props":693,"children":694},{"style":415},[695],{"type":50,"value":340},{"type":44,"tag":92,"props":697,"children":698},{"style":115},[699],{"type":50,"value":317},{"type":44,"tag":92,"props":701,"children":702},{"style":121},[703],{"type":50,"value":600},{"type":44,"tag":92,"props":705,"children":706},{"style":115},[707],{"type":50,"value":708}," };\n",{"type":44,"tag":92,"props":710,"children":712},{"class":94,"line":711},9,[713],{"type":44,"tag":92,"props":714,"children":715},{"style":115},[716],{"type":50,"value":717},"  }\n",{"type":44,"tag":92,"props":719,"children":721},{"class":94,"line":720},10,[722,726],{"type":44,"tag":92,"props":723,"children":724},{"style":121},[725],{"type":50,"value":212},{"type":44,"tag":92,"props":727,"children":728},{"style":115},[729],{"type":50,"value":155},{"type":44,"tag":53,"props":731,"children":733},{"id":732},"when-to-split-services",[734],{"type":50,"value":735},"When to Split Services",{"type":44,"tag":67,"props":737,"children":738},{},[739],{"type":50,"value":740},"Split when you have:",{"type":44,"tag":742,"props":743,"children":744},"table",{},[745,764],{"type":44,"tag":746,"props":747,"children":748},"thead",{},[749],{"type":44,"tag":750,"props":751,"children":752},"tr",{},[753,759],{"type":44,"tag":754,"props":755,"children":756},"th",{},[757],{"type":50,"value":758},"Signal",{"type":44,"tag":754,"props":760,"children":761},{},[762],{"type":50,"value":763},"Action",{"type":44,"tag":765,"props":766,"children":767},"tbody",{},[768,782,795,807,820,832],{"type":44,"tag":750,"props":769,"children":770},{},[771,777],{"type":44,"tag":772,"props":773,"children":774},"td",{},[775],{"type":50,"value":776},"Different scaling needs",{"type":44,"tag":772,"props":778,"children":779},{},[780],{"type":50,"value":781},"Split (e.g., auth vs analytics)",{"type":44,"tag":750,"props":783,"children":784},{},[785,790],{"type":44,"tag":772,"props":786,"children":787},{},[788],{"type":50,"value":789},"Different deployment cycles",{"type":44,"tag":772,"props":791,"children":792},{},[793],{"type":50,"value":794},"Split",{"type":44,"tag":750,"props":796,"children":797},{},[798,803],{"type":44,"tag":772,"props":799,"children":800},{},[801],{"type":50,"value":802},"Clear domain boundaries",{"type":44,"tag":772,"props":804,"children":805},{},[806],{"type":50,"value":794},{"type":44,"tag":750,"props":808,"children":809},{},[810,815],{"type":44,"tag":772,"props":811,"children":812},{},[813],{"type":50,"value":814},"Shared database tables",{"type":44,"tag":772,"props":816,"children":817},{},[818],{"type":50,"value":819},"Keep together",{"type":44,"tag":750,"props":821,"children":822},{},[823,828],{"type":44,"tag":772,"props":824,"children":825},{},[826],{"type":50,"value":827},"Tightly coupled logic",{"type":44,"tag":772,"props":829,"children":830},{},[831],{"type":50,"value":819},{"type":44,"tag":750,"props":833,"children":834},{},[835,840],{"type":44,"tag":772,"props":836,"children":837},{},[838],{"type":50,"value":839},"Just organizing code",{"type":44,"tag":772,"props":841,"children":842},{},[843],{"type":50,"value":844},"Use folders, not services",{"type":44,"tag":53,"props":846,"children":848},{"id":847},"service-with-middleware",[849],{"type":50,"value":850},"Service with Middleware",{"type":44,"tag":82,"props":852,"children":854},{"className":84,"code":853,"language":19,"meta":86,"style":86},"import { Service } from \"encore.dev\u002Fservice\";\nimport { middleware } from \"encore.dev\u002Fapi\";\n\nconst loggingMiddleware = middleware(\n  { target: { all: true } },\n  async (req, next) => {\n    console.log(`Request: ${req.requestMeta?.path}`);\n    return next(req);\n  }\n);\n\nexport default new Service(\"my-service\", {\n  middlewares: [loggingMiddleware],\n});\n",[855],{"type":44,"tag":73,"props":856,"children":857},{"__ignoreMap":86},[858,897,938,945,970,1011,1049,1121,1148,1155,1166,1174,1218,1241],{"type":44,"tag":92,"props":859,"children":860},{"class":94,"line":95},[861,865,869,873,877,881,885,889,893],{"type":44,"tag":92,"props":862,"children":863},{"style":109},[864],{"type":50,"value":112},{"type":44,"tag":92,"props":866,"children":867},{"style":115},[868],{"type":50,"value":118},{"type":44,"tag":92,"props":870,"children":871},{"style":121},[872],{"type":50,"value":124},{"type":44,"tag":92,"props":874,"children":875},{"style":115},[876],{"type":50,"value":129},{"type":44,"tag":92,"props":878,"children":879},{"style":109},[880],{"type":50,"value":134},{"type":44,"tag":92,"props":882,"children":883},{"style":115},[884],{"type":50,"value":139},{"type":44,"tag":92,"props":886,"children":887},{"style":142},[888],{"type":50,"value":145},{"type":44,"tag":92,"props":890,"children":891},{"style":115},[892],{"type":50,"value":150},{"type":44,"tag":92,"props":894,"children":895},{"style":115},[896],{"type":50,"value":155},{"type":44,"tag":92,"props":898,"children":899},{"class":94,"line":105},[900,904,908,913,917,921,925,930,934],{"type":44,"tag":92,"props":901,"children":902},{"style":109},[903],{"type":50,"value":112},{"type":44,"tag":92,"props":905,"children":906},{"style":115},[907],{"type":50,"value":118},{"type":44,"tag":92,"props":909,"children":910},{"style":121},[911],{"type":50,"value":912}," middleware",{"type":44,"tag":92,"props":914,"children":915},{"style":115},[916],{"type":50,"value":129},{"type":44,"tag":92,"props":918,"children":919},{"style":109},[920],{"type":50,"value":134},{"type":44,"tag":92,"props":922,"children":923},{"style":115},[924],{"type":50,"value":139},{"type":44,"tag":92,"props":926,"children":927},{"style":142},[928],{"type":50,"value":929},"encore.dev\u002Fapi",{"type":44,"tag":92,"props":931,"children":932},{"style":115},[933],{"type":50,"value":150},{"type":44,"tag":92,"props":935,"children":936},{"style":115},[937],{"type":50,"value":155},{"type":44,"tag":92,"props":939,"children":940},{"class":94,"line":158},[941],{"type":44,"tag":92,"props":942,"children":943},{"emptyLinePlaceholder":162},[944],{"type":50,"value":165},{"type":44,"tag":92,"props":946,"children":947},{"class":94,"line":168},[948,953,958,962,966],{"type":44,"tag":92,"props":949,"children":950},{"style":381},[951],{"type":50,"value":952},"const",{"type":44,"tag":92,"props":954,"children":955},{"style":121},[956],{"type":50,"value":957}," loggingMiddleware ",{"type":44,"tag":92,"props":959,"children":960},{"style":115},[961],{"type":50,"value":394},{"type":44,"tag":92,"props":963,"children":964},{"style":187},[965],{"type":50,"value":912},{"type":44,"tag":92,"props":967,"children":968},{"style":121},[969],{"type":50,"value":404},{"type":44,"tag":92,"props":971,"children":972},{"class":94,"line":28},[973,977,982,986,990,995,999,1003,1007],{"type":44,"tag":92,"props":974,"children":975},{"style":115},[976],{"type":50,"value":412},{"type":44,"tag":92,"props":978,"children":979},{"style":415},[980],{"type":50,"value":981}," target",{"type":44,"tag":92,"props":983,"children":984},{"style":115},[985],{"type":50,"value":317},{"type":44,"tag":92,"props":987,"children":988},{"style":115},[989],{"type":50,"value":118},{"type":44,"tag":92,"props":991,"children":992},{"style":415},[993],{"type":50,"value":994}," all",{"type":44,"tag":92,"props":996,"children":997},{"style":115},[998],{"type":50,"value":317},{"type":44,"tag":92,"props":1000,"children":1001},{"style":478},[1002],{"type":50,"value":481},{"type":44,"tag":92,"props":1004,"children":1005},{"style":115},[1006],{"type":50,"value":129},{"type":44,"tag":92,"props":1008,"children":1009},{"style":115},[1010],{"type":50,"value":486},{"type":44,"tag":92,"props":1012,"children":1013},{"class":94,"line":544},[1014,1018,1023,1028,1032,1037,1041,1045],{"type":44,"tag":92,"props":1015,"children":1016},{"style":381},[1017],{"type":50,"value":494},{"type":44,"tag":92,"props":1019,"children":1020},{"style":115},[1021],{"type":50,"value":1022}," (",{"type":44,"tag":92,"props":1024,"children":1025},{"style":502},[1026],{"type":50,"value":1027},"req",{"type":44,"tag":92,"props":1029,"children":1030},{"style":115},[1031],{"type":50,"value":440},{"type":44,"tag":92,"props":1033,"children":1034},{"style":502},[1035],{"type":50,"value":1036}," next",{"type":44,"tag":92,"props":1038,"children":1039},{"style":115},[1040],{"type":50,"value":212},{"type":44,"tag":92,"props":1042,"children":1043},{"style":381},[1044],{"type":50,"value":536},{"type":44,"tag":92,"props":1046,"children":1047},{"style":115},[1048],{"type":50,"value":541},{"type":44,"tag":92,"props":1050,"children":1051},{"class":94,"line":590},[1052,1057,1061,1066,1070,1075,1080,1085,1089,1093,1098,1103,1108,1113,1117],{"type":44,"tag":92,"props":1053,"children":1054},{"style":121},[1055],{"type":50,"value":1056},"    console",{"type":44,"tag":92,"props":1058,"children":1059},{"style":115},[1060],{"type":50,"value":617},{"type":44,"tag":92,"props":1062,"children":1063},{"style":187},[1064],{"type":50,"value":1065},"log",{"type":44,"tag":92,"props":1067,"children":1068},{"style":415},[1069],{"type":50,"value":194},{"type":44,"tag":92,"props":1071,"children":1072},{"style":115},[1073],{"type":50,"value":1074},"`",{"type":44,"tag":92,"props":1076,"children":1077},{"style":142},[1078],{"type":50,"value":1079},"Request: ",{"type":44,"tag":92,"props":1081,"children":1082},{"style":115},[1083],{"type":50,"value":1084},"${",{"type":44,"tag":92,"props":1086,"children":1087},{"style":121},[1088],{"type":50,"value":1027},{"type":44,"tag":92,"props":1090,"children":1091},{"style":115},[1092],{"type":50,"value":617},{"type":44,"tag":92,"props":1094,"children":1095},{"style":121},[1096],{"type":50,"value":1097},"requestMeta",{"type":44,"tag":92,"props":1099,"children":1100},{"style":115},[1101],{"type":50,"value":1102},"?.",{"type":44,"tag":92,"props":1104,"children":1105},{"style":121},[1106],{"type":50,"value":1107},"path",{"type":44,"tag":92,"props":1109,"children":1110},{"style":115},[1111],{"type":50,"value":1112},"}`",{"type":44,"tag":92,"props":1114,"children":1115},{"style":415},[1116],{"type":50,"value":212},{"type":44,"tag":92,"props":1118,"children":1119},{"style":115},[1120],{"type":50,"value":155},{"type":44,"tag":92,"props":1122,"children":1123},{"class":94,"line":667},[1124,1128,1132,1136,1140,1144],{"type":44,"tag":92,"props":1125,"children":1126},{"style":109},[1127],{"type":50,"value":673},{"type":44,"tag":92,"props":1129,"children":1130},{"style":187},[1131],{"type":50,"value":1036},{"type":44,"tag":92,"props":1133,"children":1134},{"style":415},[1135],{"type":50,"value":194},{"type":44,"tag":92,"props":1137,"children":1138},{"style":121},[1139],{"type":50,"value":1027},{"type":44,"tag":92,"props":1141,"children":1142},{"style":415},[1143],{"type":50,"value":212},{"type":44,"tag":92,"props":1145,"children":1146},{"style":115},[1147],{"type":50,"value":155},{"type":44,"tag":92,"props":1149,"children":1150},{"class":94,"line":711},[1151],{"type":44,"tag":92,"props":1152,"children":1153},{"style":115},[1154],{"type":50,"value":717},{"type":44,"tag":92,"props":1156,"children":1157},{"class":94,"line":720},[1158,1162],{"type":44,"tag":92,"props":1159,"children":1160},{"style":121},[1161],{"type":50,"value":212},{"type":44,"tag":92,"props":1163,"children":1164},{"style":115},[1165],{"type":50,"value":155},{"type":44,"tag":92,"props":1167,"children":1169},{"class":94,"line":1168},11,[1170],{"type":44,"tag":92,"props":1171,"children":1172},{"emptyLinePlaceholder":162},[1173],{"type":50,"value":165},{"type":44,"tag":92,"props":1175,"children":1177},{"class":94,"line":1176},12,[1178,1182,1186,1190,1194,1198,1202,1206,1210,1214],{"type":44,"tag":92,"props":1179,"children":1180},{"style":109},[1181],{"type":50,"value":174},{"type":44,"tag":92,"props":1183,"children":1184},{"style":109},[1185],{"type":50,"value":179},{"type":44,"tag":92,"props":1187,"children":1188},{"style":115},[1189],{"type":50,"value":184},{"type":44,"tag":92,"props":1191,"children":1192},{"style":187},[1193],{"type":50,"value":124},{"type":44,"tag":92,"props":1195,"children":1196},{"style":121},[1197],{"type":50,"value":194},{"type":44,"tag":92,"props":1199,"children":1200},{"style":115},[1201],{"type":50,"value":150},{"type":44,"tag":92,"props":1203,"children":1204},{"style":142},[1205],{"type":50,"value":203},{"type":44,"tag":92,"props":1207,"children":1208},{"style":115},[1209],{"type":50,"value":150},{"type":44,"tag":92,"props":1211,"children":1212},{"style":115},[1213],{"type":50,"value":440},{"type":44,"tag":92,"props":1215,"children":1216},{"style":115},[1217],{"type":50,"value":541},{"type":44,"tag":92,"props":1219,"children":1221},{"class":94,"line":1220},13,[1222,1227,1231,1236],{"type":44,"tag":92,"props":1223,"children":1224},{"style":415},[1225],{"type":50,"value":1226},"  middlewares",{"type":44,"tag":92,"props":1228,"children":1229},{"style":115},[1230],{"type":50,"value":317},{"type":44,"tag":92,"props":1232,"children":1233},{"style":121},[1234],{"type":50,"value":1235}," [loggingMiddleware]",{"type":44,"tag":92,"props":1237,"children":1238},{"style":115},[1239],{"type":50,"value":1240},",\n",{"type":44,"tag":92,"props":1242,"children":1244},{"class":94,"line":1243},14,[1245,1250,1254],{"type":44,"tag":92,"props":1246,"children":1247},{"style":115},[1248],{"type":50,"value":1249},"}",{"type":44,"tag":92,"props":1251,"children":1252},{"style":121},[1253],{"type":50,"value":212},{"type":44,"tag":92,"props":1255,"children":1256},{"style":115},[1257],{"type":50,"value":155},{"type":44,"tag":60,"props":1259,"children":1261},{"id":1260},"middleware-targeting",[1262],{"type":50,"value":1263},"Middleware Targeting",{"type":44,"tag":67,"props":1265,"children":1266},{},[1267],{"type":50,"value":1268},"Control which endpoints middleware applies to:",{"type":44,"tag":82,"props":1270,"children":1272},{"className":84,"code":1271,"language":19,"meta":86,"style":86},"\u002F\u002F Apply to all endpoints\nmiddleware({ target: { all: true } }, handler);\n\n\u002F\u002F Apply only to authenticated endpoints\nmiddleware({ target: { auth: true } }, handler);\n\n\u002F\u002F Apply only to exposed (public) endpoints\nmiddleware({ target: { expose: true } }, handler);\n\n\u002F\u002F Apply to raw endpoints only\nmiddleware({ target: { isRaw: true } }, handler);\n\n\u002F\u002F Apply to streaming endpoints only\nmiddleware({ target: { isStream: true } }, handler);\n\n\u002F\u002F Apply to endpoints with specific tags\nmiddleware({ target: { tags: [\"admin\", \"internal\"] } }, handler);\n",[1273],{"type":44,"tag":73,"props":1274,"children":1275},{"__ignoreMap":86},[1276,1284,1342,1349,1357,1413,1420,1428,1483,1490,1498,1554,1561,1569,1625,1633,1642],{"type":44,"tag":92,"props":1277,"children":1278},{"class":94,"line":95},[1279],{"type":44,"tag":92,"props":1280,"children":1281},{"style":99},[1282],{"type":50,"value":1283},"\u002F\u002F Apply to all endpoints\n",{"type":44,"tag":92,"props":1285,"children":1286},{"class":94,"line":105},[1287,1292,1296,1300,1304,1308,1312,1316,1320,1324,1328,1333,1338],{"type":44,"tag":92,"props":1288,"children":1289},{"style":187},[1290],{"type":50,"value":1291},"middleware",{"type":44,"tag":92,"props":1293,"children":1294},{"style":121},[1295],{"type":50,"value":194},{"type":44,"tag":92,"props":1297,"children":1298},{"style":115},[1299],{"type":50,"value":631},{"type":44,"tag":92,"props":1301,"children":1302},{"style":415},[1303],{"type":50,"value":981},{"type":44,"tag":92,"props":1305,"children":1306},{"style":115},[1307],{"type":50,"value":317},{"type":44,"tag":92,"props":1309,"children":1310},{"style":115},[1311],{"type":50,"value":118},{"type":44,"tag":92,"props":1313,"children":1314},{"style":415},[1315],{"type":50,"value":994},{"type":44,"tag":92,"props":1317,"children":1318},{"style":115},[1319],{"type":50,"value":317},{"type":44,"tag":92,"props":1321,"children":1322},{"style":478},[1323],{"type":50,"value":481},{"type":44,"tag":92,"props":1325,"children":1326},{"style":115},[1327],{"type":50,"value":129},{"type":44,"tag":92,"props":1329,"children":1330},{"style":115},[1331],{"type":50,"value":1332}," },",{"type":44,"tag":92,"props":1334,"children":1335},{"style":121},[1336],{"type":50,"value":1337}," handler)",{"type":44,"tag":92,"props":1339,"children":1340},{"style":115},[1341],{"type":50,"value":155},{"type":44,"tag":92,"props":1343,"children":1344},{"class":94,"line":158},[1345],{"type":44,"tag":92,"props":1346,"children":1347},{"emptyLinePlaceholder":162},[1348],{"type":50,"value":165},{"type":44,"tag":92,"props":1350,"children":1351},{"class":94,"line":168},[1352],{"type":44,"tag":92,"props":1353,"children":1354},{"style":99},[1355],{"type":50,"value":1356},"\u002F\u002F Apply only to authenticated endpoints\n",{"type":44,"tag":92,"props":1358,"children":1359},{"class":94,"line":28},[1360,1364,1368,1372,1376,1380,1384,1389,1393,1397,1401,1405,1409],{"type":44,"tag":92,"props":1361,"children":1362},{"style":187},[1363],{"type":50,"value":1291},{"type":44,"tag":92,"props":1365,"children":1366},{"style":121},[1367],{"type":50,"value":194},{"type":44,"tag":92,"props":1369,"children":1370},{"style":115},[1371],{"type":50,"value":631},{"type":44,"tag":92,"props":1373,"children":1374},{"style":415},[1375],{"type":50,"value":981},{"type":44,"tag":92,"props":1377,"children":1378},{"style":115},[1379],{"type":50,"value":317},{"type":44,"tag":92,"props":1381,"children":1382},{"style":115},[1383],{"type":50,"value":118},{"type":44,"tag":92,"props":1385,"children":1386},{"style":415},[1387],{"type":50,"value":1388}," auth",{"type":44,"tag":92,"props":1390,"children":1391},{"style":115},[1392],{"type":50,"value":317},{"type":44,"tag":92,"props":1394,"children":1395},{"style":478},[1396],{"type":50,"value":481},{"type":44,"tag":92,"props":1398,"children":1399},{"style":115},[1400],{"type":50,"value":129},{"type":44,"tag":92,"props":1402,"children":1403},{"style":115},[1404],{"type":50,"value":1332},{"type":44,"tag":92,"props":1406,"children":1407},{"style":121},[1408],{"type":50,"value":1337},{"type":44,"tag":92,"props":1410,"children":1411},{"style":115},[1412],{"type":50,"value":155},{"type":44,"tag":92,"props":1414,"children":1415},{"class":94,"line":544},[1416],{"type":44,"tag":92,"props":1417,"children":1418},{"emptyLinePlaceholder":162},[1419],{"type":50,"value":165},{"type":44,"tag":92,"props":1421,"children":1422},{"class":94,"line":590},[1423],{"type":44,"tag":92,"props":1424,"children":1425},{"style":99},[1426],{"type":50,"value":1427},"\u002F\u002F Apply only to exposed (public) endpoints\n",{"type":44,"tag":92,"props":1429,"children":1430},{"class":94,"line":667},[1431,1435,1439,1443,1447,1451,1455,1459,1463,1467,1471,1475,1479],{"type":44,"tag":92,"props":1432,"children":1433},{"style":187},[1434],{"type":50,"value":1291},{"type":44,"tag":92,"props":1436,"children":1437},{"style":121},[1438],{"type":50,"value":194},{"type":44,"tag":92,"props":1440,"children":1441},{"style":115},[1442],{"type":50,"value":631},{"type":44,"tag":92,"props":1444,"children":1445},{"style":415},[1446],{"type":50,"value":981},{"type":44,"tag":92,"props":1448,"children":1449},{"style":115},[1450],{"type":50,"value":317},{"type":44,"tag":92,"props":1452,"children":1453},{"style":115},[1454],{"type":50,"value":118},{"type":44,"tag":92,"props":1456,"children":1457},{"style":415},[1458],{"type":50,"value":471},{"type":44,"tag":92,"props":1460,"children":1461},{"style":115},[1462],{"type":50,"value":317},{"type":44,"tag":92,"props":1464,"children":1465},{"style":478},[1466],{"type":50,"value":481},{"type":44,"tag":92,"props":1468,"children":1469},{"style":115},[1470],{"type":50,"value":129},{"type":44,"tag":92,"props":1472,"children":1473},{"style":115},[1474],{"type":50,"value":1332},{"type":44,"tag":92,"props":1476,"children":1477},{"style":121},[1478],{"type":50,"value":1337},{"type":44,"tag":92,"props":1480,"children":1481},{"style":115},[1482],{"type":50,"value":155},{"type":44,"tag":92,"props":1484,"children":1485},{"class":94,"line":711},[1486],{"type":44,"tag":92,"props":1487,"children":1488},{"emptyLinePlaceholder":162},[1489],{"type":50,"value":165},{"type":44,"tag":92,"props":1491,"children":1492},{"class":94,"line":720},[1493],{"type":44,"tag":92,"props":1494,"children":1495},{"style":99},[1496],{"type":50,"value":1497},"\u002F\u002F Apply to raw endpoints only\n",{"type":44,"tag":92,"props":1499,"children":1500},{"class":94,"line":1168},[1501,1505,1509,1513,1517,1521,1525,1530,1534,1538,1542,1546,1550],{"type":44,"tag":92,"props":1502,"children":1503},{"style":187},[1504],{"type":50,"value":1291},{"type":44,"tag":92,"props":1506,"children":1507},{"style":121},[1508],{"type":50,"value":194},{"type":44,"tag":92,"props":1510,"children":1511},{"style":115},[1512],{"type":50,"value":631},{"type":44,"tag":92,"props":1514,"children":1515},{"style":415},[1516],{"type":50,"value":981},{"type":44,"tag":92,"props":1518,"children":1519},{"style":115},[1520],{"type":50,"value":317},{"type":44,"tag":92,"props":1522,"children":1523},{"style":115},[1524],{"type":50,"value":118},{"type":44,"tag":92,"props":1526,"children":1527},{"style":415},[1528],{"type":50,"value":1529}," isRaw",{"type":44,"tag":92,"props":1531,"children":1532},{"style":115},[1533],{"type":50,"value":317},{"type":44,"tag":92,"props":1535,"children":1536},{"style":478},[1537],{"type":50,"value":481},{"type":44,"tag":92,"props":1539,"children":1540},{"style":115},[1541],{"type":50,"value":129},{"type":44,"tag":92,"props":1543,"children":1544},{"style":115},[1545],{"type":50,"value":1332},{"type":44,"tag":92,"props":1547,"children":1548},{"style":121},[1549],{"type":50,"value":1337},{"type":44,"tag":92,"props":1551,"children":1552},{"style":115},[1553],{"type":50,"value":155},{"type":44,"tag":92,"props":1555,"children":1556},{"class":94,"line":1176},[1557],{"type":44,"tag":92,"props":1558,"children":1559},{"emptyLinePlaceholder":162},[1560],{"type":50,"value":165},{"type":44,"tag":92,"props":1562,"children":1563},{"class":94,"line":1220},[1564],{"type":44,"tag":92,"props":1565,"children":1566},{"style":99},[1567],{"type":50,"value":1568},"\u002F\u002F Apply to streaming endpoints only\n",{"type":44,"tag":92,"props":1570,"children":1571},{"class":94,"line":1243},[1572,1576,1580,1584,1588,1592,1596,1601,1605,1609,1613,1617,1621],{"type":44,"tag":92,"props":1573,"children":1574},{"style":187},[1575],{"type":50,"value":1291},{"type":44,"tag":92,"props":1577,"children":1578},{"style":121},[1579],{"type":50,"value":194},{"type":44,"tag":92,"props":1581,"children":1582},{"style":115},[1583],{"type":50,"value":631},{"type":44,"tag":92,"props":1585,"children":1586},{"style":415},[1587],{"type":50,"value":981},{"type":44,"tag":92,"props":1589,"children":1590},{"style":115},[1591],{"type":50,"value":317},{"type":44,"tag":92,"props":1593,"children":1594},{"style":115},[1595],{"type":50,"value":118},{"type":44,"tag":92,"props":1597,"children":1598},{"style":415},[1599],{"type":50,"value":1600}," isStream",{"type":44,"tag":92,"props":1602,"children":1603},{"style":115},[1604],{"type":50,"value":317},{"type":44,"tag":92,"props":1606,"children":1607},{"style":478},[1608],{"type":50,"value":481},{"type":44,"tag":92,"props":1610,"children":1611},{"style":115},[1612],{"type":50,"value":129},{"type":44,"tag":92,"props":1614,"children":1615},{"style":115},[1616],{"type":50,"value":1332},{"type":44,"tag":92,"props":1618,"children":1619},{"style":121},[1620],{"type":50,"value":1337},{"type":44,"tag":92,"props":1622,"children":1623},{"style":115},[1624],{"type":50,"value":155},{"type":44,"tag":92,"props":1626,"children":1628},{"class":94,"line":1627},15,[1629],{"type":44,"tag":92,"props":1630,"children":1631},{"emptyLinePlaceholder":162},[1632],{"type":50,"value":165},{"type":44,"tag":92,"props":1634,"children":1636},{"class":94,"line":1635},16,[1637],{"type":44,"tag":92,"props":1638,"children":1639},{"style":99},[1640],{"type":50,"value":1641},"\u002F\u002F Apply to endpoints with specific tags\n",{"type":44,"tag":92,"props":1643,"children":1645},{"class":94,"line":1644},17,[1646,1650,1654,1658,1662,1666,1670,1675,1679,1684,1688,1693,1697,1701,1705,1710,1714,1719,1723,1727,1731],{"type":44,"tag":92,"props":1647,"children":1648},{"style":187},[1649],{"type":50,"value":1291},{"type":44,"tag":92,"props":1651,"children":1652},{"style":121},[1653],{"type":50,"value":194},{"type":44,"tag":92,"props":1655,"children":1656},{"style":115},[1657],{"type":50,"value":631},{"type":44,"tag":92,"props":1659,"children":1660},{"style":415},[1661],{"type":50,"value":981},{"type":44,"tag":92,"props":1663,"children":1664},{"style":115},[1665],{"type":50,"value":317},{"type":44,"tag":92,"props":1667,"children":1668},{"style":115},[1669],{"type":50,"value":118},{"type":44,"tag":92,"props":1671,"children":1672},{"style":415},[1673],{"type":50,"value":1674}," tags",{"type":44,"tag":92,"props":1676,"children":1677},{"style":115},[1678],{"type":50,"value":317},{"type":44,"tag":92,"props":1680,"children":1681},{"style":121},[1682],{"type":50,"value":1683}," [",{"type":44,"tag":92,"props":1685,"children":1686},{"style":115},[1687],{"type":50,"value":150},{"type":44,"tag":92,"props":1689,"children":1690},{"style":142},[1691],{"type":50,"value":1692},"admin",{"type":44,"tag":92,"props":1694,"children":1695},{"style":115},[1696],{"type":50,"value":150},{"type":44,"tag":92,"props":1698,"children":1699},{"style":115},[1700],{"type":50,"value":440},{"type":44,"tag":92,"props":1702,"children":1703},{"style":115},[1704],{"type":50,"value":139},{"type":44,"tag":92,"props":1706,"children":1707},{"style":142},[1708],{"type":50,"value":1709},"internal",{"type":44,"tag":92,"props":1711,"children":1712},{"style":115},[1713],{"type":50,"value":150},{"type":44,"tag":92,"props":1715,"children":1716},{"style":121},[1717],{"type":50,"value":1718},"] ",{"type":44,"tag":92,"props":1720,"children":1721},{"style":115},[1722],{"type":50,"value":1249},{"type":44,"tag":92,"props":1724,"children":1725},{"style":115},[1726],{"type":50,"value":1332},{"type":44,"tag":92,"props":1728,"children":1729},{"style":121},[1730],{"type":50,"value":1337},{"type":44,"tag":92,"props":1732,"children":1733},{"style":115},[1734],{"type":50,"value":155},{"type":44,"tag":60,"props":1736,"children":1738},{"id":1737},"middleware-request-object",[1739],{"type":50,"value":1740},"Middleware Request Object",{"type":44,"tag":67,"props":1742,"children":1743},{},[1744],{"type":50,"value":1745},"The request object provides access to:",{"type":44,"tag":82,"props":1747,"children":1749},{"className":84,"code":1748,"language":19,"meta":86,"style":86},"const myMiddleware = middleware(\n  { target: { all: true } },\n  async (req, next) => {\n    \u002F\u002F For typed and streaming APIs\n    const meta = req.requestMeta;  \u002F\u002F { method, path, pathParams }\n\n    \u002F\u002F For raw endpoints\n    const rawReq = req.rawRequest;\n    const rawRes = req.rawResponse;\n\n    \u002F\u002F For streaming endpoints\n    const stream = req.stream;\n\n    \u002F\u002F Custom data to pass to handlers\n    req.data = { startTime: Date.now() };\n\n    const resp = await next(req);\n\n    \u002F\u002F Modify response headers\n    resp.header.set(\"X-Response-Time\", `${Date.now() - req.data.startTime}ms`);\n\n    return resp;\n  }\n);\n",[1750],{"type":44,"tag":73,"props":1751,"children":1752},{"__ignoreMap":86},[1753,1777,1816,1851,1859,1898,1905,1913,1946,1979,1986,1994,2027,2034,2042,2100,2107,2147,2155,2164,2281,2289,2305,2313],{"type":44,"tag":92,"props":1754,"children":1755},{"class":94,"line":95},[1756,1760,1765,1769,1773],{"type":44,"tag":92,"props":1757,"children":1758},{"style":381},[1759],{"type":50,"value":952},{"type":44,"tag":92,"props":1761,"children":1762},{"style":121},[1763],{"type":50,"value":1764}," myMiddleware ",{"type":44,"tag":92,"props":1766,"children":1767},{"style":115},[1768],{"type":50,"value":394},{"type":44,"tag":92,"props":1770,"children":1771},{"style":187},[1772],{"type":50,"value":912},{"type":44,"tag":92,"props":1774,"children":1775},{"style":121},[1776],{"type":50,"value":404},{"type":44,"tag":92,"props":1778,"children":1779},{"class":94,"line":105},[1780,1784,1788,1792,1796,1800,1804,1808,1812],{"type":44,"tag":92,"props":1781,"children":1782},{"style":115},[1783],{"type":50,"value":412},{"type":44,"tag":92,"props":1785,"children":1786},{"style":415},[1787],{"type":50,"value":981},{"type":44,"tag":92,"props":1789,"children":1790},{"style":115},[1791],{"type":50,"value":317},{"type":44,"tag":92,"props":1793,"children":1794},{"style":115},[1795],{"type":50,"value":118},{"type":44,"tag":92,"props":1797,"children":1798},{"style":415},[1799],{"type":50,"value":994},{"type":44,"tag":92,"props":1801,"children":1802},{"style":115},[1803],{"type":50,"value":317},{"type":44,"tag":92,"props":1805,"children":1806},{"style":478},[1807],{"type":50,"value":481},{"type":44,"tag":92,"props":1809,"children":1810},{"style":115},[1811],{"type":50,"value":129},{"type":44,"tag":92,"props":1813,"children":1814},{"style":115},[1815],{"type":50,"value":486},{"type":44,"tag":92,"props":1817,"children":1818},{"class":94,"line":158},[1819,1823,1827,1831,1835,1839,1843,1847],{"type":44,"tag":92,"props":1820,"children":1821},{"style":381},[1822],{"type":50,"value":494},{"type":44,"tag":92,"props":1824,"children":1825},{"style":115},[1826],{"type":50,"value":1022},{"type":44,"tag":92,"props":1828,"children":1829},{"style":502},[1830],{"type":50,"value":1027},{"type":44,"tag":92,"props":1832,"children":1833},{"style":115},[1834],{"type":50,"value":440},{"type":44,"tag":92,"props":1836,"children":1837},{"style":502},[1838],{"type":50,"value":1036},{"type":44,"tag":92,"props":1840,"children":1841},{"style":115},[1842],{"type":50,"value":212},{"type":44,"tag":92,"props":1844,"children":1845},{"style":381},[1846],{"type":50,"value":536},{"type":44,"tag":92,"props":1848,"children":1849},{"style":115},[1850],{"type":50,"value":541},{"type":44,"tag":92,"props":1852,"children":1853},{"class":94,"line":168},[1854],{"type":44,"tag":92,"props":1855,"children":1856},{"style":99},[1857],{"type":50,"value":1858},"    \u002F\u002F For typed and streaming APIs\n",{"type":44,"tag":92,"props":1860,"children":1861},{"class":94,"line":28},[1862,1866,1871,1875,1880,1884,1888,1893],{"type":44,"tag":92,"props":1863,"children":1864},{"style":381},[1865],{"type":50,"value":550},{"type":44,"tag":92,"props":1867,"children":1868},{"style":121},[1869],{"type":50,"value":1870}," meta",{"type":44,"tag":92,"props":1872,"children":1873},{"style":115},[1874],{"type":50,"value":560},{"type":44,"tag":92,"props":1876,"children":1877},{"style":121},[1878],{"type":50,"value":1879}," req",{"type":44,"tag":92,"props":1881,"children":1882},{"style":115},[1883],{"type":50,"value":617},{"type":44,"tag":92,"props":1885,"children":1886},{"style":121},[1887],{"type":50,"value":1097},{"type":44,"tag":92,"props":1889,"children":1890},{"style":115},[1891],{"type":50,"value":1892},";",{"type":44,"tag":92,"props":1894,"children":1895},{"style":99},[1896],{"type":50,"value":1897},"  \u002F\u002F { method, path, pathParams }\n",{"type":44,"tag":92,"props":1899,"children":1900},{"class":94,"line":544},[1901],{"type":44,"tag":92,"props":1902,"children":1903},{"emptyLinePlaceholder":162},[1904],{"type":50,"value":165},{"type":44,"tag":92,"props":1906,"children":1907},{"class":94,"line":590},[1908],{"type":44,"tag":92,"props":1909,"children":1910},{"style":99},[1911],{"type":50,"value":1912},"    \u002F\u002F For raw endpoints\n",{"type":44,"tag":92,"props":1914,"children":1915},{"class":94,"line":667},[1916,1920,1925,1929,1933,1937,1942],{"type":44,"tag":92,"props":1917,"children":1918},{"style":381},[1919],{"type":50,"value":550},{"type":44,"tag":92,"props":1921,"children":1922},{"style":121},[1923],{"type":50,"value":1924}," rawReq",{"type":44,"tag":92,"props":1926,"children":1927},{"style":115},[1928],{"type":50,"value":560},{"type":44,"tag":92,"props":1930,"children":1931},{"style":121},[1932],{"type":50,"value":1879},{"type":44,"tag":92,"props":1934,"children":1935},{"style":115},[1936],{"type":50,"value":617},{"type":44,"tag":92,"props":1938,"children":1939},{"style":121},[1940],{"type":50,"value":1941},"rawRequest",{"type":44,"tag":92,"props":1943,"children":1944},{"style":115},[1945],{"type":50,"value":155},{"type":44,"tag":92,"props":1947,"children":1948},{"class":94,"line":711},[1949,1953,1958,1962,1966,1970,1975],{"type":44,"tag":92,"props":1950,"children":1951},{"style":381},[1952],{"type":50,"value":550},{"type":44,"tag":92,"props":1954,"children":1955},{"style":121},[1956],{"type":50,"value":1957}," rawRes",{"type":44,"tag":92,"props":1959,"children":1960},{"style":115},[1961],{"type":50,"value":560},{"type":44,"tag":92,"props":1963,"children":1964},{"style":121},[1965],{"type":50,"value":1879},{"type":44,"tag":92,"props":1967,"children":1968},{"style":115},[1969],{"type":50,"value":617},{"type":44,"tag":92,"props":1971,"children":1972},{"style":121},[1973],{"type":50,"value":1974},"rawResponse",{"type":44,"tag":92,"props":1976,"children":1977},{"style":115},[1978],{"type":50,"value":155},{"type":44,"tag":92,"props":1980,"children":1981},{"class":94,"line":720},[1982],{"type":44,"tag":92,"props":1983,"children":1984},{"emptyLinePlaceholder":162},[1985],{"type":50,"value":165},{"type":44,"tag":92,"props":1987,"children":1988},{"class":94,"line":1168},[1989],{"type":44,"tag":92,"props":1990,"children":1991},{"style":99},[1992],{"type":50,"value":1993},"    \u002F\u002F For streaming endpoints\n",{"type":44,"tag":92,"props":1995,"children":1996},{"class":94,"line":1176},[1997,2001,2006,2010,2014,2018,2023],{"type":44,"tag":92,"props":1998,"children":1999},{"style":381},[2000],{"type":50,"value":550},{"type":44,"tag":92,"props":2002,"children":2003},{"style":121},[2004],{"type":50,"value":2005}," stream",{"type":44,"tag":92,"props":2007,"children":2008},{"style":115},[2009],{"type":50,"value":560},{"type":44,"tag":92,"props":2011,"children":2012},{"style":121},[2013],{"type":50,"value":1879},{"type":44,"tag":92,"props":2015,"children":2016},{"style":115},[2017],{"type":50,"value":617},{"type":44,"tag":92,"props":2019,"children":2020},{"style":121},[2021],{"type":50,"value":2022},"stream",{"type":44,"tag":92,"props":2024,"children":2025},{"style":115},[2026],{"type":50,"value":155},{"type":44,"tag":92,"props":2028,"children":2029},{"class":94,"line":1220},[2030],{"type":44,"tag":92,"props":2031,"children":2032},{"emptyLinePlaceholder":162},[2033],{"type":50,"value":165},{"type":44,"tag":92,"props":2035,"children":2036},{"class":94,"line":1243},[2037],{"type":44,"tag":92,"props":2038,"children":2039},{"style":99},[2040],{"type":50,"value":2041},"    \u002F\u002F Custom data to pass to handlers\n",{"type":44,"tag":92,"props":2043,"children":2044},{"class":94,"line":1627},[2045,2050,2054,2059,2063,2067,2072,2076,2081,2085,2090,2095],{"type":44,"tag":92,"props":2046,"children":2047},{"style":121},[2048],{"type":50,"value":2049},"    req",{"type":44,"tag":92,"props":2051,"children":2052},{"style":115},[2053],{"type":50,"value":617},{"type":44,"tag":92,"props":2055,"children":2056},{"style":121},[2057],{"type":50,"value":2058},"data",{"type":44,"tag":92,"props":2060,"children":2061},{"style":115},[2062],{"type":50,"value":560},{"type":44,"tag":92,"props":2064,"children":2065},{"style":115},[2066],{"type":50,"value":118},{"type":44,"tag":92,"props":2068,"children":2069},{"style":415},[2070],{"type":50,"value":2071}," startTime",{"type":44,"tag":92,"props":2073,"children":2074},{"style":115},[2075],{"type":50,"value":317},{"type":44,"tag":92,"props":2077,"children":2078},{"style":121},[2079],{"type":50,"value":2080}," Date",{"type":44,"tag":92,"props":2082,"children":2083},{"style":115},[2084],{"type":50,"value":617},{"type":44,"tag":92,"props":2086,"children":2087},{"style":187},[2088],{"type":50,"value":2089},"now",{"type":44,"tag":92,"props":2091,"children":2092},{"style":415},[2093],{"type":50,"value":2094},"() ",{"type":44,"tag":92,"props":2096,"children":2097},{"style":115},[2098],{"type":50,"value":2099},"};\n",{"type":44,"tag":92,"props":2101,"children":2102},{"class":94,"line":1635},[2103],{"type":44,"tag":92,"props":2104,"children":2105},{"emptyLinePlaceholder":162},[2106],{"type":50,"value":165},{"type":44,"tag":92,"props":2108,"children":2109},{"class":94,"line":1644},[2110,2114,2119,2123,2127,2131,2135,2139,2143],{"type":44,"tag":92,"props":2111,"children":2112},{"style":381},[2113],{"type":50,"value":550},{"type":44,"tag":92,"props":2115,"children":2116},{"style":121},[2117],{"type":50,"value":2118}," resp",{"type":44,"tag":92,"props":2120,"children":2121},{"style":115},[2122],{"type":50,"value":560},{"type":44,"tag":92,"props":2124,"children":2125},{"style":109},[2126],{"type":50,"value":565},{"type":44,"tag":92,"props":2128,"children":2129},{"style":187},[2130],{"type":50,"value":1036},{"type":44,"tag":92,"props":2132,"children":2133},{"style":415},[2134],{"type":50,"value":194},{"type":44,"tag":92,"props":2136,"children":2137},{"style":121},[2138],{"type":50,"value":1027},{"type":44,"tag":92,"props":2140,"children":2141},{"style":415},[2142],{"type":50,"value":212},{"type":44,"tag":92,"props":2144,"children":2145},{"style":115},[2146],{"type":50,"value":155},{"type":44,"tag":92,"props":2148,"children":2150},{"class":94,"line":2149},18,[2151],{"type":44,"tag":92,"props":2152,"children":2153},{"emptyLinePlaceholder":162},[2154],{"type":50,"value":165},{"type":44,"tag":92,"props":2156,"children":2158},{"class":94,"line":2157},19,[2159],{"type":44,"tag":92,"props":2160,"children":2161},{"style":99},[2162],{"type":50,"value":2163},"    \u002F\u002F Modify response headers\n",{"type":44,"tag":92,"props":2165,"children":2167},{"class":94,"line":2166},20,[2168,2173,2177,2182,2186,2191,2195,2199,2204,2208,2212,2217,2222,2226,2230,2234,2239,2243,2247,2251,2255,2260,2264,2269,2273,2277],{"type":44,"tag":92,"props":2169,"children":2170},{"style":121},[2171],{"type":50,"value":2172},"    resp",{"type":44,"tag":92,"props":2174,"children":2175},{"style":115},[2176],{"type":50,"value":617},{"type":44,"tag":92,"props":2178,"children":2179},{"style":121},[2180],{"type":50,"value":2181},"header",{"type":44,"tag":92,"props":2183,"children":2184},{"style":115},[2185],{"type":50,"value":617},{"type":44,"tag":92,"props":2187,"children":2188},{"style":187},[2189],{"type":50,"value":2190},"set",{"type":44,"tag":92,"props":2192,"children":2193},{"style":415},[2194],{"type":50,"value":194},{"type":44,"tag":92,"props":2196,"children":2197},{"style":115},[2198],{"type":50,"value":150},{"type":44,"tag":92,"props":2200,"children":2201},{"style":142},[2202],{"type":50,"value":2203},"X-Response-Time",{"type":44,"tag":92,"props":2205,"children":2206},{"style":115},[2207],{"type":50,"value":150},{"type":44,"tag":92,"props":2209,"children":2210},{"style":115},[2211],{"type":50,"value":440},{"type":44,"tag":92,"props":2213,"children":2214},{"style":115},[2215],{"type":50,"value":2216}," `${",{"type":44,"tag":92,"props":2218,"children":2219},{"style":121},[2220],{"type":50,"value":2221},"Date",{"type":44,"tag":92,"props":2223,"children":2224},{"style":115},[2225],{"type":50,"value":617},{"type":44,"tag":92,"props":2227,"children":2228},{"style":187},[2229],{"type":50,"value":2089},{"type":44,"tag":92,"props":2231,"children":2232},{"style":121},[2233],{"type":50,"value":2094},{"type":44,"tag":92,"props":2235,"children":2236},{"style":115},[2237],{"type":50,"value":2238},"-",{"type":44,"tag":92,"props":2240,"children":2241},{"style":121},[2242],{"type":50,"value":1879},{"type":44,"tag":92,"props":2244,"children":2245},{"style":115},[2246],{"type":50,"value":617},{"type":44,"tag":92,"props":2248,"children":2249},{"style":121},[2250],{"type":50,"value":2058},{"type":44,"tag":92,"props":2252,"children":2253},{"style":115},[2254],{"type":50,"value":617},{"type":44,"tag":92,"props":2256,"children":2257},{"style":121},[2258],{"type":50,"value":2259},"startTime",{"type":44,"tag":92,"props":2261,"children":2262},{"style":115},[2263],{"type":50,"value":1249},{"type":44,"tag":92,"props":2265,"children":2266},{"style":142},[2267],{"type":50,"value":2268},"ms",{"type":44,"tag":92,"props":2270,"children":2271},{"style":115},[2272],{"type":50,"value":1074},{"type":44,"tag":92,"props":2274,"children":2275},{"style":415},[2276],{"type":50,"value":212},{"type":44,"tag":92,"props":2278,"children":2279},{"style":115},[2280],{"type":50,"value":155},{"type":44,"tag":92,"props":2282,"children":2284},{"class":94,"line":2283},21,[2285],{"type":44,"tag":92,"props":2286,"children":2287},{"emptyLinePlaceholder":162},[2288],{"type":50,"value":165},{"type":44,"tag":92,"props":2290,"children":2292},{"class":94,"line":2291},22,[2293,2297,2301],{"type":44,"tag":92,"props":2294,"children":2295},{"style":109},[2296],{"type":50,"value":673},{"type":44,"tag":92,"props":2298,"children":2299},{"style":121},[2300],{"type":50,"value":2118},{"type":44,"tag":92,"props":2302,"children":2303},{"style":115},[2304],{"type":50,"value":155},{"type":44,"tag":92,"props":2306,"children":2308},{"class":94,"line":2307},23,[2309],{"type":44,"tag":92,"props":2310,"children":2311},{"style":115},[2312],{"type":50,"value":717},{"type":44,"tag":92,"props":2314,"children":2316},{"class":94,"line":2315},24,[2317,2321],{"type":44,"tag":92,"props":2318,"children":2319},{"style":121},[2320],{"type":50,"value":212},{"type":44,"tag":92,"props":2322,"children":2323},{"style":115},[2324],{"type":50,"value":155},{"type":44,"tag":53,"props":2326,"children":2328},{"id":2327},"guidelines",[2329],{"type":50,"value":2330},"Guidelines",{"type":44,"tag":2332,"props":2333,"children":2334},"ul",{},[2335,2341,2346,2358,2363,2368],{"type":44,"tag":2336,"props":2337,"children":2338},"li",{},[2339],{"type":50,"value":2340},"Services cannot be nested within other services",{"type":44,"tag":2336,"props":2342,"children":2343},{},[2344],{"type":50,"value":2345},"Start with one service, split when there's a clear reason",{"type":44,"tag":2336,"props":2347,"children":2348},{},[2349,2351,2356],{"type":50,"value":2350},"Use ",{"type":44,"tag":73,"props":2352,"children":2354},{"className":2353},[],[2355],{"type":50,"value":315},{"type":50,"value":2357}," for cross-service calls (never direct imports)",{"type":44,"tag":2336,"props":2359,"children":2360},{},[2361],{"type":50,"value":2362},"Each service can have its own database",{"type":44,"tag":2336,"props":2364,"children":2365},{},[2366],{"type":50,"value":2367},"Service names should be lowercase, descriptive",{"type":44,"tag":2336,"props":2369,"children":2370},{},[2371],{"type":50,"value":2372},"Don't create services just for code organization - use folders instead",{"type":44,"tag":2374,"props":2375,"children":2376},"style",{},[2377],{"type":50,"value":2378},"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":2380,"total":2551},[2381,2391,2403,2421,2437,2449,2465,2480,2497,2514,2526,2537],{"slug":2382,"name":2382,"fn":2383,"description":2384,"org":2385,"tags":2386,"stars":24,"repoUrl":25,"updatedAt":2390},"encore-api","build type-safe APIs with Encore","Define typed API endpoints in Encore.ts using `api(...)` from `encore.dev\u002Fapi`. Covers typed request\u002Fresponse interfaces, path\u002Fquery\u002Fheader\u002Fcookie params, request validation, and `APIError`. For raw endpoints (`api.raw()`) and inbound webhooks, use `encore-webhook` instead.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2387,2388,2389],{"name":22,"slug":23,"type":16},{"name":9,"slug":8,"type":16},{"name":18,"slug":19,"type":16},"2026-04-06T18:09:46.044101",{"slug":2392,"name":2392,"fn":2393,"description":2394,"org":2395,"tags":2396,"stars":24,"repoUrl":25,"updatedAt":2402},"encore-auth","implement Encore.ts authentication","Protect Encore.ts endpoints with authentication and authorize callers. Covers `authHandler`, `Gateway`, `getAuthData`, and `auth: true`.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2397,2400,2401],{"name":2398,"slug":2399,"type":16},"Auth","auth",{"name":9,"slug":8,"type":16},{"name":18,"slug":19,"type":16},"2026-04-06T18:09:47.336322",{"slug":2404,"name":2404,"fn":2405,"description":2406,"org":2407,"tags":2408,"stars":24,"repoUrl":25,"updatedAt":2420},"encore-bucket","store files in Encore.ts buckets","Store unstructured files in Encore.ts using `Bucket` from `encore.dev\u002Fstorage\u002Fobjects` — uploads, images, documents, blobs.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2409,2412,2413,2416,2419],{"name":2410,"slug":2411,"type":16},"Backend","backend",{"name":9,"slug":8,"type":16},{"name":2414,"slug":2415,"type":16},"File Storage","file-storage",{"name":2417,"slug":2418,"type":16},"File Uploads","file-uploads",{"name":18,"slug":19,"type":16},"2026-05-16T05:59:52.813772",{"slug":2422,"name":2422,"fn":2423,"description":2424,"org":2425,"tags":2426,"stars":24,"repoUrl":25,"updatedAt":2436},"encore-cache","cache data in Redis with Encore.ts","Cache data in Redis from Encore.ts using `CacheCluster` and typed keyspaces from `encore.dev\u002Fstorage\u002Fcache`. Type-safe key\u002Fvalue access with TTLs, atomic increments, and per-keyspace data shapes.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2427,2428,2431,2432,2435],{"name":2410,"slug":2411,"type":16},{"name":2429,"slug":2430,"type":16},"Caching","caching",{"name":9,"slug":8,"type":16},{"name":2433,"slug":2434,"type":16},"Redis","redis",{"name":18,"slug":19,"type":16},"2026-05-16T05:59:56.808328",{"slug":2438,"name":2438,"fn":2439,"description":2440,"org":2441,"tags":2442,"stars":24,"repoUrl":25,"updatedAt":2448},"encore-code-review","review Encore.ts code","Review existing Encore.ts code for best practices and common anti-patterns.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2443,2446,2447],{"name":2444,"slug":2445,"type":16},"Code Review","code-review",{"name":9,"slug":8,"type":16},{"name":18,"slug":19,"type":16},"2026-04-06T18:10:01.123999",{"slug":2450,"name":2450,"fn":2451,"description":2452,"org":2453,"tags":2454,"stars":24,"repoUrl":25,"updatedAt":2464},"encore-cron","schedule recurring jobs in Encore.ts","Schedule periodic \u002F recurring work in Encore.ts using `CronJob` from `encore.dev\u002Fcron`. Covers `every: \"1h\"` interval syntax and `schedule: \"0 9 * * 1\"` cron expressions.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2455,2458,2459,2460,2463],{"name":2456,"slug":2457,"type":16},"Automation","automation",{"name":2410,"slug":2411,"type":16},{"name":9,"slug":8,"type":16},{"name":2461,"slug":2462,"type":16},"Scheduling","scheduling",{"name":18,"slug":19,"type":16},"2026-05-16T05:59:54.146651",{"slug":2466,"name":2466,"fn":2467,"description":2468,"org":2469,"tags":2470,"stars":24,"repoUrl":25,"updatedAt":2479},"encore-database","build Encore databases","Work with PostgreSQL in Encore.ts using `SQLDatabase` from `encore.dev\u002Fstorage\u002Fsqldb` — schema migrations and SQL queries.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2471,2474,2475,2478],{"name":2472,"slug":2473,"type":16},"Database","database",{"name":9,"slug":8,"type":16},{"name":2476,"slug":2477,"type":16},"ORM","orm",{"name":18,"slug":19,"type":16},"2026-04-06T18:09:54.823017",{"slug":2481,"name":2481,"fn":2482,"description":2483,"org":2484,"tags":2485,"stars":24,"repoUrl":25,"updatedAt":2496},"encore-frontend","connect frontend to Encore backend","Connect a frontend application (React, Next.js, Vue, Svelte, etc.) to an Encore.ts backend.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2486,2487,2490,2493],{"name":9,"slug":8,"type":16},{"name":2488,"slug":2489,"type":16},"Frontend","frontend",{"name":2491,"slug":2492,"type":16},"Next.js","next-js",{"name":2494,"slug":2495,"type":16},"React","react","2026-04-06T18:09:56.091006",{"slug":2498,"name":2498,"fn":2499,"description":2500,"org":2501,"tags":2502,"stars":24,"repoUrl":25,"updatedAt":2513},"encore-getting-started","build and run applications with Encore.ts","Bootstrap a brand-new Encore.ts project from zero. Only for first-time CLI install and `encore app create` — not for architecture or feature questions.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2503,2504,2505,2506,2509,2510],{"name":22,"slug":23,"type":16},{"name":2410,"slug":2411,"type":16},{"name":9,"slug":8,"type":16},{"name":2507,"slug":2508,"type":16},"Local Development","local-development",{"name":18,"slug":19,"type":16},{"name":2511,"slug":2512,"type":16},"Web Development","web-development","2026-04-06T18:10:04.885446",{"slug":2515,"name":2515,"fn":2516,"description":2517,"org":2518,"tags":2519,"stars":24,"repoUrl":25,"updatedAt":2525},"encore-go-api","build APIs with Encore Go","Define typed API endpoints in Encore Go using `\u002F\u002Fencore:api` annotations. Covers typed request\u002Fresponse structs, path\u002Fquery\u002Fheader\u002Fcookie params, and error returns. For raw endpoints (`\u002F\u002Fencore:api raw`) and inbound webhooks, use `encore-go-webhook` instead.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2520,2521,2522],{"name":22,"slug":23,"type":16},{"name":9,"slug":8,"type":16},{"name":2523,"slug":2524,"type":16},"Go","go","2026-04-06T18:09:48.578781",{"slug":2527,"name":2527,"fn":2528,"description":2529,"org":2530,"tags":2531,"stars":24,"repoUrl":25,"updatedAt":2536},"encore-go-auth","implement authentication with Encore Go","Protect Encore Go endpoints with authentication and authorize callers. Covers `auth.AuthHandler`, `auth.UserID`, the `Authorization` header, and `\u002F\u002Fencore:api auth`.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2532,2533,2534,2535],{"name":2398,"slug":2399,"type":16},{"name":2410,"slug":2411,"type":16},{"name":9,"slug":8,"type":16},{"name":2523,"slug":2524,"type":16},"2026-04-06T18:09:51.065102",{"slug":2538,"name":2538,"fn":2539,"description":2540,"org":2541,"tags":2542,"stars":24,"repoUrl":25,"updatedAt":2550},"encore-go-bucket","store files in Encore Go buckets","Store unstructured files in Encore Go using `objects.NewBucket` from `encore.dev\u002Fstorage\u002Fobjects` — uploads, images, documents, blobs.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2543,2544,2545,2546,2547],{"name":2410,"slug":2411,"type":16},{"name":9,"slug":8,"type":16},{"name":2414,"slug":2415,"type":16},{"name":2523,"slug":2524,"type":16},{"name":2548,"slug":2549,"type":16},"Storage","storage","2026-05-16T06:00:03.633918",28,{"items":2553,"total":2551},[2554,2560,2566,2574,2582,2588,2596],{"slug":2382,"name":2382,"fn":2383,"description":2384,"org":2555,"tags":2556,"stars":24,"repoUrl":25,"updatedAt":2390},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2557,2558,2559],{"name":22,"slug":23,"type":16},{"name":9,"slug":8,"type":16},{"name":18,"slug":19,"type":16},{"slug":2392,"name":2392,"fn":2393,"description":2394,"org":2561,"tags":2562,"stars":24,"repoUrl":25,"updatedAt":2402},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2563,2564,2565],{"name":2398,"slug":2399,"type":16},{"name":9,"slug":8,"type":16},{"name":18,"slug":19,"type":16},{"slug":2404,"name":2404,"fn":2405,"description":2406,"org":2567,"tags":2568,"stars":24,"repoUrl":25,"updatedAt":2420},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2569,2570,2571,2572,2573],{"name":2410,"slug":2411,"type":16},{"name":9,"slug":8,"type":16},{"name":2414,"slug":2415,"type":16},{"name":2417,"slug":2418,"type":16},{"name":18,"slug":19,"type":16},{"slug":2422,"name":2422,"fn":2423,"description":2424,"org":2575,"tags":2576,"stars":24,"repoUrl":25,"updatedAt":2436},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2577,2578,2579,2580,2581],{"name":2410,"slug":2411,"type":16},{"name":2429,"slug":2430,"type":16},{"name":9,"slug":8,"type":16},{"name":2433,"slug":2434,"type":16},{"name":18,"slug":19,"type":16},{"slug":2438,"name":2438,"fn":2439,"description":2440,"org":2583,"tags":2584,"stars":24,"repoUrl":25,"updatedAt":2448},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2585,2586,2587],{"name":2444,"slug":2445,"type":16},{"name":9,"slug":8,"type":16},{"name":18,"slug":19,"type":16},{"slug":2450,"name":2450,"fn":2451,"description":2452,"org":2589,"tags":2590,"stars":24,"repoUrl":25,"updatedAt":2464},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2591,2592,2593,2594,2595],{"name":2456,"slug":2457,"type":16},{"name":2410,"slug":2411,"type":16},{"name":9,"slug":8,"type":16},{"name":2461,"slug":2462,"type":16},{"name":18,"slug":19,"type":16},{"slug":2466,"name":2466,"fn":2467,"description":2468,"org":2597,"tags":2598,"stars":24,"repoUrl":25,"updatedAt":2479},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2599,2600,2601,2602],{"name":2472,"slug":2473,"type":16},{"name":9,"slug":8,"type":16},{"name":2476,"slug":2477,"type":16},{"name":18,"slug":19,"type":16}]