feat(backend): add Nakama OSS local base#2
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces Nakama OSS as the primary game backend, shifting Supabase to a supporting role for identity and administrative data. The implementation includes a Dockerized environment for Nakama and Postgres, a TypeScript runtime module with a health check RPC, and comprehensive documentation including ADR 0010. Feedback focuses on improving the TypeScript runtime entry point by using idiomatic function declarations and removing redundant code.
| let InitModule: nkruntime.InitModule = function ( | ||
| ctx: nkruntime.Context, | ||
| logger: nkruntime.Logger, | ||
| nk: nkruntime.Nakama, | ||
| initializer: nkruntime.Initializer | ||
| ) { | ||
| initializer.registerRpc(rpcIdHealth, rpcHealth); | ||
| logger.info("Second Spawn Nakama runtime loaded."); | ||
| }; |
There was a problem hiding this comment.
Using a function declaration for InitModule is more idiomatic in Nakama TypeScript modules. This ensures the function is correctly hoisted and available in the global scope of the generated script, which is where the Nakama engine expects to find it.
| let InitModule: nkruntime.InitModule = function ( | |
| ctx: nkruntime.Context, | |
| logger: nkruntime.Logger, | |
| nk: nkruntime.Nakama, | |
| initializer: nkruntime.Initializer | |
| ) { | |
| initializer.registerRpc(rpcIdHealth, rpcHealth); | |
| logger.info("Second Spawn Nakama runtime loaded."); | |
| }; | |
| function InitModule( | |
| ctx: nkruntime.Context, | |
| logger: nkruntime.Logger, | |
| nk: nkruntime.Nakama, | |
| initializer: nkruntime.Initializer | |
| ) { | |
| initializer.registerRpc(rpcIdHealth, rpcHealth); | |
| logger.info("Second Spawn Nakama runtime loaded."); | |
| } |
| }); | ||
| }; | ||
|
|
||
| InitModule.bind(null); |
|
Closing this draft as obsolete. The Nakama backend direction has since moved through dev with the current runtime layout and follow-up work in PR #8, while this older branch is conflicting and still contains the superseded scaffold shape. |
Summary
Verification
Reviewer note
Draft PR because backend architecture changes still need independent reviewer pass before merge.