[{"data":1,"prerenderedAt":3695},["ShallowReactive",2],{"navigation_docs":3,"-developers-architecture":613,"-developers-architecture-surround":3692},[4,39,101,378,540,562,584,606],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":38},"Start","i-lucide-rocket","\u002Fstart","1.start",[10,14,18,22,26,30,34],{"title":11,"path":12,"stem":13},"Our approach","\u002Fstart\u002Four-approach","1.start\u002F0.our-approach",{"title":15,"path":16,"stem":17},"Introduction","\u002Fstart\u002Fintroduction","1.start\u002F1.introduction",{"title":19,"path":20,"stem":21},"Concepts","\u002Fstart\u002Fconcepts","1.start\u002F2.concepts",{"title":23,"path":24,"stem":25},"Glossary","\u002Fstart\u002Fglossary","1.start\u002F3.glossary",{"title":27,"path":28,"stem":29},"Try it locally","\u002Fstart\u002Ftry-it-locally","1.start\u002F4.try-it-locally",{"title":31,"path":32,"stem":33},"Features","\u002Fstart\u002Ffeatures","1.start\u002F5.features",{"title":35,"path":36,"stem":37},"Questions","\u002Fstart\u002Ffaq","1.start\u002F6.faq",false,{"title":40,"icon":41,"path":42,"stem":43,"children":44,"page":38},"Run SHADE","i-lucide-server","\u002Frun","2.run",[45,49,53,57,61,65,69,73,77,81,85,89,93,97],{"title":46,"path":47,"stem":48},"Setting up an instance (Coolify)","\u002Frun\u002Fcoolify","2.run\u002F1.coolify",{"title":50,"path":51,"stem":52},"Console commands","\u002Frun\u002Fconsole","2.run\u002F10.console",{"title":54,"path":55,"stem":56},"Rotating APP_SECRET","\u002Frun\u002Frotating-app-secret","2.run\u002F11.rotating-app-secret",{"title":58,"path":59,"stem":60},"Checking an instance","\u002Frun\u002Fdoctor","2.run\u002F12.doctor",{"title":62,"path":63,"stem":64},"Self-hosting by hand","\u002Frun\u002Fown-server-by-hand","2.run\u002F13.own-server-by-hand",{"title":66,"path":67,"stem":68},"NixOS (experimental)","\u002Frun\u002Fnixos","2.run\u002F14.nixos",{"title":70,"path":71,"stem":72},"Self-hosting without Coolify","\u002Frun\u002Fown-server","2.run\u002F2.own-server",{"title":74,"path":75,"stem":76},"Hosting the site on a static host","\u002Frun\u002Fstatic-hosts","2.run\u002F3.static-hosts",{"title":78,"path":79,"stem":80},"Licence","\u002Frun\u002Flicence","2.run\u002F4.licence",{"title":82,"path":83,"stem":84},"Updating and backups","\u002Frun\u002Fupdating-and-backups","2.run\u002F5.updating-and-backups",{"title":86,"path":87,"stem":88},"Troubleshooting","\u002Frun\u002Ftroubleshooting","2.run\u002F6.troubleshooting",{"title":90,"path":91,"stem":92},"Logs, request ids, traces and metrics","\u002Frun\u002Flogs","2.run\u002F7.logs",{"title":94,"path":95,"stem":96},"Maintenance mode","\u002Frun\u002Fmaintenance-mode","2.run\u002F8.maintenance-mode",{"title":98,"path":99,"stem":100},"Usage limits","\u002Frun\u002Fusage-limits","2.run\u002F9.usage-limits",{"title":102,"icon":103,"path":104,"stem":105,"children":106},"Guide","i-lucide-book-open","\u002Fguide","3.guide",[107,109,147,192,210,280,310,364],{"title":102,"path":104,"stem":108},"3.guide\u002Findex",{"title":110,"icon":111,"path":112,"stem":113,"children":114,"page":38},"Content","i-lucide-file-text","\u002Fguide\u002Fcontent","3.guide\u002F1.content",[115,119,123,127,131,135,139,143],{"title":116,"path":117,"stem":118},"Collections and entries","\u002Fguide\u002Fcontent\u002Fcollections","3.guide\u002F1.content\u002F1.collections",{"title":120,"path":121,"stem":122},"Field types","\u002Fguide\u002Fcontent\u002Ffields","3.guide\u002F1.content\u002F2.fields",{"title":124,"path":125,"stem":126},"Drafts, publishing and version history","\u002Fguide\u002Fcontent\u002Fversions","3.guide\u002F1.content\u002F3.versions",{"title":128,"path":129,"stem":130},"Languages","\u002Fguide\u002Fcontent\u002Flanguages","3.guide\u002F1.content\u002F4.languages",{"title":132,"path":133,"stem":134},"Data sources","\u002Fguide\u002Fcontent\u002Fdata-sources","3.guide\u002F1.content\u002F5.data-sources",{"title":136,"path":137,"stem":138},"Media","\u002Fguide\u002Fcontent\u002Fmedia","3.guide\u002F1.content\u002F6.media",{"title":140,"path":141,"stem":142},"Search","\u002Fguide\u002Fcontent\u002Fsearch","3.guide\u002F1.content\u002F7.search",{"title":144,"path":145,"stem":146},"Trash","\u002Fguide\u002Fcontent\u002Ftrash","3.guide\u002F1.content\u002F8.trash",{"title":148,"icon":149,"path":150,"stem":151,"children":152,"page":38},"Website","i-lucide-globe","\u002Fguide\u002Fwebsite","3.guide\u002F2.website",[153,156,160,164,168,172,176,180,184,188],{"title":148,"path":154,"stem":155},"\u002Fguide\u002Fwebsite\u002Fwebsite","3.guide\u002F2.website\u002F1.website",{"title":157,"path":158,"stem":159},"Scroll scenes","\u002Fguide\u002Fwebsite\u002Fscroll-scenes","3.guide\u002F2.website\u002F10.scroll-scenes",{"title":161,"path":162,"stem":163},"Pages and posts","\u002Fguide\u002Fwebsite\u002Fpages","3.guide\u002F2.website\u002F2.pages",{"title":165,"path":166,"stem":167},"The visual editor","\u002Fguide\u002Fwebsite\u002Fvisual-editor","3.guide\u002F2.website\u002F3.visual-editor",{"title":169,"path":170,"stem":171},"Roles and locks","\u002Fguide\u002Fwebsite\u002Froles-and-locks","3.guide\u002F2.website\u002F4.roles-and-locks",{"title":173,"path":174,"stem":175},"Header and footer","\u002Fguide\u002Fwebsite\u002Fheader-and-footer","3.guide\u002F2.website\u002F5.header-and-footer",{"title":177,"path":178,"stem":179},"Theme","\u002Fguide\u002Fwebsite\u002Ftheme","3.guide\u002F2.website\u002F6.theme",{"title":181,"path":182,"stem":183},"Redirects","\u002Fguide\u002Fwebsite\u002Fredirects","3.guide\u002F2.website\u002F7.redirects",{"title":185,"path":186,"stem":187},"Site settings","\u002Fguide\u002Fwebsite\u002Fsite-settings","3.guide\u002F2.website\u002F8.site-settings",{"title":189,"path":190,"stem":191},"The site","\u002Fguide\u002Fwebsite\u002Fthe-site","3.guide\u002F2.website\u002F9.the-site",{"title":193,"icon":194,"path":195,"stem":196,"children":197,"page":38},"Publishing","i-lucide-send","\u002Fguide\u002Fpublishing","3.guide\u002F3.publishing",[198,202,206],{"title":199,"path":200,"stem":201},"Publishing and preview","\u002Fguide\u002Fpublishing\u002Fpublishing","3.guide\u002F3.publishing\u002F1.publishing",{"title":203,"path":204,"stem":205},"Builds","\u002Fguide\u002Fpublishing\u002Fbuilds","3.guide\u002F3.publishing\u002F2.builds",{"title":207,"path":208,"stem":209},"CDN caches","\u002Fguide\u002Fpublishing\u002Fcaches","3.guide\u002F3.publishing\u002F3.caches",{"title":211,"icon":212,"path":213,"stem":214,"children":215,"page":38},"People, security and privacy","i-lucide-shield","\u002Fguide\u002Fpeople-and-security","3.guide\u002F4.people-and-security",[216,220,224,228,232,236,240,244,248,252,256,260,264,268,272,276],{"title":217,"path":218,"stem":219},"People in SHADE","\u002Fguide\u002Fpeople-and-security\u002Fpeople-in-shade","3.guide\u002F4.people-and-security\u002F0.people-in-shade",{"title":221,"path":222,"stem":223},"Team and roles","\u002Fguide\u002Fpeople-and-security\u002Fteam","3.guide\u002F4.people-and-security\u002F1.team",{"title":225,"path":226,"stem":227},"Errors and security alerts","\u002Fguide\u002Fpeople-and-security\u002Ferrors","3.guide\u002F4.people-and-security\u002F10.errors",{"title":229,"path":230,"stem":231},"Exporting an instance","\u002Fguide\u002Fpeople-and-security\u002Fexporting","3.guide\u002F4.people-and-security\u002F11.exporting",{"title":233,"path":234,"stem":235},"Organisations","\u002Fguide\u002Fpeople-and-security\u002Forganisations","3.guide\u002F4.people-and-security\u002F12.organisations",{"title":237,"path":238,"stem":239},"Signing in through an identity provider (team)","\u002Fguide\u002Fpeople-and-security\u002Fidentity-providers","3.guide\u002F4.people-and-security\u002F13.identity-providers",{"title":241,"path":242,"stem":243},"System status","\u002Fguide\u002Fpeople-and-security\u002Fsystem-status","3.guide\u002F4.people-and-security\u002F14.system-status",{"title":245,"path":246,"stem":247},"Appearance","\u002Fguide\u002Fpeople-and-security\u002Fappearance","3.guide\u002F4.people-and-security\u002F15.appearance",{"title":249,"path":250,"stem":251},"Accounts and personal pages","\u002Fguide\u002Fpeople-and-security\u002Faccounts","3.guide\u002F4.people-and-security\u002F2.accounts",{"title":253,"path":254,"stem":255},"Signing in (team)","\u002Fguide\u002Fpeople-and-security\u002Fsign-in","3.guide\u002F4.people-and-security\u002F3.sign-in",{"title":257,"path":258,"stem":259},"API tokens","\u002Fguide\u002Fpeople-and-security\u002Fapi-tokens","3.guide\u002F4.people-and-security\u002F4.api-tokens",{"title":261,"path":262,"stem":263},"Audit log","\u002Fguide\u002Fpeople-and-security\u002Faudit","3.guide\u002F4.people-and-security\u002F5.audit",{"title":265,"path":266,"stem":267},"Request protection","\u002Fguide\u002Fpeople-and-security\u002Fprotection","3.guide\u002F4.people-and-security\u002F6.protection",{"title":269,"path":270,"stem":271},"Personal data per person","\u002Fguide\u002Fpeople-and-security\u002Fprivacy","3.guide\u002F4.people-and-security\u002F7.privacy",{"title":273,"path":274,"stem":275},"Data retention","\u002Fguide\u002Fpeople-and-security\u002Fretention","3.guide\u002F4.people-and-security\u002F8.retention",{"title":277,"path":278,"stem":279},"Consent banner","\u002Fguide\u002Fpeople-and-security\u002Fconsent","3.guide\u002F4.people-and-security\u002F9.consent",{"title":281,"icon":282,"path":283,"stem":284,"children":285,"page":38},"Services","i-lucide-plug","\u002Fguide\u002Fservices","3.guide\u002F5.services",[286,290,294,298,302,306],{"title":287,"path":288,"stem":289},"Email","\u002Fguide\u002Fservices\u002Femail","3.guide\u002F5.services\u002F1.email",{"title":291,"path":292,"stem":293},"Opening hours","\u002Fguide\u002Fservices\u002Fopening-hours","3.guide\u002F5.services\u002F4.opening-hours",{"title":295,"path":296,"stem":297},"Webhooks","\u002Fguide\u002Fservices\u002Fwebhooks","3.guide\u002F5.services\u002F5.webhooks",{"title":299,"path":300,"stem":301},"Locations","\u002Fguide\u002Fservices\u002Flocations","3.guide\u002F5.services\u002F6.locations",{"title":303,"path":304,"stem":305},"VAT rates","\u002Fguide\u002Fservices\u002Fvat-rates","3.guide\u002F5.services\u002F7.vat-rates",{"title":307,"path":308,"stem":309},"Channels","\u002Fguide\u002Fservices\u002Fchannels","3.guide\u002F5.services\u002F8.channels",{"title":311,"icon":312,"path":313,"stem":314,"children":315,"page":38},"InstalledModules","i-lucide-puzzle","\u002Fguide\u002Fmodules","3.guide\u002F6.modules",[316,320,324,328,332,336,340,344,348,352,356,360],{"title":317,"path":318,"stem":319},"Modules","\u002Fguide\u002Fmodules\u002Fmanaging","3.guide\u002F6.modules\u002F1.managing",{"title":321,"path":322,"stem":323},"Dutch services (module)","\u002Fguide\u002Fmodules\u002Fnl","3.guide\u002F6.modules\u002F10.nl",{"title":325,"path":326,"stem":327},"Editorial (module)","\u002Fguide\u002Fmodules\u002Feditorial","3.guide\u002F6.modules\u002F11.editorial",{"title":329,"path":330,"stem":331},"Appointments (module)","\u002Fguide\u002Fmodules\u002Fappointments","3.guide\u002F6.modules\u002F2.appointments",{"title":333,"path":334,"stem":335},"Shop (the commerce module)","\u002Fguide\u002Fmodules\u002Fshop","3.guide\u002F6.modules\u002F3.shop",{"title":337,"path":338,"stem":339},"Untrusted modules","\u002Fguide\u002Fmodules\u002Funtrusted","3.guide\u002F6.modules\u002F4.untrusted",{"title":341,"path":342,"stem":343},"Analytics (module)","\u002Fguide\u002Fmodules\u002Fanalytics","3.guide\u002F6.modules\u002F5.analytics",{"title":345,"path":346,"stem":347},"Error forwarding (module)","\u002Fguide\u002Fmodules\u002Ferror-forwarding","3.guide\u002F6.modules\u002F6.error-forwarding",{"title":349,"path":350,"stem":351},"Client programs","\u002Fguide\u002Fmodules\u002Fprograms","3.guide\u002F6.modules\u002F7.programs",{"title":353,"path":354,"stem":355},"Import and export (module)","\u002Fguide\u002Fmodules\u002Fimport","3.guide\u002F6.modules\u002F8.import",{"title":357,"path":358,"stem":359},"Payments (module)","\u002Fguide\u002Fmodules\u002Fpayments","3.guide\u002F6.modules\u002F8.payments",{"title":361,"path":362,"stem":363},"Forms (module)","\u002Fguide\u002Fmodules\u002Fforms","3.guide\u002F6.modules\u002F9.forms",{"title":365,"icon":366,"path":367,"stem":368,"children":369,"page":38},"AI assistants","i-lucide-bot","\u002Fguide\u002Fai","3.guide\u002F7.ai",[370,374],{"title":371,"path":372,"stem":373},"AI assistants (MCP)","\u002Fguide\u002Fai\u002Fassistants","3.guide\u002F7.ai\u002F1.assistants",{"title":375,"path":376,"stem":377},"Connecting an AI assistant","\u002Fguide\u002Fai\u002Fconnecting","3.guide\u002F7.ai\u002F2.connecting",{"title":379,"icon":380,"path":381,"stem":382,"children":383,"page":38},"Developers","i-lucide-code","\u002Fdevelopers","4.developers",[384,388,392,396,400,404,408,412,416,420,424,428,432,435,489,493,497,501,536],{"title":385,"path":386,"stem":387},"Architecture","\u002Fdevelopers\u002Farchitecture","4.developers\u002F1.architecture",{"title":389,"path":390,"stem":391},"Capabilities","\u002Fdevelopers\u002Fcapabilities","4.developers\u002F10.capabilities",{"title":393,"path":394,"stem":395},"Trust","\u002Fdevelopers\u002Ftrust","4.developers\u002F11.trust",{"title":397,"path":398,"stem":399},"Redis and the ports","\u002Fdevelopers\u002Fredis","4.developers\u002F12.redis",{"title":401,"path":402,"stem":403},"The worker container role","\u002Fdevelopers\u002Fworker","4.developers\u002F13.worker",{"title":405,"path":406,"stem":407},"kv: a module's own key-value storage","\u002Fdevelopers\u002Fkv","4.developers\u002F14.kv",{"title":409,"path":410,"stem":411},"Processes: long-running work on the worker","\u002Fdevelopers\u002Fprocesses","4.developers\u002F15.processes",{"title":413,"path":414,"stem":415},"Network: a module's outgoing calls","\u002Fdevelopers\u002Fnetwork","4.developers\u002F16.network",{"title":417,"path":418,"stem":419},"Realtime","\u002Fdevelopers\u002Frealtime","4.developers\u002F17.realtime",{"title":421,"path":422,"stem":423},"Private files","\u002Fdevelopers\u002Ffiles","4.developers\u002F18.files",{"title":425,"path":426,"stem":427},"Notify","\u002Fdevelopers\u002Fnotify","4.developers\u002F19.notify",{"title":429,"path":430,"stem":431},"Collections","\u002Fdevelopers\u002Fcollections","4.developers\u002F2.collections",{"title":337,"path":433,"stem":434},"\u002Fdevelopers\u002Funtrusted","4.developers\u002F20.untrusted",{"title":436,"icon":312,"path":437,"stem":438,"children":439},"Writing a plugin","\u002Fdevelopers\u002Fmodules","4.developers\u002F3.modules\u002Findex",[440,442,446,450,454,458,462,466,470,473,477,481,485],{"title":441,"path":437,"stem":438},"Writing a module",{"title":443,"path":444,"stem":445},"Module SDK and tooling","\u002Fdevelopers\u002Fmodules\u002Fsdk-and-tooling","4.developers\u002F3.modules\u002F1.sdk-and-tooling",{"title":447,"path":448,"stem":449},"Connecting accounts with OAuth2","\u002Fdevelopers\u002Fmodules\u002Foauth","4.developers\u002F3.modules\u002F10.oauth",{"title":451,"path":452,"stem":453},"Calls between modules","\u002Fdevelopers\u002Fmodules\u002Fcalls-between-modules","4.developers\u002F3.modules\u002F11.calls-between-modules",{"title":455,"path":456,"stem":457},"Experimental parts","\u002Fdevelopers\u002Fmodules\u002Fexperimental-parts","4.developers\u002F3.modules\u002F12.experimental-parts",{"title":459,"path":460,"stem":461},"The manifest","\u002Fdevelopers\u002Fmodules\u002Fmanifest","4.developers\u002F3.modules\u002F2.manifest",{"title":463,"path":464,"stem":465},"Routes","\u002Fdevelopers\u002Fmodules\u002Froutes","4.developers\u002F3.modules\u002F3.routes",{"title":467,"path":468,"stem":469},"Admin screens and the site part","\u002Fdevelopers\u002Fmodules\u002Fadmin-and-site","4.developers\u002F3.modules\u002F4.admin-and-site",{"title":110,"path":471,"stem":472},"\u002Fdevelopers\u002Fmodules\u002Fcontent","4.developers\u002F3.modules\u002F5.content",{"title":474,"path":475,"stem":476},"Background work and services","\u002Fdevelopers\u002Fmodules\u002Fbackground-and-services","4.developers\u002F3.modules\u002F6.background-and-services",{"title":478,"path":479,"stem":480},"SDK reference","\u002Fdevelopers\u002Fmodules\u002Fsdk-reference","4.developers\u002F3.modules\u002F7.sdk-reference",{"title":482,"path":483,"stem":484},"The website module's SDK","\u002Fdevelopers\u002Fmodules\u002Fwebsite-sdk","4.developers\u002F3.modules\u002F8.website-sdk",{"title":486,"path":487,"stem":488},"Incoming webhooks","\u002Fdevelopers\u002Fmodules\u002Fincoming-webhooks","4.developers\u002F3.modules\u002F9.incoming-webhooks",{"title":490,"path":491,"stem":492},"Core and the website module","\u002Fdevelopers\u002Fcore-and-website-module","4.developers\u002F4.core-and-website-module",{"title":494,"path":495,"stem":496},"The API","\u002Fdevelopers\u002Fapi","4.developers\u002F6.api",{"title":498,"path":499,"stem":500},"API reference","\u002Fdevelopers\u002Fapi-reference","4.developers\u002F6.api-reference",{"title":502,"icon":503,"path":504,"stem":505,"children":506},"Sites in other frameworks","i-lucide-layout-template","\u002Fdevelopers\u002Fframeworks","4.developers\u002F7.frameworks\u002Findex",[507,508,512,516,520,524,528,532],{"title":502,"path":504,"stem":505},{"title":509,"path":510,"stem":511},"Accounts: sign-in and modules' routes","\u002Fdevelopers\u002Fframeworks\u002Faccounts","4.developers\u002F7.frameworks\u002F1.accounts",{"title":513,"path":514,"stem":515},"`@shadestack\u002Ftree`","\u002Fdevelopers\u002Fframeworks\u002Ftree","4.developers\u002F7.frameworks\u002F2.tree",{"title":517,"path":518,"stem":519},"Expressions and styles","\u002Fdevelopers\u002Fframeworks\u002Fexpressions-and-styles","4.developers\u002F7.frameworks\u002F3.expressions-and-styles",{"title":521,"path":522,"stem":523},"`@shadestack\u002Frender`","\u002Fdevelopers\u002Fframeworks\u002Frender","4.developers\u002F7.frameworks\u002F4.render",{"title":525,"path":526,"stem":527},"`@shadestack\u002Finteractions`","\u002Fdevelopers\u002Fframeworks\u002Finteractions","4.developers\u002F7.frameworks\u002F5.interactions",{"title":529,"path":530,"stem":531},"`@shadestack\u002Fa11y`","\u002Fdevelopers\u002Fframeworks\u002Fa11y","4.developers\u002F7.frameworks\u002F6.a11y",{"title":533,"path":534,"stem":535},"Your own page for SHADE's links","\u002Fdevelopers\u002Fframeworks\u002Flinks","4.developers\u002F7.frameworks\u002F7.links",{"title":537,"path":538,"stem":539},"Build a client module","\u002Fdevelopers\u002Fclient-module","4.developers\u002F9.client-module",{"title":541,"icon":542,"path":543,"stem":544,"children":545,"page":38},"Security","i-lucide-shield-check","\u002Fsecurity","5.security",[546,550,554,558],{"title":547,"path":548,"stem":549},"Reporting a vulnerability","\u002Fsecurity\u002Freporting","5.security\u002F0.reporting",{"title":551,"path":552,"stem":553},"Security testing","\u002Fsecurity\u002Ftesting","5.security\u002F1.testing",{"title":555,"path":556,"stem":557},"Hardening a production instance","\u002Fsecurity\u002Fhardening","5.security\u002F2.hardening",{"title":559,"path":560,"stem":561},"Manual testing with Kali Linux","\u002Fsecurity\u002Fmanual-testing","5.security\u002F3.manual-testing",{"title":563,"icon":564,"path":565,"stem":566,"children":567,"page":38},"Contributing","i-lucide-git-pull-request","\u002Fcontributing","6.contributing",[568,572,576,580],{"title":569,"path":570,"stem":571},"Reading the code","\u002Fcontributing\u002Freading-the-code","6.contributing\u002F1.reading-the-code",{"title":573,"path":574,"stem":575},"Docs site","\u002Fcontributing\u002Fdocs-site","6.contributing\u002F2.docs-site",{"title":577,"path":578,"stem":579},"Releases","\u002Fcontributing\u002Freleases","6.contributing\u002F3.releases",{"title":581,"path":582,"stem":583},"Load tests","\u002Fcontributing\u002Fload-tests","6.contributing\u002F4.load-tests",{"title":585,"icon":586,"path":587,"stem":588,"children":589,"page":38},"Project","i-lucide-map","\u002Fproject","7.project",[590,594,598,602],{"title":591,"path":592,"stem":593},"Roadmap","\u002Fproject\u002Froadmap","7.project\u002F1.roadmap",{"title":595,"path":596,"stem":597},"Known issues","\u002Fproject\u002Fknown-issues","7.project\u002F2.known-issues",{"title":599,"path":600,"stem":601},"Changelog","\u002Fproject\u002Fchangelog","7.project\u002F3.changelog",{"title":603,"path":604,"stem":605},"Decisions","\u002Fproject\u002Fdecisions","7.project\u002F4.decisions",{"title":607,"path":608,"stem":609,"children":610,"icon":612},"Community","\u002Fcommunity","8.community\u002Findex",[611],{"title":607,"path":608,"stem":609},"i-lucide-users",{"id":614,"title":385,"body":615,"description":668,"extension":3686,"links":3687,"meta":3688,"navigation":3689,"path":386,"seo":3690,"stem":387,"__hash__":3691},"docs\u002F4.developers\u002F1.architecture.md",{"type":616,"value":617,"toc":3676},"minimark",[618,657,662,745,752,756,770,1362,1614,1617,1788,1971,1993,2216,2238,2253,2383,2387,2398,2543,2546,2819,2822,3059,3062,3098,3118,3142,3147,3157,3179,3182,3187,3450,3456,3460,3537,3540,3543,3595,3599,3646,3672],[619,620,621,622,626,627,630,631,634,635,638,639,641,642,645,646,649,650,653,654,656],"p",{},"SHADE runs underneath client systems. The team works in a Nuxt app (",[623,624,625],"code",{},"apps\u002Fadmin","), the admin screens, which call\nthe API (",[623,628,629],{},"apps\u002Fapi",", a Hono server laid out like Laravel); visitors get a fully static Astro site\nrebuilt on publish, SHADE's own frontend in its own repository (",[623,632,633],{},"shadehq-dev\u002Fshade-site",", ",[623,636,637],{},"site\u002F"," in the SHADE\nworkspace). In production the API also serves the admin's built files, on one origin. Paths below starting with ",[623,640,637],{},"\nare in that repository. Each client runs their own instance on their own server. The reasons behind the design are\nrecorded as decision records in the ",[623,643,644],{},"shade"," repository, in ",[623,647,648],{},"docs\u002Fdecisions\u002F"," (not published on this site). New to the\ncode? Start with ",[651,652,569],"a",{"href":570},". Website editing is a module, not core:\nwhat each side holds is in ",[651,655,490],{"href":491},".",[658,659,661],"h2",{"id":660},"runtime-picture","Runtime picture",[663,664,669],"pre",{"className":665,"code":666,"language":667,"meta":668,"style":668},"language-mermaid shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","flowchart LR\n  accTitle: The runtime picture\n  accDescr: The team uses the API in the admin role, which serves the admin screens' built files, \u002Fapi\u002F*, \u002Fapi\u002Fmcp and \u002Fuploads. The site build (Astro) and the preview server read the content API with a token. The site build makes static files, which Caddy (target static) serves to visitors. The team's \u002Fpreview iframe loads the preview server (target preview). Visitors' forms and checkout go to the API in the public role: \u002Fapi\u002Fv1\u002Faccount\u002F*, plugin routes with auth 'public', and CORS for the site. Both API roles use Postgres.\n  team([The team]) --> admin[\"API, role admin\u003Cbr>admin screens (built files), \u002Fapi\u002F*, \u002Fapi\u002Fmcp, \u002Fuploads\"]\n  build[\"Site build (Astro)\"] -- \"content API (token)\" --> admin\n  build --> files[Static files] --> caddy[\"Caddy (target: static)\"]\n  visitors([Visitors]) --> caddy\n  iframe([\"The team's \u002Fpreview iframe\"]) --> preview[\"Preview server (target: preview)\"]\n  preview -- \"content API (token)\" --> admin\n  forms([\"Visitors' forms, checkout\"]) --> public[\"API, role public\u003Cbr>\u002Fapi\u002Fv1\u002Faccount\u002F*, plugin routes with auth: 'public', CORS for the site\"]\n  admin --> pg[(Postgres)]\n  public --> pg\n","mermaid","",[623,670,671,679,685,691,697,703,709,715,721,727,733,739],{"__ignoreMap":668},[672,673,676],"span",{"class":674,"line":675},"line",1,[672,677,678],{},"flowchart LR\n",[672,680,682],{"class":674,"line":681},2,[672,683,684],{},"  accTitle: The runtime picture\n",[672,686,688],{"class":674,"line":687},3,[672,689,690],{},"  accDescr: The team uses the API in the admin role, which serves the admin screens' built files, \u002Fapi\u002F*, \u002Fapi\u002Fmcp and \u002Fuploads. The site build (Astro) and the preview server read the content API with a token. The site build makes static files, which Caddy (target static) serves to visitors. The team's \u002Fpreview iframe loads the preview server (target preview). Visitors' forms and checkout go to the API in the public role: \u002Fapi\u002Fv1\u002Faccount\u002F*, plugin routes with auth 'public', and CORS for the site. Both API roles use Postgres.\n",[672,692,694],{"class":674,"line":693},4,[672,695,696],{},"  team([The team]) --> admin[\"API, role admin\u003Cbr>admin screens (built files), \u002Fapi\u002F*, \u002Fapi\u002Fmcp, \u002Fuploads\"]\n",[672,698,700],{"class":674,"line":699},5,[672,701,702],{},"  build[\"Site build (Astro)\"] -- \"content API (token)\" --> admin\n",[672,704,706],{"class":674,"line":705},6,[672,707,708],{},"  build --> files[Static files] --> caddy[\"Caddy (target: static)\"]\n",[672,710,712],{"class":674,"line":711},7,[672,713,714],{},"  visitors([Visitors]) --> caddy\n",[672,716,718],{"class":674,"line":717},8,[672,719,720],{},"  iframe([\"The team's \u002Fpreview iframe\"]) --> preview[\"Preview server (target: preview)\"]\n",[672,722,724],{"class":674,"line":723},9,[672,725,726],{},"  preview -- \"content API (token)\" --> admin\n",[672,728,730],{"class":674,"line":729},10,[672,731,732],{},"  forms([\"Visitors' forms, checkout\"]) --> public[\"API, role public\u003Cbr>\u002Fapi\u002Fv1\u002Faccount\u002F*, plugin routes with auth: 'public', CORS for the site\"]\n",[672,734,736],{"class":674,"line":735},11,[672,737,738],{},"  admin --> pg[(Postgres)]\n",[672,740,742],{"class":674,"line":741},12,[672,743,744],{},"  public --> pg\n",[619,746,747,748,751],{},"Visitors only ever load static files (pages, assets, images copied into the build). The backend sees\nthe team, one build per publish, previews, MCP, and on the ",[623,749,750],{},"public"," role visitor-facing dynamic routes and the content\nreads of server-rendered frontends (read tokens only).",[658,753,755],{"id":754},"packages","Packages",[619,757,758,759,762,763,766,767,769],{},"Shared code lives in one workspace package, ",[623,760,761],{},"@shadestack\u002Fcore"," (folder ",[623,764,765],{},"shade\u002F","), organised by feature\n(the paths are inside ",[623,768,765],{},"):",[771,772,773,786],"table",{},[774,775,776],"thead",{},[777,778,779,783],"tr",{},[780,781,782],"th",{},"Folder",[780,784,785],{},"What it holds",[787,788,789,800,810,820,838,848,857,867,880,890,900,910,920,930,958,985,1009,1030,1052,1073,1091,1108,1125,1137,1152,1168,1184,1202,1222,1238,1254,1270,1286,1299,1329,1339],"tbody",{},[777,790,791,797],{},[792,793,794],"td",{},[623,795,796],{},"kernel\u002F",[792,798,799],{},"Service context, errors, permissions, actions, common schemas",[777,801,802,807],{},[792,803,804],{},[623,805,806],{},"kernel\u002Fdb\u002F",[792,808,809],{},"The client, migrations, the test database, column helpers",[777,811,812,817],{},[792,813,814],{},[623,815,816],{},"kernel\u002Fmodules\u002F",[792,818,819],{},"The module contract and loader",[777,821,822,827],{},[792,823,824],{},[623,825,826],{},"kernel\u002Fidentity\u002F",[792,828,829,830,833,834,837],{},"The ",[623,831,832],{},"team_members"," and ",[623,835,836],{},"team_roles"," tables, the role and via enums",[777,839,840,845],{},[792,841,842],{},[623,843,844],{},"kernel\u002Fcoordination\u002F",[792,846,847],{},"The ports for work in flight in memory, leases, and messages between containers: announce, follow",[777,849,850,854],{},[792,851,852],{},[623,853,816],{},[792,855,856],{},"The module switch's table, pausing a module, and the fault boundary that measures each module and pauses one that keeps failing",[777,858,859,864],{},[792,860,861],{},[623,862,863],{},"kernel\u002Fproviders\u002F",[792,865,866],{},"The provider registry (email, accounts) and provider settings",[777,868,869,874],{},[792,870,871],{},[623,872,873],{},"business\u002F",[792,875,829,876,879],{},[623,877,878],{},"business"," module's parts (decision 0002), laid out as features are",[777,881,882,887],{},[792,883,884],{},[623,885,886],{},"business\u002Fmoney\u002F",[792,888,889],{},"The money amount type, browser-safe",[777,891,892,897],{},[792,893,894],{},[623,895,896],{},"business\u002Fmailing-lists\u002F",[792,898,899],{},"Modules' bulk mail lists, keyed to contacts; the Lists screen",[777,901,902,907],{},[792,903,904],{},[623,905,906],{},"business\u002Fholds\u002F",[792,908,909],{},"N of a module's resource until an expiry, or a time range of it; the expiry sweep; waitlists",[777,911,912,917],{},[792,913,914],{},[623,915,916],{},"business\u002Ftime-rules\u002F",[792,918,919],{},"A module's opening hours: a week of periods and exceptions, browser-safe rules and a service",[777,921,922,927],{},[792,923,924],{},[623,925,926],{},"features\u002Fcontacts\u002F",[792,928,929],{},"One contact per person, always on; the People screen",[777,931,932,937],{},[792,933,934],{},[623,935,936],{},"features\u002Fteam\u002F",[792,938,939,942,943,946,947,950,951,954,955],{},[623,940,941],{},"shared\u002F"," auth types and inputs; ",[623,944,945],{},"server\u002F"," ",[623,948,949],{},"team.sql.ts",", team and roles services, crypto; ",[623,952,953],{},"admin\u002F"," login, account, team, roles and API token screens, ",[623,956,957],{},"useSession",[777,959,960,965],{},[792,961,962],{},[623,963,964],{},"features\u002Faudit\u002F",[792,966,967,969,970,946,972,634,975,634,978,981,982,984],{},[623,968,941],{}," audit types; ",[623,971,945],{},[623,973,974],{},"audit.sql.ts",[623,976,977],{},"recordAudit",[623,979,980],{},"listAudit","; ",[623,983,953],{}," audit log",[777,986,987,992],{},[792,988,989],{},[623,990,991],{},"features\u002Fmedia\u002F",[792,993,994,996,997,946,999,1002,1003,1005,1006],{},[623,995,941],{}," media types; ",[623,998,945],{},[623,1000,1001],{},"media.sql.ts",", media service, images, storage; ",[623,1004,953],{}," media library, detail, focal point, picker, ",[623,1007,1008],{},"useMedia",[777,1010,1011,1016],{},[792,1012,1013],{},[623,1014,1015],{},"features\u002Fentries\u002F",[792,1017,1018,1020,1021,1023,1024,1026,1027],{},[623,1019,941],{}," collection definitions, fields, values, validation, table planner, built-in collections; ",[623,1022,945],{}," generated tables, collection service, mapping, filters, references, code generator; ",[623,1025,953],{}," collection list and entry screens, ",[623,1028,1029],{},"EntryForm",[777,1031,1032,1037],{},[792,1033,1034],{},[623,1035,1036],{},"features\u002Fpaths\u002F",[792,1038,1039,1041,1042,981,1045,1047,1048,1051],{},[623,1040,941],{}," public addresses, redirect paths, ",[623,1043,1044],{},"PublishedPageSummary",[623,1046,945],{}," public addresses, address sources (modules'), item paths (",[623,1049,1050],{},"itemPathsOf","), moves",[777,1053,1054,1059],{},[792,1055,1056],{},[623,1057,1058],{},"features\u002Fsettings\u002F",[792,1060,1061,1063,1064,946,1066,1069,1070,1072],{},[623,1062,941],{}," settings and language types; ",[623,1065,945],{},[623,1067,1068],{},"settings.sql.ts",", settings service; ",[623,1071,953],{}," settings screen",[777,1074,1075,1080],{},[792,1076,1077],{},[623,1078,1079],{},"features\u002Fcontent-delivery\u002F",[792,1081,1082,1084,1085,1087,1088,1090],{},[623,1083,941],{}," public read models; ",[623,1086,945],{}," public read service, rebuilds, frontends; ",[623,1089,953],{}," frontends screens",[777,1092,1093,1098],{},[792,1094,1095],{},[623,1096,1097],{},"features\u002Fdata\u002F",[792,1099,1100,634,1102,1104,1105,1107],{},[623,1101,941],{},[623,1103,945],{},": data sources; ",[623,1106,953],{},": their texts",[777,1109,1110,1115],{},[792,1111,1112],{},[623,1113,1114],{},"features\u002Fpreview\u002F",[792,1116,1117,946,1119,981,1122,1124],{},[623,1118,941],{},[623,1120,1121],{},"PreviewLink",[623,1123,945],{}," signing and reading preview tokens",[777,1126,1127,1132],{},[792,1128,1129],{},[623,1130,1131],{},"features\u002Fusage\u002F",[792,1133,1134,1136],{},[623,1135,945],{}," who uses what: media users, whether there is content; entries answers",[777,1138,1139,1144],{},[792,1140,1141],{},[623,1142,1143],{},"features\u002Fai\u002F",[792,1145,1146,1148,1149,1151],{},[623,1147,945],{}," MCP server and tools, AI changes; ",[623,1150,953],{}," AI changes screen",[777,1153,1154,1159],{},[792,1155,1156],{},[623,1157,1158],{},"features\u002Femail\u002F",[792,1160,1161,634,1163,634,1165,1167],{},[623,1162,941],{},[623,1164,945],{},[623,1166,953],{},": sending (SMTP or Brevo), the email log, the Email screen",[777,1169,1170,1175],{},[792,1171,1172],{},[623,1173,1174],{},"features\u002Ferrors\u002F",[792,1176,1177,634,1179,634,1181,1183],{},[623,1178,941],{},[623,1180,945],{},[623,1182,953],{},": the error log and security alerts, the Errors screen",[777,1185,1186,1191],{},[792,1187,1188],{},[623,1189,1190],{},"features\u002Fconsent\u002F",[792,1192,1193,634,1195,1197,1198,1201],{},[623,1194,941],{},[623,1196,945],{},": consent categories (the banner is ",[623,1199,1200],{},"@shadestack\u002Fastro","'s)",[777,1203,1204,1209],{},[792,1205,1206],{},[623,1207,1208],{},"features\u002Fkv\u002F",[792,1210,1211,1213,1214,1217,1218,1221],{},[623,1212,945],{},": every module's kv, with atomic counters (",[623,1215,1216],{},"moduleKv",", the bridge's ",[623,1219,1220],{},"kv.*",")",[777,1223,1224,1229],{},[792,1225,1226],{},[623,1227,1228],{},"features\u002Fprivacy\u002F",[792,1230,1231,634,1233,634,1235,1237],{},[623,1232,941],{},[623,1234,945],{},[623,1236,953],{},": export and deletion per person",[777,1239,1240,1245],{},[792,1241,1242],{},[623,1243,1244],{},"features\u002Fretention\u002F",[792,1246,1247,634,1249,634,1251,1253],{},[623,1248,941],{},[623,1250,945],{},[623,1252,953],{},": deleting personal data after a set period",[777,1255,1256,1261],{},[792,1257,1258],{},[623,1259,1260],{},"features\u002Fusers\u002F",[792,1262,1263,634,1265,634,1267,1269],{},[623,1264,941],{},[623,1266,945],{},[623,1268,953],{},": accounts and account roles (Better Auth)",[777,1271,1272,1277],{},[792,1273,1274],{},[623,1275,1276],{},"features\u002Fpackages\u002F",[792,1278,1279,634,1281,634,1283,1285],{},[623,1280,941],{},[623,1282,945],{},[623,1284,953],{},": switching modules on and off, their settings, the guided turn-off, untrusted modules and server packages (the modules themselves live in their own repositories)",[777,1287,1288,1293],{},[792,1289,1290],{},[623,1291,1292],{},"module-sdk\u002F",[792,1294,1295,1298],{},[623,1296,1297],{},"@shadestack\u002Fmodule-sdk",", its own package: what modules may use",[777,1300,1301,1306],{},[792,1302,1303],{},[623,1304,1305],{},"fields\u002F",[792,1307,1308,1309,1312,1313,1316,1317,1319,1320,833,1322,1324,1325,1328],{},"One folder per field type: ",[623,1310,1311],{},"shared.ts"," (descriptor, validation, columns), ",[623,1314,1315],{},"server.ts"," (mapping, filters, references), ",[623,1318,953],{}," (editor component); ",[623,1321,1311],{},[623,1323,1315],{}," are the registries; ",[623,1326,1327],{},"references.ts"," finds links and media in stored JSON",[777,1330,1331,1336],{},[792,1332,1333],{},[623,1334,1335],{},"sdk\u002F",[792,1337,1338],{},"The typed read client for the site",[777,1340,1341,1346],{},[792,1342,1343],{},[623,1344,1345],{},"exports\u002F",[792,1347,1348,1349,634,1352,634,1355,833,1358,1361],{},"The package entry points ",[623,1350,1351],{},"schema",[623,1353,1354],{},"services",[623,1356,1357],{},"plugins",[623,1359,1360],{},"tables"," (barrels over the features) and the list of the features' manifest parts",[1363,1364,1365,1446,1456,1485,1507,1545,1571,1583],"ul",{},[1366,1367,1368,1370,1371,1373,1374,1377,1378,1380,1381,1384,1385,1388,1389,833,1392,1395,1396,1399,1400,1403,1404,1407,1408,1411,1412,833,1415,1418,1419,1422,1423,1426,1427,1430,1431,1434,1435,1437,1438,1441,1442,1445],"li",{},[623,1369,941],{}," is browser-safe: types and input schemas only. ",[623,1372,945],{}," holds tables (",[623,1375,1376],{},"*.sql.ts","), services and\ntheir tests. ",[623,1379,953],{}," holds the feature's admin screens: ",[623,1382,1383],{},"pages\u002F"," (routes, Nuxt file naming), ",[623,1386,1387],{},"components\u002F",",\n",[623,1390,1391],{},"composables\u002F",[623,1393,1394],{},"utils\u002F"," (auto-imported), and ",[623,1397,1398],{},"nav.ts",", its entries in the sidebar (",[623,1401,1402],{},"defineAdminNav",": a section of\nthe main sidebar or a settings group, order, label key, icon, path, the action needed, an optional count and\nkeyboard shortcut; the shape of a module's sidebar entries), and ",[623,1405,1406],{},"entry-editor.ts",", its parts of the entry editor (",[623,1409,1410],{},"defineEntryEditorParts",": a component in the\nheader, next to Publish or above the form, given the editor's collection, entry id, language, ",[623,1413,1414],{},"save",[623,1416,1417],{},"reload",").\n",[623,1420,1421],{},"apps\u002Fadmin\u002Fmodules\u002Fshade-modules.ts"," mounts them like the app's own ",[623,1424,1425],{},"app\u002F"," folder and gathers the entries in\n",[623,1428,1429],{},"#build\u002Fshade-feature-nav.mjs",", which the layout shows, and the editor parts in ",[623,1432,1433],{},"#build\u002Fshade-entry-editor.mjs",", which\nthe entry editor shows. That is how presence and the Preview button reach the editor although entries sits below them. Core holds no Astro components: the header and footer, the responsive image, the consent\nbanner and the icon are in ",[623,1436,1200],{}," (",[623,1439,1440],{},"packages\u002Fastro\u002Fsrc\u002Fsite"," in ",[623,1443,1444],{},"shade-frontend",").",[1366,1447,1448,1449,981,1452,1455],{},"Each field type's editor component lives in ",[623,1450,1451],{},"shade\u002Ffields\u002F\u003Ckind>\u002Fadmin\u002F",[623,1453,1454],{},"shade-modules.ts"," auto-imports them too.",[1366,1457,1458,1461,1462,1464,1465,1468,1469,1472,1473,1476,1477,1480,1481,1484],{},[623,1459,1460],{},"apps\u002Fadmin\u002Fapp\u002F"," keeps the shell: layout and sidebar (its entries are the features' ",[623,1463,1398],{},"), login guard, dashboard, ",[623,1466,1467],{},"components\u002Ffield\u002FFieldRenderer.vue","\n(which picks a field's editor) with ",[623,1470,1471],{},"useFieldIssues"," (what a form tells its fields), the instance's collections\n(",[623,1474,1475],{},"useCollections","), and what several parts share or assemble: the Settings screen (",[623,1478,1479],{},"pages\u002Fsettings.vue",", the cards of\na dozen parts on one page) and ",[623,1482,1483],{},"TakeDataModal"," (signing in again before a copy of the data leaves, for the audit\nexport, backups and the instance export). The app assembles the modules, so it may use any part.",[1366,1486,1487,1488,1437,1491,1494,1495,1498,1499,1502,1503,1506],{},"A screen puts its content in ",[623,1489,1490],{},"AdminPage",[623,1492,1493],{},"apps\u002Fadmin\u002Fapp\u002Fcomponents\u002FAdminPage.vue","), which is the sheet's full width.\nFields and cards of forms and settings go in ",[623,1496,1497],{},"AdminFormGrid",": columns of at least 22 rem that fill the width, a card\nor group staying whole in one column. Running text (the ",[623,1500,1501],{},"intro",", a lead, a description) keeps a reading measure of\nabout 70 characters with the ",[623,1504,1505],{},"reading-measure"," class.",[1366,1508,1509,1510,1513,1514,1441,1517,1520,1521,1524,1525,1528,1529,1532,1533,1536,1537,1540,1541,1544],{},"Every list screen uses the shell's list pieces (",[623,1511,1512],{},"apps\u002Fadmin\u002Fapp\u002Fcomponents\u002Flist\u002F","): ",[623,1515,1516],{},"ListEmpty",[623,1518,1519],{},"UTable","'s ",[623,1522,1523],{},"#empty","\nslot (one empty state), ",[623,1526,1527],{},"ListPager"," (only with more than one page), ",[623,1530,1531],{},"ListError"," with a retry when the request failed\n(never shown as an empty list) and ",[623,1534,1535],{},"ListLoading",". 20 rows a page for content, 50 for logs and rules. The empty and\nerror states are checked with axe (",[623,1538,1539],{},"e2e\u002Ftests\u002Flists.spec.ts","); ",[623,1542,1543],{},"app.config.ts"," gives subtle alerts' text the normal\ncolours, since coloured text on their tint is below 4.5:1.",[1366,1546,1547,1548,1551,1552,1555,1556,1559,1560,1563,1564,1567,1568,656],{},"Every admin screen names the action it needs (",[623,1549,1550],{},"definePageMeta({ can })",", checked by ",[623,1553,1554],{},"middleware\u002Fauth.global.ts","),\nthe same one its sidebar link requires, and a screen with a form asks before leaving unsaved changes\n(",[623,1557,1558],{},"useUnsavedGuard","; a settings screen through ",[623,1561,1562],{},"useSettingsForm",", its draft and whether it changed). A request runs\nthrough ",[623,1565,1566],{},"useApiAction"," (busy while it runs, its failure as a toast with the API's message or on the form's fields)\nand a paginated list through ",[623,1569,1570],{},"useApiList",[1366,1572,1573,1574,1576,1577,1579,1580,1582],{},"Inside ",[623,1575,765],{},", files import each other directly by relative path, never through ",[623,1578,1345],{},". Modules are the\nexception: they import SHADE only through ",[623,1581,1297],{},", never a path out of their own folder.",[1366,1584,1585,1586,1588,1589,1592,1593,1596,1597,1600,1601,1603,1604,1437,1607,1610,1611,1445],{},"Every database object is declared in a ",[623,1587,1376],{}," file of the part that owns it; ",[623,1590,1591],{},"drizzle.config.ts"," reads them\nall. A part imports its own tables directly and another part's through that part's front door\n(",[623,1594,1595],{},"server\u002Findex.ts","). ",[623,1598,1599],{},"exports\u002Ftables-all.ts"," gathers every table for those who assemble:\nthe module SDK's ",[623,1602,1360],{}," and core's tests. ",[623,1605,1606],{},"@shadestack\u002Fcore\u002Ftables",[623,1608,1609],{},"exports\u002Ftables.ts",") is a named list of the four tables the API's console commands read. The database client has no schema (no relational ",[623,1612,1613],{},"db.query",[619,1615,1616],{},"The apps import by subpath:",[771,1618,1619,1629],{},[774,1620,1621],{},[777,1622,1623,1626],{},[780,1624,1625],{},"Import",[780,1627,1628],{},"What",[787,1630,1631,1647,1660,1670,1686,1703,1716,1733,1757,1775],{},[777,1632,1633,1638],{},[792,1634,1635],{},[623,1636,1637],{},"@shadestack\u002Fcore\u002Fschema",[792,1639,1640,1641,1643,1644,1445],{},"The input schemas and types the API, the admin and the frontends import: a named list, so a ",[623,1642,941],{}," name nothing outside core imports is not exported (",[623,1645,1646],{},"exports\u002Fschema.ts",[777,1648,1649,1654],{},[792,1650,1651],{},[623,1652,1653],{},"@shadestack\u002Fcore\u002Fservices",[792,1655,1656,1657,1445],{},"The services the API, the admin's server parts and the browser tests' servers call, plus context and errors: a named list, so a service nothing outside core calls is not exported (",[623,1658,1659],{},"exports\u002Fcore.ts",[777,1661,1662,1667],{},[792,1663,1664],{},[623,1665,1666],{},"@shadestack\u002Fcore\u002Fpermissions",[792,1668,1669],{},"Permissions only; browser-safe.",[777,1671,1672,1680],{},[792,1673,1674,1437,1677,1221],{},[623,1675,1676],{},"@shadestack\u002Fcore\u002Fcollections",[623,1678,1679],{},"\u002Fgenerate",[792,1681,1682,1683,1445],{},"Collection definitions; the table generator: named lists, so a name nothing outside core imports is not exported (",[623,1684,1685],{},"exports\u002Fcollections.ts",[777,1687,1688,1696],{},[792,1689,1690,1437,1693,1221],{},[623,1691,1692],{},"@shadestack\u002Fcore\u002Fdb",[623,1694,1695],{},"\u002Ftesting",[792,1697,1698,1699,1702],{},"Database client and migrations (",[623,1700,1701],{},"exports\u002Fdb.ts",", a named list); the throwaway test database.",[777,1704,1705,1710],{},[792,1706,1707],{},[623,1708,1709],{},"@shadestack\u002Fcore\u002Ftesting",[792,1711,1712,1713,1445],{},"What only tests use: tables to fill fixtures, test clocks, permission and module switches set by hand. The API's sources and the admin's screens never import it (",[623,1714,1715],{},"pnpm lint",[777,1717,1718,1723],{},[792,1719,1720],{},[623,1721,1722],{},"@shadestack\u002Fcore\u002Finstalled",[792,1724,1725,1726,1729,1730,656],{},"Module contract and loader, a named list (",[623,1727,1728],{},"exports\u002Finstalled.ts","). Core names no module; its tests use the fixture modules in ",[623,1731,1732],{},"shade\u002Ftest\u002Ftesting\u002Ffixtures\u002Fmodules",[777,1734,1735,1748],{},[792,1736,1737,1437,1740,634,1743,634,1746,1221],{},[623,1738,1739],{},"@shadestack\u002Fmodule-sdk\u002Fserver",[623,1741,1742],{},"\u002Fshared",[623,1744,1745],{},"\u002Fsite",[623,1747,1695],{},[792,1749,1750,1751,1754,1755,1445],{},"The module SDK, its own package in ",[623,1752,1753],{},"shade\u002Fmodule-sdk\u002F",": what a module may use (",[651,1756,441],{"href":437},[777,1758,1759,1764],{},[792,1760,1761],{},[623,1762,1763],{},"@shadestack\u002Fcore\u002Ffields",[792,1765,1766,1767,1770,1771,1774],{},"The field type registry (",[623,1768,1769],{},"exports\u002Ffields.ts",", a named list over ",[623,1772,1773],{},"fields\u002Fshared.ts","); browser-safe.",[777,1776,1777,1785],{},[792,1778,1779,634,1782],{},[623,1780,1781],{},"@shadestack\u002Fcore\u002Fmcp",[623,1783,1784],{},"\u002Fsdk",[792,1786,1787],{},"MCP server, read client.",[771,1789,1790,1802],{},[774,1791,1792],{},[777,1793,1794,1799],{},[780,1795,1796,1797,1221],{},"Other packages (",[623,1798,644],{},[780,1800,1801],{},"Responsibility",[787,1803,1804,1817,1862,1916,1958],{},[777,1805,1806,1810],{},[792,1807,1808],{},[623,1809,629],{},[792,1811,1812,1813,1816],{},"The API: a Hono server (see ",[651,1814,494],{"href":1815},"#the-api"," below). Owns the configuration, the runtime, start-up and the console commands.",[777,1818,1819,1823],{},[792,1820,1821],{},[623,1822,625],{},[792,1824,1825,1826,1828,1829,1832,1833,634,1835,634,1838,634,1841,1844,1845,1848,1849,1852,1853,634,1855,833,1858,1861],{},"Nuxt 4 + Nuxt UI. ",[623,1827,1425],{},": the admin screens, a single-page app calling ",[623,1830,1831],{},"\u002Fapi"," (imports ",[623,1834,1351],{},[623,1836,1837],{},"collections",[623,1839,1840],{},"fields",[623,1842,1843],{},"core\u002Fpermissions","). Built to static files (",[623,1846,1847],{},"nuxt generate"," → ",[623,1850,1851],{},".output\u002Fpublic","), served by the API; no server code. Its dev server forwards ",[623,1854,1831],{},[623,1856,1857],{},"\u002Fuploads",[623,1859,1860],{},"\u002Fhealth"," to the API.",[777,1863,1864,1870],{},[792,1865,1866,1437,1868,1221],{},[623,1867,637],{},[623,1869,633],{},[792,1871,1872,1873,833,1876,1879,1880,1520,1882,833,1885,634,1887,1889,1890,1893,1894,634,1897,1900,1901,634,1904,1907,1908,1911,1912,1915],{},"SHADE's own Astro site, a frontend in its own repository; only ",[623,1874,1875],{},"\u002Fpreview",[623,1877,1878],{},"\u002Fpreview\u002Fcanvas"," are server-rendered. Imports ",[623,1881,761],{},[623,1883,1884],{},"sdk",[623,1886,1351],{},[623,1888,1200],{}," (the ",[623,1891,1892],{},"shade()"," integration, ",[623,1895,1896],{},"site",[623,1898,1899],{},"tree",", the preview's content security policy), ",[623,1902,1903],{},"@shadestack\u002Frender",[623,1905,1906],{},"@shadestack\u002Fclient\u002Fcanvas"," (the website editor's canvas) and the installed modules' head parts (",[623,1909,1910],{},"virtual:shade\u002Fmodule-sites","). Its browser tests run against ",[623,1913,1914],{},"@shadestack\u002Fe2e","'s test instance.",[777,1917,1918,1923],{},[792,1919,1920],{},[623,1921,1922],{},"e2e",[792,1924,1925,1927,1928,1931,1932,1935,1936,1939,1940,1943,1944,634,1947,1950,1951,1954,1955,1445],{},[623,1926,1914],{},": SHADE's browser tests (",[623,1929,1930],{},"pnpm test:e2e","; one spec without rebuilding: ",[623,1933,1934],{},"pnpm test:e2e:run \u003Cspec>","), and the test instance (",[623,1937,1938],{},"site-server.ts",": a seeded database, the built API, a site built against it) that ",[623,1941,1942],{},"shade-site","'s and the modules' site tests use (",[623,1945,1946],{},"siteE2eConfig",[623,1948,1949],{},"moduleSiteE2eConfig","); its core content (",[623,1952,1953],{},"site-content.ts",") also fills the workspace's migration check (",[623,1956,1957],{},"pnpm migrations:check",[777,1959,1960,1965],{},[792,1961,1962],{},[623,1963,1964],{},"packages\u002Fsvg",[792,1966,1967,1970],{},[623,1968,1969],{},"@shadestack\u002Fsvg",": the SVG an uploaded image may be, an allow-list of elements with the attributes each takes, which the media library checks SVG uploads against. No dependencies, so core checks uploads without the website editor's packages.",[619,1972,1973,1974,1437,1977,1980,1981,1984,1985,1988,1989,1992],{},"The frontend kit moved to its own repository, ",[623,1975,1976],{},"shadehq-dev\u002Fshade-frontend",[623,1978,1979],{},"frontend\u002F"," in the SHADE workspace), on 24 November 2026 (decision 0016 point 12). Its packages are in ",[623,1982,1983],{},"packages\u002F"," there, with the starters in ",[623,1986,1987],{},"starters\u002F"," and the browser tests that need no instance in ",[623,1990,1991],{},"e2e\u002F",":",[771,1994,1995,2006],{},[774,1996,1997],{},[777,1998,1999,2004],{},[780,2000,2001,2002,1221],{},"Kit package (",[623,2003,1444],{},[780,2005,1801],{},[787,2007,2008,2029,2048,2083,2102,2125,2141,2170,2193],{},[777,2009,2010,2015],{},[792,2011,2012],{},[623,2013,2014],{},"packages\u002Fclient",[792,2016,2017,2020,2021,2024,2025,634,2027,1445],{},[623,2018,2019],{},"@shadestack\u002Fclient",", for any framework: core's read client at its root, which needs none of the website editor's packages; with those as optional peers, a site's pages and the theme as CSS (",[623,2022,2023],{},"@shadestack\u002Fclient\u002Frender",") and the website editor's canvas (",[623,2026,1906],{},[623,2028,1878],{},[777,2030,2031,2036],{},[792,2032,2033],{},[623,2034,2035],{},"packages\u002Fastro",[792,2037,2038,2040,2041,2043,2044,2047],{},[623,2039,1200],{},": the ",[623,2042,1892],{}," integration, the node tree's renderer (",[623,2045,2046],{},"@shadestack\u002Fastro\u002Ftree","), site parts and render helpers; SHADE's own site uses it.",[777,2049,2050,2061],{},[792,2051,2052,634,2055,634,2058],{},[623,2053,2054],{},"packages\u002Fnext",[623,2056,2057],{},"packages\u002Fsveltekit",[623,2059,2060],{},"packages\u002Fnuxt",[792,2062,2063,634,2066,634,2069,2072,2073,2076,2077,2079,2080,1445],{},[623,2064,2065],{},"@shadestack\u002Fnext",[623,2067,2068],{},"@shadestack\u002Fsveltekit",[623,2070,2071],{},"@shadestack\u002Fnuxt",": the node tree's renderer (",[623,2074,2075],{},"ShadeTree",", on ",[623,2078,1903],{},") and read client per framework (",[651,2081,2082],{"href":504},"Other frameworks",[777,2084,2085,2090],{},[792,2086,2087],{},[623,2088,2089],{},"packages\u002Ftree",[792,2091,2092,2095,2096,2099,2100,1445],{},[623,2093,2094],{},"@shadestack\u002Ftree",": the website editor's typed node tree: node types, events and actions in client islands, validation, schema versions and migrations, tree operations and comparison per node, and the canvas protocol between the editor and a frontend (",[623,2097,2098],{},"@shadestack\u002Ftree\u002Fcanvas","). Framework-free; the editor's other foundations and the website module's content check build on it (",[651,2101,2082],{"href":514},[777,2103,2104,2109],{},[792,2105,2106],{},[623,2107,2108],{},"packages\u002Fexpressions",[792,2110,2111,2114,2115,2118,2119,2121,2122,1445],{},[623,2112,2113],{},"@shadestack\u002Fexpressions",": the website editor's expressions, a typed tree, never code: the AST, the type checker, the approved functions, one interpreter and runtime, compilers to Astro\u002FJSX, Vue and Svelte template code, and the ",[623,2116,2117],{},"fx"," bar's grammar. Framework-free, no dependencies; ",[623,2120,2094],{}," stores and checks its expressions (",[651,2123,2082],{"href":2124},"\u002Fdevelopers\u002Fframeworks\u002Fexpressions-and-styles#shadestackexpressions",[777,2126,2127,2132],{},[792,2128,2129],{},[623,2130,2131],{},"packages\u002Fstyles",[792,2133,2134,2137,2138,1445],{},[623,2135,2136],{},"@shadestack\u002Fstyles",": the website editor's styles: classes and local styles (by tree id and node id) with breakpoints, container queries, states and pseudo-elements, variables with light and dark modes, typed values from a property allow-list, the CSS compiler with its output check, the origin rules, a theme's tokens as default variables and as CSS (the theme itself is the website module's) and WCAG contrast. Framework-free, no dependencies (",[651,2139,2082],{"href":2140},"\u002Fdevelopers\u002Fframeworks\u002Fexpressions-and-styles#shadestackstyles",[777,2142,2143,2148],{},[792,2144,2145],{},[623,2146,2147],{},"packages\u002Frender",[792,2149,2150,2152,2153,2156,2157,1441,2159,634,2161,634,2163,634,2165,2167,2168,1445],{},[623,2151,1903],{},": the website editor's rendering core: resolves a stored tree with its components, data, visitor (server islands only) and language into plain elements, client island templates and head data; the embed sanitiser, edit-mode markers, render limits, the islands' runtime, SHADE's accessible widgets (",[623,2154,2155],{},"shade:dialog",", tabs, menu, disclosure, accordion) and the conformance suite the four renderers (",[623,2158,2075],{},[623,2160,1200],{},[623,2162,2065],{},[623,2164,2071],{},[623,2166,2068],{},") are held to. Framework-free, on the tree, the expressions and the styles (",[651,2169,2082],{"href":522},[777,2171,2172,2177],{},[792,2173,2174],{},[623,2175,2176],{},"packages\u002Finteractions",[792,2178,2179,2182,2183,2186,2187,833,2189,1437,2191,1445],{},[623,2180,2181],{},"@shadestack\u002Finteractions",": the website editor's interactions: triggers (load, hover, click, in view, scroll progress, an island's action), target nodes, keyframes or timelines with typed values, breakpoint scopes and reduced motion, kept beside the trees by tree id; their validation against the trees and the styles, the page's JSON, and one small runtime on the Web Animations API (",[623,2184,2185],{},"@shadestack\u002Finteractions\u002Fruntime",", no imports). Framework-free, on ",[623,2188,2094],{},[623,2190,2136],{},[651,2192,2082],{"href":526},[777,2194,2195,2200],{},[792,2196,2197],{},[623,2198,2199],{},"packages\u002Fa11y",[792,2201,2202,2205,2206,2209,2210,833,2212,1437,2214,1445],{},[623,2203,2204],{},"@shadestack\u002Fa11y",": the website editor's accessibility checker: checks a page's tree with its layout, components, styles and languages, inside components and through every branch (headings, alt texts, names and labels, first children, ids, landmarks, contrast in every mode, focus styles, the language of parts), and returns ",[623,2207,2208],{},"{ errors, warnings }","; errors (WCAG 2.1 AA failures, and what it can't read) block publishing, warnings (what WCAG doesn't require) don't. Framework-free, on ",[623,2211,2094],{},[623,2213,2136],{},[651,2215,2082],{"href":530},[619,2217,2218,634,2220,634,2223,634,2226,634,2229,833,2232,2235,2236,1445],{},[623,2219,1899],{},[623,2221,2222],{},"expressions",[623,2224,2225],{},"styles",[623,2227,2228],{},"render",[623,2230,2231],{},"interactions",[623,2233,2234],{},"a11y"," are the website editor's packages: the website\nmodule and the frontends build on them, core and the module SDK don't\n(",[651,2237,490],{"href":491},[619,2239,2240,2241,2243,2244,1441,2247,833,2250,769],{},"Rules (checked by ",[623,2242,1715],{},": ",[623,2245,2246],{},"no-restricted-imports",[623,2248,2249],{},"eslint.config.mjs",[623,2251,2252],{},"apps\u002Fadmin\u002Feslint.config.mjs",[1363,2254,2255,2267,2279,2299,2312,2333,2339],{},[1366,2256,2257,2266],{},[2258,2259,2260,2262,2263,2265],"strong",{},[623,2261,941],{}," depends on nothing but zod and other ",[623,2264,941],{}," parts."," Anything shared crosses into the browser as a\nschema type.",[1366,2268,2269,2275,2276,656],{},[2258,2270,2271,2272,656],{},"Services never import an HTTP framework, Astro or ",[623,2273,2274],{},"process.env"," Everything they need arrives through\n",[623,2277,2278],{},"ServiceContext",[1366,2280,2281,1437,2284,2287,2288,2291,2292,2295,2296,1445],{},[2258,2282,2283],{},"Only the API reads the environment",[623,2285,2286],{},"apps\u002Fapi\u002Fsrc\u002Fconfig.ts",", parsed once at start; where the values come from,\nthe environment, ",[623,2289,2290],{},"SHADE_ENV_FILE"," or the development ",[623,2293,2294],{},".env",", is ",[623,2297,2298],{},"apps\u002Fapi\u002Fsrc\u002Fenv-file.ts",[1366,2300,2301,2308,2309,2311],{},[2258,2302,2303,833,2305,2307],{},[623,2304,953],{},[623,2306,637],{}," parts, the admin shell and the site never import services or db."," The admin calls ",[623,2310,1831],{},";\nthe site calls the content API through the sdk, so it can build anywhere.",[1366,2313,2314,1437,2317,634,2319,634,2321,634,2323,1388,2325,634,2327,2329,2330,2332],{},[2258,2315,2316],{},"Core never imports the website editor's packages",[623,2318,2094],{},[623,2320,2225],{},[623,2322,2222],{},[623,2324,2228],{},[623,2326,2231],{},[623,2328,2234],{},"): nothing in ",[623,2331,765],{},", the module SDK and core's tests included.",[1366,2334,2335,2338],{},[2258,2336,2337],{},"Client sites never use Nuxt UI."," Pages style themselves with the site's styles and the theme's CSS variables only.",[1366,2340,2341,2342,634,2345,2347,2348,2351,2352,634,2355,1513,2358,2360,2361,2364,2365,2368,2369,2372,2373,634,2376,2379,2380,1445],{},"In the repository the package exports TypeScript source; on npm it is built JavaScript with declaration files\n(",[623,2343,2344],{},"pnpm release:packages",[651,2346,577],{"href":578},"). Nuxt, Astro and Vitest compile the source,\nand Node runs it as it is (its own type stripping) for the API in development, the console scripts, the worker threads and modules loaded from folders. So\nthe code uses only syntax Node can strip (",[623,2349,2350],{},"erasableSyntaxOnly",": no enums, namespaces or parameter properties), and\nevery relative import names its file, extension included (",[623,2353,2354],{},".\u002Fcontext.ts",[623,2356,2357],{},".\u002Fblocks\u002Findex.ts",[623,2359,1715],{}," checks\nit in SHADE (",[623,2362,2363],{},"scripts\u002Fimport-extensions.mjs",") and the workspace's ",[623,2366,2367],{},"pnpm test"," in the modules and the site.\n",[623,2370,2371],{},"apps\u002Fapi\u002Fscripts\u002Fbuild.mjs"," bundles the API with esbuild (",[623,2374,2375],{},"dist\u002Fserver.mjs",[623,2377,2378],{},"dist\u002Fconsole\u002Fcreate-admin.mjs","); sharp, which is native, stays\noutside the bundle and the image installs it for its own platform (",[623,2381,2382],{},"apps\u002Fapi\u002FDockerfile",[658,2384,2386],{"id":2385},"the-kernel-the-modules-and-the-architecture-test","The kernel, the modules and the architecture test",[619,2388,2389,2390,2393,2394,2397],{},"Core is a small ",[2258,2391,2392],{},"kernel"," and the ",[2258,2395,2396],{},"modules"," around it (decision 0019). The layers it had until 2 December 2026\n(kernel, foundation, business, content, content-delivery, management, entry) are gone.\nSHADE is still being restructured toward the shape decision 0019 plans, in steps; this section describes what the code\nhas today, and what is not built yet is marked as planned.",[1363,2399,2400,2405,2429,2469,2483],{},[1366,2401,829,2402,2404],{},[2258,2403,2392],{}," holds the database, the service context, errors, permissions, the vault, the registries, the module\nloader and the ports. It imports no module.",[1366,2406,2407,2408,2411,2412,634,2415,833,2418,2421,2422,1441,2425,2428],{},"Its ",[2258,2409,2410],{},"runtime library"," is the kernel's files every module may use for errors, logging, traces, metrics, time, ids\nand formats, such as ",[623,2413,2414],{},"errors.ts",[623,2416,2417],{},"log.ts",[623,2419,2420],{},"time.ts",". They load only each other. It is a list in the map\n(",[623,2423,2424],{},"RUNTIME_LIBRARY",[623,2426,2427],{},"scripts\u002Farchitecture\u002Fmap.ts",") rather than a folder, so no import path changed.",[1366,2430,2431,2432,2435,2436,2439,2440,1437,2443,2446,2447,2450,2451,2454,2455,634,2458,634,2460,2463,2464,2466,2467,656],{},"A ",[2258,2433,2434],{},"module"," is made of one or more parts and is either always on or switched per instance.\n",[623,2437,2438],{},"shade\u002Fexports\u002Fmodules.ts"," lists every module, its parts and whether it is always on: ",[623,2441,2442],{},"defineModule({ name, parts, always })",[623,2444,2445],{},"kernel\u002Fmodule.ts","), pure data the test reads without running it, as it reads ",[623,2448,2449],{},"feature.ts",". The ",[623,2452,2453],{},"content","\nmodule, for example, is the parts ",[623,2456,2457],{},"entries",[623,2459,1840],{},[623,2461,2462],{},"paths"," and the other content parts; ",[623,2465,878],{}," is switched and\nholds money, tax, numbering and the other business parts. Until modules get folders of their own, each part keeps its\nfolder and its ",[623,2468,2449],{},[1366,2470,829,2471,634,2474,634,2477,833,2480,2482],{},[2258,2472,2473],{},"entry points",[623,2475,2476],{},"exports",[623,2478,2479],{},"module-sdk",[623,2481,1884],{},", assemble the packages and are in no module.",[1366,2484,2485,2488,2489,2492,2493,2496,2497,2500,2501,634,2504,2506,2507,2510,2511,2514,2515,634,2518,2521,2522,2525,2526,634,2528,833,2531,2534,2535,2538,2539,2542],{},[2258,2486,2487],{},"Permissions",": the kernel keeps the mechanism (principals, classes, ceilings, grants, steps, token presets and\n",[623,2490,2491],{},"decide",") and only its own action, ",[623,2494,2495],{},"modules.manage",". Each module declares its own actions, what the editor and AI\nroles hold by default, what core's background work (the system) holds and its steps, in a ",[623,2498,2499],{},"shared\u002Fpermissions.ts"," of\none of its parts (",[623,2502,2503],{},"defineModulePermissions",[623,2505,2445],{},"), in the shape of a module manifest's ",[623,2508,2509],{},"permissions","\npart. ",[623,2512,2513],{},"shade\u002Fexports\u002Fpermissions.ts"," gathers them (",[623,2516,2517],{},"MODULE_PERMISSIONS",[623,2519,2520],{},"@shadestack\u002Fcore\u002Fmodule-permissions",") and\nevery start registers them (",[623,2523,2524],{},"registerModulePermissions","); until then ",[623,2527,2491],{},[623,2529,2530],{},"registerActions",[623,2532,2533],{},"reservedNames","\nrefuse to answer. A module whose actions follow its data registers them as they come: content registers each\ncollection's actions with their classes as the content model loads, and keeps field rules, entry limits and data\ntokens beside them. Only a module may lift a class on one surface, as content does for the AI's delete of an\n",[623,2536,2537],{},"aiDeletes"," collection over MCP; a module never can. The module names core reserves (",[623,2540,2541],{},"reservedNames()",") are built\nfrom the modules, their parts and the namespaces they declare.",[619,2544,2545],{},"The rules, held by the architecture test:",[1363,2547,2548,2551,2554,2577,2588,2601,2614,2621,2656,2659,2725,2728],{},[1366,2549,2550],{},"The kernel imports nothing outside the kernel, not even a type, and the runtime library loads nothing else of it.",[1366,2552,2553],{},"Every part is in exactly one module.",[1366,2555,2556,2557,634,2560,2563,2564,2566,2567,2569,2570,2573,2574,2576],{},"A part is entered through its front door, ",[623,2558,2559],{},"index.ts",[623,2561,2562],{},"shared\u002Findex.ts"," or ",[623,2565,1595],{}," in its folder, and only\na part its ",[623,2568,2449],{}," lists in ",[623,2571,2572],{},"needs","; that is how one module reaches another. The kernel's files are all front\ndoors, and the entry points may reach anywhere. Every entry of the package's export map points at a front door, an\nentry point in ",[623,2575,1345],{}," or the kernel. No module imports an entry point.",[1366,2578,2579,2580,2583,2584,2587],{},"An always-on module needs a switched one only where the map's ",[623,2581,2582],{},"ALWAYS_NEEDS_SWITCHED"," names the pair, with its\nreason, such as ",[623,2585,2586],{},"content → cache"," (saving an entry clears the modules' cache). A switched module stays loaded while\noff, so each pair is safe, and each is turned around (a registration or an event) as its modules are ported. The\nlist only shrinks: a new pair fails the test, and so does a listed pair the code no longer has.",[1366,2589,2590,2591,2593,2594,2597,2598,656],{},"The admin's auto-imports count as imports. A part's admin file that uses another part's composable, util or\ncomponent by name, with no import statement, is held to its ",[623,2592,2572],{}," like any import (the auto-imports are the\nadmin's way into a part, so the front-door rule doesn't apply to them). A ",[623,2595,2596],{},"declare module"," that widens another part's\ntypes counts as a type-only import of that module: an event's payload is declared through the events part's front\ndoor, ",[623,2599,2600],{},"declare module '…\u002Fevents\u002Fshared'",[1366,2602,2603,2604,833,2607,2610,2611,2613],{},"The two sides of the wall never import or need each other: the team part and the accounts part. What both need is in\nthe kernel (the password hashing, the ids ",[623,2605,2606],{},"TeamMemberId",[623,2608,2609],{},"AccountId","), or is put together by the API's\ncontrollers. ",[623,2612,1715],{}," also runs a word check: no \"user\" on the team's side, no \"group\" on the accounts' side, and\nno bare \"member\" in the admin's English texts.",[1366,2615,2616,2617,2620],{},"A module declares only actions and steps that start with one of its own namespaces, no namespace has two declarers\n(the kernel counts as one), and no file of the kernel names a module's action, except where the map's\n",[623,2618,2619],{},"KERNEL_NAMES_MODULE_ACTION"," names the file with its reason (a list that only shrinks).",[1366,2622,2623,2624,634,2627,634,2630,2632,2633,833,2636,634,2639,1388,2642,634,2645,833,2648,2651,2652,2655],{},"A module's code checks by name (",[623,2625,2626],{},"can",[623,2628,2629],{},"assertCan",[623,2631,2491],{},") only its own actions, those of a module its parts need,\nand the shared gates a module marks for everyone (",[623,2634,2635],{},"settings.read",[623,2637,2638],{},"settings.update",[623,2640,2641],{},"content.read",[623,2643,2644],{},"private.read",[623,2646,2647],{},"errors.read",[623,2649,2650],{},"errors.manage","); any other pair is listed in the map's\n",[623,2653,2654],{},"MODULE_CHECKS_OTHERS_ACTION"," with its reason (a list that only shrinks).",[1366,2657,2658],{},"Runtime imports between files form no cycles. Modules may need each other both ways: they start in one order the\nkernel sets, never in the order of their needs, so there is no rule on cycles between modules.",[1366,2660,2661,2662,2664,2665,1437,2668,1596,2671,2673,2674,2676,2677,2680,2681,2683,2684,2687,2688,2691,2692,2695,2696,2699,2700,2243,2703,2706,2707,2710,2711,2714,2715,2718,2719,2721,2722,2724],{},"Every part of a module declares itself in a ",[623,2663,2449],{}," at the root of its folder:\n",[623,2666,2667],{},"export default defineFeature({ needs, tables, referenceable })",[623,2669,2670],{},"kernel\u002Ffeature.ts",[623,2672,2572],{}," lists the\nparts whose front doors it imports (the kernel is every part's), ",[623,2675,1360],{}," the tables it owns, ",[623,2678,2679],{},"referenceable"," the ones\nanother part's ",[623,2682,1376],{}," may hold a foreign key to (a front door exports no other table). Two more keys are\nabout row-level security: ",[623,2685,2686],{},"policies"," opens one of its tables to another module, with the verbs and the reason\n(",[623,2689,2690],{},"{ table, to, verbs, why }","), and ",[623,2693,2694],{},"unguarded"," leaves a table open to every module for reading, its writes staying its own (only the search index, kept\nthat way by ",[623,2697,2698],{},"UNGUARDED_TABLES"," in the map). Whether a module can be\nswitched off is in ",[623,2701,2702],{},"exports\u002Fmodules.ts",[623,2704,2705],{},"always: false"," with ",[623,2708,2709],{},"switch: true"," (decisions 0003 point 20.5 and 0019). ",[2258,2712,2713],{},"To add a part",": make its folder, add it to ",[623,2716,2717],{},"map.ts","\nand to a module in ",[623,2720,2702],{},", and write its ",[623,2723,2449],{},"; the architecture test says what is missing or\nwrong.",[1366,2726,2727],{},"A part that must not import another offers a registry, sends an event, or takes a port on the service context\ninstead.",[1366,2729,2730,2733,2734,2736,2737,2740,2741,2744,2745,2748,2749,2752,2753,2755,2756,2758,2759,2761,2762,2765,2766,2769,2770,2772,2773,2776,2777,2779,2780,833,2783,2786,2787,1437,2790,634,2793,2796,2797,1437,2800,634,2803,2806,2807,2810,2811,2814,2815,2818],{},[2258,2731,2732],{},"Row-level security"," (decision 0019 point 8.2) holds the same line in Postgres. Each table's owner is the module\nwhose part lists it (",[623,2735,2392],{}," for the kernel's six, ",[623,2738,2739],{},"package:\u003Cname>"," for a module's), and its policies pass a\nstatement only when the scoped handle runs it as that owner in the one tenant, ",[623,2742,2743],{},"main",". The owner's step\n",[623,2746,2747],{},"kernel\u002Fupgrades\u002Frow-security.ts"," writes them after every migration run, from ",[623,2750,2751],{},"exports\u002Frow-security.ts"," (core's\ntables from each part's ",[623,2754,2449],{},") and the modules' manifests, and the start refuses a guarded table without row-level\nsecurity. A module's tables are opened by the kernel to ",[623,2757,1357],{}," (read and delete: the uninstall backup, the\nexport, the clean-up), its collection tables to ",[623,2760,2453],{},", an account scope or profile table, or one whose rows go\nwith an organisation, to ",[623,2763,2764],{},"accounts",", and the tables its ",[623,2767,2768],{},"keptVersions"," names to ",[623,2771,2453],{}," for reading. ",[623,2774,2775],{},"contacts"," is\nopened for reading to each module whose tables refer to it. Modules never get a policy on ",[623,2778,2764],{},": the SDK's\n",[623,2781,2782],{},"ownedBy(column, { email })",[623,2784,2785],{},"ownedByOrganisation"," read two narrow views the owner makes in the same step,\n",[623,2788,2789],{},"accounts_for_packages",[623,2791,2792],{},"id",[623,2794,2795],{},"email",") and ",[623,2798,2799],{},"organisation_members_for_packages",[623,2801,2802],{},"organisation_id",[623,2804,2805],{},"account_id","),\nwhich show rows only to a module whose tables refer to accounts or organisations, and ",[623,2808,2809],{},"notInTrash"," reads a third,\n",[623,2812,2813],{},"entry_trash_for_packages",", shown to a module with collections. Nobody but the owner writes through them.\nWho may do what to which table is a committed snapshot, ",[623,2816,2817],{},"shade\u002Ftest\u002Fkernel\u002Fupgrades\u002Frow-security.snapshot.json",":\na change to it shows in review. It guards against bugs, not hostile code: anything in the API's process, a trusted\nmodule included, could name another owner itself.",[619,2820,2821],{},"How the kernel keeps to this:",[1363,2823,2824,2887,2926,2959,2981,2996,3005,3029,3039],{},[1366,2825,2826,2829,2830,2833,2834,634,2837,1388,2840,2843,2844,2847,2848,634,2851,634,2854,2857,2858,2861,2862,1437,2865,634,2868,2870,2871,833,2874,2877,2878,1520,2881,1437,2884,1445],{},[2258,2827,2828],{},"Ports and actors."," The service context's ports (",[623,2831,2832],{},"FilesDriver"," as ",[623,2835,2836],{},"ctx.files",[623,2838,2839],{},"EmailDriver",[623,2841,2842],{},"RebuildTrigger",") are defined in ",[623,2845,2846],{},"kernel\u002Fports.ts"," and the actor types (",[623,2849,2850],{},"Actor",[623,2852,2853],{},"Role",[623,2855,2856],{},"Via",") in\n",[623,2859,2860],{},"kernel\u002Factor.ts","; media, email, content delivery and users implement or re-export them. Where actors are\nstored is the kernel's too: ",[623,2863,2864],{},"kernel\u002Fidentity\u002Fidentity.sql.ts",[623,2866,2867],{},"users",[623,2869,836],{},", the ",[623,2872,2873],{},"role",[623,2875,2876],{},"via","\nenums), so audit refers to a user without using the users part; signing in, tokens and managing the team stay\nin users. The ports for work in flight (leases, queue, messages, counters, cache) are declared there\ntoo; a part that changes what other containers keep in memory announces it after commit with\n",[623,2879,2880],{},"kernel\u002Fcoordination\u002Ffollow.ts",[623,2882,2883],{},"announce",[651,2885,397],{"href":2886},"\u002Fdevelopers\u002Fredis#messages-replacing-polling",[1366,2888,2889,2892,2893,1437,2896,2899,2900,2903,2904,2907,2908,2911,2912,2915,2916,2919,2920,2922,2923,2925],{},[2258,2890,2891],{},"Manifest parts."," The manifest's core parts (name, routes, permissions, schedules, allowed sources, …) are in\n",[623,2894,2895],{},"kernel\u002Fmodules\u002Fdefine.ts",[623,2897,2898],{},"CORE_PARTS","). Every other part (settings, collections, publish checks, data\nsources, MCP tools, retention, personal data, consent, the admin's parts) is a feature part: the\nfeature's ",[623,2901,2902],{},"manifest.ts"," declares the key on ",[623,2905,2906],{},"ShadeModule"," and registers a ",[623,2909,2910],{},"ManifestPart","\n(",[623,2913,2914],{},"kernel\u002Fmodules\u002Fmanifest-parts.ts",") that checks and registers it. ",[623,2917,2918],{},"exports\u002Fmanifest-parts.ts"," loads every feature's\n",[623,2921,2902],{},", and the entries that load modules (",[623,2924,1722],{},", the core entry, the module SDK) load\nit first. A key no part owns is refused, so a part is never silently ignored.",[1366,2927,2928,2931,2932,2935,2936,2939,2940,2943,2944,2947,2948,2951,2952,2955,2956,1445],{},[2258,2929,2930],{},"Events."," A part says what happened without knowing who listens (decision 0014): it declares its events with\n",[623,2933,2934],{},"defineEvent"," and writes them with ",[623,2937,2938],{},"emitEvent"," in the change's transaction (entries: ",[623,2941,2942],{},"entries.entry.published","…,\nin ",[623,2945,2946],{},"entries\u002Fserver\u002Fevents.ts","). Core's parts subscribe in code (",[623,2949,2950],{},"subscribe","), modules in the manifest part ",[623,2953,2954],{},"on",";\ndurable deliveries run on the worker from the outbox (",[623,2957,2958],{},"features\u002Fevents",[1366,2960,2961,2964,2965,2968,2969,2972,2973,2976,2977,2980],{},[2258,2962,2963],{},"What entries asks of higher parts"," goes through ",[623,2966,2967],{},"entries\u002Fserver\u002Foutside.ts",": content delivery registers which\nentries can be linked and how a linked entry's public path is found (",[623,2970,2971],{},"setEntryLinks","). Public media (",[623,2974,2975],{},"media\u002Fserver\u002Fpublic.ts",") and the\npublic language check (",[623,2978,2979],{},"publicLanguage",", settings) live in the lower parts that own them.",[1366,2982,2983,1437,2986,634,2989,2992,2993,656],{},[2258,2984,2985],{},"Date helpers",[623,2987,2988],{},"localParts",[623,2990,2991],{},"zonedInstant",") are the kernel's: ",[623,2994,2995],{},"kernel\u002Ftime.ts",[1366,2997,2998,3001,3002,656],{},[2258,2999,3000],{},"What a part keeps"," (personal data, retention periods) is registered by that part, in its ",[623,3003,3004],{},"server\u002Fkept-data.ts",[1366,3006,3007,3010,3011,1388,3014,833,3017,3020,3021,3024,3025,3028],{},[2258,3008,3009],{},"Feature parts"," work one way: checks first (each module's, then the catalog's), then ",[623,3012,3013],{},"reset",[623,3015,3016],{},"register",[623,3018,3019],{},"finish","; names follow one rule (",[623,3022,3023],{},"kernel\u002Fmodules\u002Fnames.ts","); registries refuse a name that is\ntaken. The admin's module switch comes from the server's (",[623,3026,3027],{},"GET \u002Fapi\u002Fpackages\u002Fcatalog\u002Fswitches",": every installed\nmodule, and which are on), so untrusted modules and packages are switched there like the others.",[1366,3030,3031,3034,3035,3038],{},[2258,3032,3033],{},"Providers"," with settings register in one shape with the provider registry (",[623,3036,3037],{},"registerProviderSetup",":\nconfigured, on, depends on), which the module manager and the providers' own guards read.",[1366,3040,3041,3044,3045,3047,3048,3051,3052,3055,3056,656],{},[2258,3042,3043],{},"Tables",": parts import their own tables and other parts' through their front doors; the aggregate of every\ntable is ",[623,3046,1609],{},", outside the kernel. What one part asked of another's table the wrong\nway round is now a question the higher part answers: users tells email an editor's language\n(",[623,3049,3050],{},"setEditorLanguages","), media tells settings a file's type (",[623,3053,3054],{},"setMediaTypes","), redirects forgets a deleted entry's\npublic paths on ",[623,3057,3058],{},"entry.deleted",[619,3060,3061],{},"Core has no runtime import cycles, and the kernel imports nothing from a module.",[619,3063,3064,3066,3067,3069,3070,3072,3073,3076,3077,3079,3080,3082,3083,3085,3086,3088,3089,3091,3092,3094,3095,3097],{},[623,3065,2427],{}," in the ",[623,3068,644],{}," repository is the map: the kernel's runtime library, every part with its\nfolder and what it is for, the entry points and the always-on modules' needs of switched ones; ",[623,3071,2702],{},"\nis the list of modules. ",[623,3074,3075],{},"test\u002Fscripts\u002Farchitecture\u002Farchitecture.test.ts"," (part of ",[623,3078,2367],{},") reads every import in\n",[623,3081,765],{}," with the TypeScript compiler (with the names the admin auto-imports and the modules ",[623,3084,2596],{}," widens)\nand fails on an import across the kernel's boundaries, an import past a front door, a new runtime cycle, an import of\nanother part's table outside a ",[623,3087,1376],{},", code that disagrees with a part's ",[623,3090,2449],{}," (an import of a part it\ndoesn't list in ",[623,3093,2572],{},", a table it declares and doesn't list, a foreign key to a table that isn't ",[623,3096,2679],{},", a\nfront door exporting such a table), a part in no module or in two, an always-on module needing a switched one the map\ndoesn't list, or a part missing from the map; canary cases prove each check can fail.",[619,3099,3100,3101,3104,3105,3108,3109,3112,3113,833,3115,3117],{},"What breaks the rules today is listed in ",[623,3102,3103],{},"scripts\u002Farchitecture\u002Fbaseline.json",": no imports past a front door, no\nimports of another part's tables and no cycles. A new violation fails the test; when a cleanup fixes some, the test\nfails until ",[623,3106,3107],{},"pnpm architecture:baseline"," takes them out, so the list only shrinks. That command never adds anything;\n",[623,3110,3111],{},"pnpm architecture:baseline --init"," rewrites it, and is only for changes to the rules, in review. Imports past a\nfront door and imports of another part's table are never listed: the test fails on one, and the command refuses to\nrun while there is one. The kernel's boundaries and the module checks have no baseline at all. A new part is a change\nto ",[623,3114,2717],{},[623,3116,2702],{},", reviewed like code.",[1363,3119,3120],{},[1366,3121,3122,3123,833,3125,3127,3128,1441,3131,3133,3134,3137,3138,3141],{},"The baseline has no front-door or table lines left. A part reads only its own tables and asks the owner's services for the rest (a foreign key in a ",[623,3124,1376],{},[623,3126,1609],{}," are allowed; the team's two tables, declared in the kernel, are the team's: ",[623,3129,3130],{},"TABLE_OWNERS",[623,3132,2717],{},"; decision 0003 point 20).\nField kinds own what they produce (",[623,3135,3136],{},"fields\u002Fplan.ts","); the json field finds the links and media in its value with\n",[623,3139,3140],{},"fields\u002Freferences.ts",", and the module that registers its check decides the rest.",[3143,3144,3146],"h3",{"id":3145},"seeing-the-map-haunt","Seeing the map: Haunt",[619,3148,3149,3150,3153,3154,3156],{},"Haunt (",[623,3151,3152],{},"razerghost\u002Fhaunt",", a tool of its own, outside the SHADE workspace) is a desktop git client that draws a\nTypeScript project in bands of parts, with every function, its calls and the imports between parts. It runs on your\nown machine and updates when you save a file. Install it from its releases, then open the ",[623,3155,644],{}," folder.",[619,3158,3159,3160,3163,3164,3166,3167,3170,3171,3174,3175,3178],{},"It reads SHADE's map from the code, not from a copy. ",[623,3161,3162],{},"haunt.config.json"," at the root of ",[623,3165,644],{}," names\n",[623,3168,3169],{},"scripts\u002Farchitecture\u002Fhaunt.ts",", which returns SHADE's bands (the entry points, each module, the kernel) and parts, which part a file is in, and every import\nbetween parts as the architecture test judges it, with the imports ",[623,3172,3173],{},"baseline.json"," lists marked as known.\n",[623,3176,3177],{},"test\u002Fscripts\u002Farchitecture\u002Fhaunt.test.ts"," holds that to the test: the same modules and parts, and the same imports\nbreaking the same rules. Haunt only runs this script once you trust the folder; until then it draws SHADE by\nworkspace package, without the rules. The apps and the packages are drawn by workspace package either way.",[658,3180,494],{"id":3181},"the-api",[619,3183,3184,3186],{},[623,3185,629],{}," is laid out like Laravel:",[771,3188,3189,3201],{},[774,3190,3191],{},[777,3192,3193,3199],{},[780,3194,3195,3196,1221],{},"Path (in ",[623,3197,3198],{},"apps\u002Fapi\u002Fsrc\u002F",[780,3200,785],{},[787,3202,3203,3213,3223,3233,3243,3253,3263,3273,3297,3307,3317,3327,3337,3355,3386,3396,3406,3418,3428,3438],{},[777,3204,3205,3210],{},[792,3206,3207],{},[623,3208,3209],{},"routes\u002Fapi.ts",[792,3211,3212],{},"The admin API: every URL → controller action, with the group's middleware (body limit, same-origin, session); also the modules' editor routes",[777,3214,3215,3220],{},[792,3216,3217],{},[623,3218,3219],{},"routes\u002Fcontent.ts",[792,3221,3222],{},"The content API for the site build, \u002Fpreview and other frontends (read token)",[777,3224,3225,3230],{},[792,3226,3227],{},[623,3228,3229],{},"routes\u002Fdata.ts",[792,3231,3232],{},"The data API for other systems (data token)",[777,3234,3235,3240],{},[792,3236,3237],{},[623,3238,3239],{},"routes\u002Fuser.ts",[792,3241,3242],{},"The account API (public role): accounts, module routes (the payments module's webhook among them)",[777,3244,3245,3250],{},[792,3246,3247],{},[623,3248,3249],{},"routes\u002Fmcp.ts",[792,3251,3252],{},"MCP (mcp token, rate limit)",[777,3254,3255,3260],{},[792,3256,3257],{},[623,3258,3259],{},"routes\u002Fweb.ts",[792,3261,3262],{},"\u002Fhealth, \u002Fapi\u002Fv1\u002Fopenapi.json, \u002Fuploads, the admin's icons (\u002F_nuxt_icon), and last the admin screens' files",[777,3264,3265,3270],{},[792,3266,3267],{},[623,3268,3269],{},"http\u002Fcontrollers\u002F",[792,3271,3272],{},"Thin actions per resource: parse input, call a service, return",[777,3274,3275,3280],{},[792,3276,3277],{},[623,3278,3279],{},"http\u002Fmiddleware\u002F",[792,3281,3282,3285,3286,3289,3290,3293,3294],{},[623,3283,3284],{},"auth.ts"," (session and tokens), ",[623,3287,3288],{},"origin.ts"," (same-origin), ",[623,3291,3292],{},"protection.ts"," (rate limits, idempotency, webhook signatures), ",[623,3295,3296],{},"body-limit.ts",[777,3298,3299,3304],{},[792,3300,3301],{},[623,3302,3303],{},"http\u002Frouter.ts",[792,3305,3306],{},"Route groups: a prefix and middleware for the routes written inside them",[777,3308,3309,3314],{},[792,3310,3311],{},[623,3312,3313],{},"http\u002Fopenapi.ts",[792,3315,3316],{},"The OpenAPI document of the versioned API",[777,3318,3319,3324],{},[792,3320,3321],{},[623,3322,3323],{},"http\u002Fcsp.ts",[792,3325,3326],{},"The admin screens' Content-Security-Policy",[777,3328,3329,3334],{},[792,3330,3331],{},[623,3332,3333],{},"http\u002Fclient-ip.ts",[792,3335,3336],{},"The visitor's IP behind our own proxies",[777,3338,3339,3353],{},[792,3340,3341,634,3344,634,3347,634,3350],{},[623,3342,3343],{},"http\u002Ferrors.ts",[623,3345,3346],{},"input.ts",[623,3348,3349],{},"context.ts",[623,3351,3352],{},"env.ts",[792,3354],{},[777,3356,3357,3362],{},[792,3358,3359],{},[623,3360,3361],{},"bootstrap\u002F",[792,3363,3364,3367,3368,3371,3372,3375,3376,634,3379,3382,3383],{},[623,3365,3366],{},"app.ts"," (the route groups per role), ",[623,3369,3370],{},"runtime.ts"," (with ",[623,3373,3374],{},"follow()",": what other containers change, through Redis messages), ",[623,3377,3378],{},"start.ts",[623,3380,3381],{},"restart.ts"," (restart requests), ",[623,3384,3385],{},"content.ts",[777,3387,3388,3393],{},[792,3389,3390],{},[623,3391,3392],{},"console\u002F",[792,3394,3395],{},"create-admin, env-file (a new env file), generate-collections, module-keys and sign-module (signing sandbox packages)",[777,3397,3398,3403],{},[792,3399,3400],{},[623,3401,3402],{},"sandbox\u002F",[792,3404,3405],{},"Untrusted modules: a workerd process per module, the gate, the bridge, the watchdog",[777,3407,3408,3413],{},[792,3409,3410],{},[623,3411,3412],{},"redis\u002F",[792,3414,3415,3416,1221],{},"The Redis driver: the kernel's five ports on ioredis, its only import (",[651,3417,397],{"href":398},[777,3419,3420,3425],{},[792,3421,3422],{},[623,3423,3424],{},"config.ts",[792,3426,3427],{},"The environment, checked with Zod",[777,3429,3430,3435],{},[792,3431,3432],{},[623,3433,3434],{},"env-file.ts",[792,3436,3437],{},"Where it comes from: the environment, SHADE_ENV_FILE (checked), the development .env",[777,3439,3440,3444],{},[792,3441,3442],{},[623,3443,1315],{},[792,3445,3446,3447,1221],{},"Its own server: start-up, listen, graceful shutdown (",[623,3448,3449],{},"pnpm --filter @shadestack\u002Fapi dev",[619,3451,3452,3453,656],{},"A route is protected by the group it is written in: there are no lists of paths that skip a check. The services\nstay in ",[623,3454,3455],{},"shade\u002Ffeatures\u002F*",[658,3457,3459],{"id":3458},"request-flow","Request flow",[663,3461,3463],{"className":665,"code":3462,"language":667,"meta":668,"style":668},"sequenceDiagram\n  accTitle: A request's path from an admin screen to the database\n  accDescr: A Vue page in apps\u002Fadmin\u002Fapp\u002Fpages calls $fetch('\u002Fapi\u002Fcollections\u002Fposts\u002F123'). The route in apps\u002Fapi\u002Fsrc\u002Froutes\u002Fapi.ts runs action show in apps\u002Fapi\u002Fsrc\u002Fhttp\u002Fcontrollers\u002Fcollections.ts; the group's middleware, withSession(), gives it a ServiceContext with db, actor, via, files and rebuild. The action parses params, body and query with a schema, then calls the core service in shade\u002Ffeatures\u002Fentries\u002Fserver\u002Fcollections.ts. The service checks permission with assertCan(ctx.actor, action), validates with parseInput(Schema, input), writes in ctx.db.transaction and adds an audit entry with recordAudit, through Drizzle to Postgres (shade\u002Fkernel\u002Fdb). On an error, onError turns a ShadeError into an HTTP status and an ApiErrorBody: NOT_FOUND 404, FORBIDDEN 403, UNAUTHORIZED 401, VALIDATION 422, CONFLICT 409.\n  participant page as Vue page\u003Cbr>(apps\u002Fadmin\u002Fapp\u002Fpages)\n  participant route as Route and action\u003Cbr>(apps\u002Fapi)\n  participant service as Service\u003Cbr>(shade\u002Ffeatures\u002Fentries\u002F\u003Cbr>server\u002Fcollections.ts)\n  participant db as Postgres\u003Cbr>(shade\u002Fkernel\u002Fdb)\n  page->>route: $fetch('\u002Fapi\u002Fcollections\u002Fposts\u002F123')\n  Note over route: route (apps\u002Fapi\u002Fsrc\u002Froutes\u002Fapi.ts)\u003Cbr>→ action show (apps\u002Fapi\u002Fsrc\u002Fhttp\u002Fcontrollers\u002Fcollections.ts)\u003Cbr>group middleware: withSession()\u003Cbr>→ ServiceContext { db, actor, via, files, rebuild }\n  Note over route: 1. parse params\u002Fbody\u002Fquery with a schema\u003Cbr>(param\u002Fbody\u002Fquery helpers)\n  route->>service: 2. call the core service\n  Note over service: 1. assertCan(ctx.actor, action): permission check\u003Cbr>2. parseInput(Schema, input): validation\u003Cbr>3. ctx.db.transaction(tx => …): writes\u003Cbr>4. recordAudit(tx, …): audit entry\n  service->>db: Drizzle\n  route-->>page: onError: ShadeError → HTTP status + ApiErrorBody\u003Cbr>(NOT_FOUND 404, FORBIDDEN 403, UNAUTHORIZED 401,\u003Cbr>VALIDATION 422, CONFLICT 409)\n",[623,3464,3465,3470,3475,3480,3485,3490,3495,3500,3505,3510,3515,3520,3525,3531],{"__ignoreMap":668},[672,3466,3467],{"class":674,"line":675},[672,3468,3469],{},"sequenceDiagram\n",[672,3471,3472],{"class":674,"line":681},[672,3473,3474],{},"  accTitle: A request's path from an admin screen to the database\n",[672,3476,3477],{"class":674,"line":687},[672,3478,3479],{},"  accDescr: A Vue page in apps\u002Fadmin\u002Fapp\u002Fpages calls $fetch('\u002Fapi\u002Fcollections\u002Fposts\u002F123'). The route in apps\u002Fapi\u002Fsrc\u002Froutes\u002Fapi.ts runs action show in apps\u002Fapi\u002Fsrc\u002Fhttp\u002Fcontrollers\u002Fcollections.ts; the group's middleware, withSession(), gives it a ServiceContext with db, actor, via, files and rebuild. The action parses params, body and query with a schema, then calls the core service in shade\u002Ffeatures\u002Fentries\u002Fserver\u002Fcollections.ts. The service checks permission with assertCan(ctx.actor, action), validates with parseInput(Schema, input), writes in ctx.db.transaction and adds an audit entry with recordAudit, through Drizzle to Postgres (shade\u002Fkernel\u002Fdb). On an error, onError turns a ShadeError into an HTTP status and an ApiErrorBody: NOT_FOUND 404, FORBIDDEN 403, UNAUTHORIZED 401, VALIDATION 422, CONFLICT 409.\n",[672,3481,3482],{"class":674,"line":693},[672,3483,3484],{},"  participant page as Vue page\u003Cbr>(apps\u002Fadmin\u002Fapp\u002Fpages)\n",[672,3486,3487],{"class":674,"line":699},[672,3488,3489],{},"  participant route as Route and action\u003Cbr>(apps\u002Fapi)\n",[672,3491,3492],{"class":674,"line":705},[672,3493,3494],{},"  participant service as Service\u003Cbr>(shade\u002Ffeatures\u002Fentries\u002F\u003Cbr>server\u002Fcollections.ts)\n",[672,3496,3497],{"class":674,"line":711},[672,3498,3499],{},"  participant db as Postgres\u003Cbr>(shade\u002Fkernel\u002Fdb)\n",[672,3501,3502],{"class":674,"line":717},[672,3503,3504],{},"  page->>route: $fetch('\u002Fapi\u002Fcollections\u002Fposts\u002F123')\n",[672,3506,3507],{"class":674,"line":723},[672,3508,3509],{},"  Note over route: route (apps\u002Fapi\u002Fsrc\u002Froutes\u002Fapi.ts)\u003Cbr>→ action show (apps\u002Fapi\u002Fsrc\u002Fhttp\u002Fcontrollers\u002Fcollections.ts)\u003Cbr>group middleware: withSession()\u003Cbr>→ ServiceContext { db, actor, via, files, rebuild }\n",[672,3511,3512],{"class":674,"line":729},[672,3513,3514],{},"  Note over route: 1. parse params\u002Fbody\u002Fquery with a schema\u003Cbr>(param\u002Fbody\u002Fquery helpers)\n",[672,3516,3517],{"class":674,"line":735},[672,3518,3519],{},"  route->>service: 2. call the core service\n",[672,3521,3522],{"class":674,"line":741},[672,3523,3524],{},"  Note over service: 1. assertCan(ctx.actor, action): permission check\u003Cbr>2. parseInput(Schema, input): validation\u003Cbr>3. ctx.db.transaction(tx => …): writes\u003Cbr>4. recordAudit(tx, …): audit entry\n",[672,3526,3528],{"class":674,"line":3527},13,[672,3529,3530],{},"  service->>db: Drizzle\n",[672,3532,3534],{"class":674,"line":3533},14,[672,3535,3536],{},"  route-->>page: onError: ShadeError → HTTP status + ApiErrorBody\u003Cbr>(NOT_FOUND 404, FORBIDDEN 403, UNAUTHORIZED 401,\u003Cbr>VALIDATION 422, CONFLICT 409)\n",[619,3538,3539],{},"Routes stay thin: parse, call, return. If a route grows logic, it belongs in core.",[619,3541,3542],{},"Who may call what is tested as a whole, so a check that goes missing fails a test:",[1363,3544,3545,3569],{},[1366,3546,3547,3550,3551,3553,3554,833,3557,3560,3561,3564,3565,3568],{},[623,3548,3549],{},"shade\u002Ftest\u002Fcontract\u002Fservice-access.test.ts"," finds every function ",[623,3552,1653],{}," and the module SDK export\nwhose first parameter is a context or a database (by its type, so ",[623,3555,3556],{},"{ db }",[623,3558,3559],{},"DbOrTx"," count too) and holds it to\nits line in ",[623,3562,3563],{},"shade\u002Ftest\u002Fcontract\u002Fservice-access.ts",": it refuses nobody, and an editor whose role grants nothing, before it\nreads or writes anything, or the line says why it needs no actor (signing in, a module's shared service, core's own\njobs), or, for one taking a database and no actor (",[623,3566,3567],{},"internal","), why its callers check first.",[1366,3570,3571,3574,3575,3578,3579,3582,3583,3586,3587,3590,3591,3594],{},[623,3572,3573],{},"apps\u002Fapi\u002Ftest\u002Fsweep\u002Faccess.test.ts"," calls every route the app serves (an untrusted module's too) as nobody, a\nvisitor, an editor, an editor with a custom role, each kind of token (data tokens that may only read, or whose owner\nmay only read) and an admin, and compares the answers with ",[623,3576,3577],{},"apps\u002Fapi\u002Ftest\u002Fsweep\u002Faccess-table.ts",", one line per route.\nSome routes are called again on a second collection, on real rows or with a real MCP call, each a line\n",[623,3580,3581],{},"METHOD \u002Fpath#variant",". A new route needs its line there; review it as you would the route. The sweep runs in four\nparts side by side (",[623,3584,3585],{},"access-2.test.ts"," to ",[623,3588,3589],{},"access-4.test.ts",", from ",[623,3592,3593],{},"routes\u002Ftesting\u002Faccess-sweep.ts","); the first one\nalso checks that the table and the app list the same routes.",[658,3596,3598],{"id":3597},"environment","Environment",[619,3600,3601,3602,3605,3606,2911,3608,3611,3612,634,3614,3617,3618,3621,3622,3624,3625,3627,3628,3631,3632,3635,3636,634,3638,833,3640,3642,3643,3645],{},"All variables are documented in ",[623,3603,3604],{},".env.example",". In development every app reads the repo-root ",[623,3607,2294],{},[623,3609,3610],{},"loadDevEnvFile"," in the API's ",[623,3613,3424],{},[623,3615,3616],{},"nuxt dev --dotenv"," for the admin, ",[623,3619,3620],{},"process.loadEnvFile"," in\n",[623,3623,1591],{},"; the site reads its own ",[623,3626,2294],{},", then SHADE's next to it). ",[623,3629,3630],{},"pnpm dev"," starts the API (port 4000)\nand the admin's dev server (port 3000, ",[623,3633,3634],{},"SHADE_API_URL","), which forwards ",[623,3637,1831],{},[623,3639,1857],{},[623,3641,1860],{}," to the API so\nthe browser sees one origin; the SHADE workspace's ",[623,3644,3630],{}," adds the site (port 4321). In production, Coolify\ninjects them.",[619,3647,3648,3650,3651,3654,3655,3658,3659,3661,3662,1596,3665,3668,3669,3671],{},[623,3649,3630],{}," runs the apps through pnpm's parallel runner, which has two traps on Windows: it takes Node flags such as\n",[623,3652,3653],{},"--env-file"," itself, and ",[623,3656,3657],{},"tsx watch"," hung under it without a word. So the API loads ",[623,3660,2294],{}," in code and its dev\nscript uses Node's own watcher and type stripping (",[623,3663,3664],{},"node --watch src\u002Fserver.ts",[623,3666,3667],{},"pnpm dev:check"," (scripts\u002Fdev-check.mjs) runs the real\n",[623,3670,3630],{},", waits until the API and the admin answer and stops them; run it after changing a dev script or a dependency\nthat starts with the apps. The API logs each start-up step (database, migrations, modules, jobs), says what to check\nwhen it cannot reach the database.",[3673,3674,3675],"style",{},"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);}",{"title":668,"searchDepth":681,"depth":681,"links":3677},[3678,3679,3680,3683,3684,3685],{"id":660,"depth":681,"text":661},{"id":754,"depth":681,"text":755},{"id":2385,"depth":681,"text":2386,"children":3681},[3682],{"id":3145,"depth":687,"text":3146},{"id":3181,"depth":681,"text":494},{"id":3458,"depth":681,"text":3459},{"id":3597,"depth":681,"text":3598},"md",null,{},true,{"title":385,"description":668},"-nxyL5-PMXCRItSD76VcXw6Zmurjb8ZaUTT9exBnmLQ",[3693,3694],{"title":375,"path":376,"stem":377,"description":668,"children":-1},{"title":389,"path":390,"stem":391,"description":668,"children":-1},1796500152444]