Skip to content

docs: add repo review and next production-safe implementation phase#27

Merged
cvsz merged 1 commit into
mainfrom
codex/2026-05-14/01-01-10/review-full-repo-and-report-findings
May 14, 2026
Merged

docs: add repo review and next production-safe implementation phase#27
cvsz merged 1 commit into
mainfrom
codex/2026-05-14/01-01-10/review-full-repo-and-report-findings

Conversation

@cvsz
Copy link
Copy Markdown
Member

@cvsz cvsz commented May 14, 2026

Motivation

  • Capture a production-safe next-phase plan after a full repository review to align documented wallet APIs with the repo and propose a minimal, low-risk backend increment (wallet module hardening) without touching infra or running recursive builds.

Description

  • Add docs/NEXT_PHASE_PRODUCTION_PLAN.md which records findings, the recommended small backend scope (POST /api/wallet/create, GET /api/wallet/:userId, GET /api/wallet/:userId/balance), DTO/typing guidance, validation commands, blockers, and rollback notes.

Testing

  • No automated tests were run because this is a documentation-only change; repository inspection commands and the commit succeeded.

Codex Task

@cvsz cvsz merged commit 8735b71 into main May 14, 2026
4 checks passed
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 a production-safe plan for the next phase of development, focusing on hardening the backend wallet module and addressing discrepancies between the repository and existing documentation. Review feedback highlights potential risks in exposing new API endpoints while key architectural blockers—such as the authoritative source for wallet balances and the multi-wallet persistence model—remain unresolved. A suggestion was also provided to refine the validation plan by testing the compiled build artifact rather than the source files to better simulate a production environment.

Comment on lines +32 to +33
- `GET /api/wallet/:userId/balance`
2. Back endpoints with existing Prisma `User.walletAddress` and a conservative placeholder balance provider (no chain writes).
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

Implementing a balance endpoint with a placeholder while the authoritative source is still listed as a blocker (Line 54) introduces a risk of shipping misleading data. For a production-safe plan, the source of truth (on-chain vs. internal ledger) should be defined before exposing this API to avoid technical debt and potential consistency issues.

Implement a **small, isolated backend slice** that closes the gap between documented and actual wallet API behavior while avoiding infra/runtime churn:

1. Add `wallet` module to `apps/backend/src/modules/wallet/` with:
- `POST /api/wallet/create`
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 POST /api/wallet/create endpoint is proposed while the multi-wallet persistence model is still a blocker (Line 53). Since the current Prisma schema enforces a unique walletAddress per User, the purpose of a 'create' endpoint is unclear. Defining the wallet cardinality should precede the API definition to prevent immediate architectural misalignment.


- `pnpm --filter ./apps/backend test -- wallet`
- `pnpm --filter ./apps/backend build`
- `pnpm --filter ./apps/backend exec tsx src/main.ts` (smoke run)
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

For a production-safe validation plan, it is preferable to smoke-test the compiled build artifact rather than using tsx on source files. This ensures that the build process itself is successful and that the resulting bundle behaves as expected in an environment closer to production.

Suggested change
- `pnpm --filter ./apps/backend exec tsx src/main.ts` (smoke run)
- pnpm --filter ./apps/backend exec node dist/main.js (smoke run)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant