[{"data":1,"prerenderedAt":304},["ShallowReactive",2],{"docs-\u002Fdocs\u002Fmain\u002Fcontribute\u002Farchitecture":3},{"id":4,"title":5,"body":6,"description":291,"extension":292,"group":293,"meta":294,"navigation":295,"order":296,"path":297,"section":298,"seo":299,"source":300,"stem":301,"version":302,"__hash__":303},"docs\u002Fdocs\u002Fmain\u002Fcontribute\u002Farchitecture.md","Framework internals",{"type":7,"value":8,"toc":283},"minimark",[9,13,18,26,73,77,80,89,93,96,99,103,110,113,117,125,245,255,259,262,279],[10,11,12],"p",{},"goNex uses explicit registration and ordinary Go composition. Its business core is independent of HTTP, RPC and persistence adapters.",[14,15,17],"h2",{"id":16},"dependency-direction","Dependency direction",[10,19,20,21,25],{},"Business services live in ",[22,23,24],"code",{},"modules\u002FNAME\u002Fservice.go"," and use plain Go values plus small interfaces owned by the consumer. HTTP adapters own schemas and request mapping; GORM repositories and gRPC clients implement business interfaces at their boundaries. Services should not import Gin, GORM, gRPC, Protobuf or transport DTOs.",[27,28,33],"pre",{"className":29,"code":30,"language":31,"meta":32,"style":32},"language-mermaid shiki shiki-themes light-plus light-plus dark-plus","flowchart LR\n    HTTP[HTTP adapter] --> Service[Business service]\n    RPC[gRPC server adapter] --> Service\n    Service --> Port[Local dependency interface]\n    Database[GORM repository] -. implements .-> Port\n    Client[gRPC client adapter] -. implements .-> Port\n","mermaid","",[22,34,35,43,49,55,61,67],{"__ignoreMap":32},[36,37,40],"span",{"class":38,"line":39},"line",1,[36,41,42],{},"flowchart LR\n",[36,44,46],{"class":38,"line":45},2,[36,47,48],{},"    HTTP[HTTP adapter] --> Service[Business service]\n",[36,50,52],{"class":38,"line":51},3,[36,53,54],{},"    RPC[gRPC server adapter] --> Service\n",[36,56,58],{"class":38,"line":57},4,[36,59,60],{},"    Service --> Port[Local dependency interface]\n",[36,62,64],{"class":38,"line":63},5,[36,65,66],{},"    Database[GORM repository] -. implements .-> Port\n",[36,68,70],{"class":38,"line":69},6,[36,71,72],{},"    Client[gRPC client adapter] -. implements .-> Port\n",[14,74,76],{"id":75},"registration-and-lifecycle","Registration and lifecycle",[10,78,79],{},"A module receives registration capabilities, never ownership of a listener. Registration is explicit, ordered and atomic per App.Register call. The application owns listeners and managed resources. Startup failures close started resources; shutdown drains HTTP and closes resources in reverse order. Stopped applications cannot restart.",[10,81,82,83,88],{},"Dependencies register before consumers. Context-aware resource lifecycles make background work and cleanup explicit. See ",[84,85,87],"a",{"href":86},"\u002Fdocs\u002Fmain\u002Fmodules\u002F","modules and lifecycle",".",[14,90,92],{"id":91},"http-and-rpc-boundaries","HTTP and RPC boundaries",[10,94,95],{},"HTTP is unversioned by default. OpenAPI projects the registered typed endpoints. Independent versioned HTTP adapters can share one core service; legacy routes remain unless replacement is explicit.",[10,97,98],{},"gRPC is opt-in and has no default listener. Protobuf packages and Go paths carry their API major. Contracts use a separate Go module so services can depend on a shared wire contract without importing each other's business code.",[14,100,102],{"id":101},"generator-ownership","Generator ownership",[10,104,105,106,109],{},"Generators own marked registries and record hashes in ",[22,107,108],{},".gonex.json",". They plan and validate writes first, reject handwritten destination collisions and support dry runs. Runtime composition does not scan source or depend on a dependency-injection container.",[10,111,112],{},"Independent services have their own Go modules, configuration and migrations. A local go.work file is a development convenience; production dependencies must resolve independently.",[14,114,116],{"id":115},"dependencies","Dependencies",[10,118,119,120,124],{},"The framework is not dependency-free. The root go.mod declares ",[121,122,123],"strong",{},"10 direct dependencies","; indirect dependencies are recorded separately in go.mod and go.sum. Optional integrations share the module dependency graph, but HTTP-only applications need not import or start database\u002FRPC adapters.",[126,127,128,141],"table",{},[129,130,131],"thead",{},[132,133,134,138],"tr",{},[135,136,137],"th",{},"Direct dependency",[135,139,140],{},"Responsibility",[142,143,144,155,165,175,185,195,205,215,225,235],"tbody",{},[132,145,146,152],{},[147,148,149],"td",{},[22,150,151],{},"github.com\u002Fgin-gonic\u002Fgin",[147,153,154],{},"HTTP routing and middleware",[132,156,157,162],{},[147,158,159],{},[22,160,161],{},"github.com\u002Fgo-playground\u002Fvalidator\u002Fv10",[147,163,164],{},"Typed input validation",[132,166,167,172],{},[147,168,169],{},[22,170,171],{},"github.com\u002Fsanthosh-tekuri\u002Fjsonschema\u002Fv6",[147,173,174],{},"Offline OpenAPI schema validation",[132,176,177,182],{},[147,178,179],{},[22,180,181],{},"github.com\u002Fncruces\u002Fgo-sqlite3\u002Fgormlite",[147,183,184],{},"CGO-free SQLite integration",[132,186,187,192],{},[147,188,189],{},[22,190,191],{},"gorm.io\u002Fdriver\u002Fpostgres",[147,193,194],{},"PostgreSQL driver",[132,196,197,202],{},[147,198,199],{},[22,200,201],{},"gorm.io\u002Fgorm",[147,203,204],{},"Optional persistence adapter",[132,206,207,212],{},[147,208,209],{},[22,210,211],{},"google.golang.org\u002Fgrpc",[147,213,214],{},"Optional RPC transport",[132,216,217,222],{},[147,218,219],{},[22,220,221],{},"google.golang.org\u002Fprotobuf",[147,223,224],{},"Protobuf runtime and generation support",[132,226,227,232],{},[147,228,229],{},[22,230,231],{},"github.com\u002Fbufbuild\u002Fprotocompile",[147,233,234],{},"Contract compilation tooling",[132,236,237,242],{},[147,238,239],{},[22,240,241],{},"golang.org\u002Fx\u002Fmod",[147,243,244],{},"Go module validation and generator edits",[10,246,247,248,254],{},"The list above groups responsibilities; the actual source of truth is ",[84,249,253],{"href":250,"rel":251},"https:\u002F\u002Fgithub.com\u002Famkargar\u002Fgonex\u002Fblob\u002Fmain\u002Fgo.mod",[252],"nofollow","go.mod",", including any separate module requirements. Check its first require block when updating the dependency badge.",[14,256,258],{"id":257},"design-decisions-and-limits","Design decisions and limits",[10,260,261],{},"Prefer small consumer-owned interfaces and explicit constructors over global registries. Keep validation and the exported contract coherent, rather than silently projecting unsupported DTO behavior. Keep migrations explicit and immutable.",[10,263,264,265,269,270,274,275,88],{},"Service discovery is static, cancellation is cooperative and generators do not invent business mappings. See ",[84,266,268],{"href":267},"\u002Fdocs\u002Fmain\u002Fapi-reference\u002F","API decisions",", ",[84,271,273],{"href":272},"\u002Fdocs\u002Fmain\u002Fupgrades\u002F","upgrade policy"," and ",[84,276,278],{"href":277},"\u002Fdocs\u002Fmain\u002Frelease\u002F","release scope",[280,281,282],"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":32,"searchDepth":45,"depth":45,"links":284},[285,286,287,288,289,290],{"id":16,"depth":45,"text":17},{"id":75,"depth":45,"text":76},{"id":91,"depth":45,"text":92},{"id":101,"depth":45,"text":102},{"id":115,"depth":45,"text":116},{"id":257,"depth":45,"text":258},"Understand Gonex internals: application registration, transport contracts, adapters, package dependencies and generator ownership.","md","DEVELOP THE FRAMEWORK",{},true,20,"\u002Fdocs\u002Fmain\u002Fcontribute\u002Farchitecture","contribute",{"title":5,"description":291},"architecture.md","docs\u002Fmain\u002Fcontribute\u002Farchitecture","main","ZgYsNcp6hBlGMM0jlfveVy4d5bo3m6E4q0JSEqzeybI",1792521640726]