Skip to content

feat(backend): add Nakama OSS local base#2

Closed
JOY (JOY) wants to merge 8 commits into
devfrom
codex/nakama-backend-base
Closed

feat(backend): add Nakama OSS local base#2
JOY (JOY) wants to merge 8 commits into
devfrom
codex/nakama-backend-base

Conversation

@JOY
Copy link
Copy Markdown
Contributor

Summary

  • accept Nakama OSS as the primary game-backend direction in ADR 0010
  • add local Docker Compose setup for Nakama 3.38.0 + Postgres
  • add a minimal TypeScript runtime module with secondspawn_health RPC
  • update agent context and GitBook setup docs

Verification

  • docker compose config
  • docker compose up -d --build
  • Nakama/Postgres containers healthy
  • HTTP healthcheck returned 200
  • authenticated device and called secondspawn_health RPC successfully
  • Playwright opened Nakama Console at http://127.0.0.1:7351/#/login

Reviewer note

Draft PR because backend architecture changes still need independent reviewer pass before merge.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread backend/nakama/modules/src/main.ts Outdated
Comment on lines +3 to +11
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.");
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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.");
}

Comment thread backend/nakama/modules/src/main.ts Outdated
});
};

InitModule.bind(null);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The call to InitModule.bind(null) is redundant and has no effect. The bind method returns a new function without modifying the original, and since the return value is not assigned or used, this line is dead code and should be removed.

@JOY
Copy link
Copy Markdown
Contributor Author

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.

@JOY JOY (JOY) closed this May 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant