Files
core2026/docs/architecture/rewrite-plan.md
T
Hide_D fa22562bb1 refactor: migrate RNG and utility functions to common package
- Removed RNG interface and related utility classes from logic package.
- Added RNG interface and utility classes in common package.
- Implemented various RNG classes (ConstantRNG, MidpointRNG, SineRNG, SequenceRNG) in common package.
- Updated conversion utilities for BytesLike to ArrayBuffer and Uint8Array in common package.
- Adjusted tests to import RNG utilities from the new common package.
- Updated vitest configuration to resolve common package imports.
2025-12-28 12:27:47 +00:00

1.7 KiB

TypeScript Rewrite Plan

The rewrite targets a pnpm workspace-based monorepo with Node.js services and Vue 3 frontends.

Planned Layout

  • /packages/common: shared utilities and type definitions (RNG/bytes/테스트 RNG 포함, no infra)
  • /packages/infra: Prisma/Redis connectors and other runtime infra
  • /packages/logic: pure game logic with DI and interfaces
  • /app/gateway-frontend: gateway UI
  • /app/gateway-api: gateway service
  • /app/game-frontend: game UI
  • /app/game-api: game backend per server+scenario profile
  • /app/game-engine: turn daemon per server+scenario profile
  • /tools/build-scripts: build and deployment scripts

Runtime Stack (Planned)

  • Backend: Node.js + Fastify
  • API: tRPC + zod
  • ORM: Prisma
  • Frontend: Vue 3, Pinia, Vue Router, TailwindCSS, Vite
  • Data: PostgreSQL, Redis sessions
  • Testing: Vitest

Frontend Direction

  • Gateway and game apps are separate SPAs (/app/gateway-frontend, /app/game-frontend).
  • UI visuals should stay close to the legacy look, but layout changes are allowed as long as required information is preserved.
  • Prefer client-driven rendering: fetch most data via API and let the client own data shaping and presentation unless the data must be hidden.

Constraint Evaluation Contract

The shared constraint contract (daemon vs API precheck split) is documented in docs/architecture/rewrite-constraints.md.

Legacy Data Migration

  • Legacy data is for migration only; the rewrite runtime does not depend on it.
  • Once DB migration is complete, legacy data can be retired.

Profiles (Planned)

  • Profiles are server+scenario pairs; scenario selection is required for build/runtime.
  • Server IDs: che, kwe, pwe, twe, nya, pya