Skip to content

Restructure src/ into lambda/handlers/repositories/shared layers#6

Open
Valamorde wants to merge 1 commit into
refactor/phase-5-solidfrom
refactor/phase-6-restructure
Open

Restructure src/ into lambda/handlers/repositories/shared layers#6
Valamorde wants to merge 1 commit into
refactor/phase-5-solidfrom
refactor/phase-6-restructure

Conversation

@Valamorde
Copy link
Copy Markdown
Owner

Summary

Reorganises the entire src/ tree into clear architectural layers so the directory structure reflects the responsibilities of the code inside it.

Before:

src/
  connect/, disconnect/, keepalive/
  sendmessage/handlers/
  services/actions/
  shared/repositories/

After:

src/
  lambda/          # Entry points — one file per Lambda function
  handlers/
    messages/      # WebSocket message handlers — one per eventType
    services/      # HTTP action handlers — one per action
  repositories/    # All DynamoDB access (connection, scene, campaign)
  shared/          # Cross-cutting: types, constants, db/apigw singletons, key builders
  • git mv used throughout to preserve rename history
  • CDK stack entry paths updated to reflect new locations
  • ServiceContext centralised in src/shared/types.ts
  • Vitest @/ alias updated; all tests relocated to mirror the new structure

Test plan

  • pnpm test — all tests pass with no path resolution errors
  • cdk synth — no infrastructure changes

- src/lambda/       — Lambda entry points (was src/*/handler.ts)
- src/handlers/
    messages/       — sendmessage dispatch targets (was src/sendmessage/handlers/)
    services/       — HTTP action handlers (was src/services/actions/)
- src/repositories/ — data access layer (was src/shared/repositories/)
- src/shared/       — cross-cutting utilities; ServiceContext moved here from services handler
- tests/            — all tests centralised (was co-located in src/)
- vitest.config.ts: @/ alias → src/ for clean test imports
- index.ts CDK entry paths updated to match new lambda/ location
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