Skip to content

chore(aws)!: remove all AWS/Amplify code; Render blueprint + docs + README (P3.7) - #44

Merged
franciszver merged 6 commits into
mainfrom
feat/p3-7-remove-aws
Jul 24, 2026
Merged

chore(aws)!: remove all AWS/Amplify code; Render blueprint + docs + README (P3.7)#44
franciszver merged 6 commits into
mainfrom
feat/p3-7-remove-aws

Conversation

@franciszver

Copy link
Copy Markdown
Owner

Closes #34

What

The contract step of expand→migrate→contract:

  • DELETED: amplify/ (backend + 3 Lambdas), demo-proxy/ (fully ported to server in P3.5), amplify_outputs machinery, aws-amplify/@aws-amplify/*/CDK deps (package-lock 64k → 9k lines, −3,176 packages), dead templateVersioning.ts
  • main.tsx boots straight into React; local types replace type-only Amplify imports; dead aws-amplify test mocks removed (proven dead: suite green with the package present AND absent); Cognito wording in Admin UI corrected
  • render.yaml: lexforge-demo static + lexforge-api (server/, secrets sync:false); demo-proxy service dropped. preDeployCommand researched — valid but paid-only, so migrations documented as Render-Shell manual step
  • docs/SETUP.md + docs/DEPLOY.md rewritten; ADR committed (docs/adr/0001-render-migration.md)
  • README rewritten — owner approved the exact text before it entered the branch (recorded in decision log)

Verification (orchestrator re-run)

Root 35 files / 525 tests · Server 19 files / 218 · builds PLAIN:0 DEMO:0 (no outputs-file copying anywhere) · grep -ri 'aws|amplify' src/ server/: zero genuine hits · amplify/ and demo-proxy/ confirmed gone

Gates

simplify ✓ (pure deletion + docs) / security-review ✓ (no secrets; render.yaml secrets are sync:false placeholders) / deep-review ✓ (mock-deadness proven empirically; CI runs without amplify step on this very PR)

Note: the legacy Render static site's next auto-deploy will fail harmlessly (old build command references the deleted example file) and keeps serving the last good build — healed at P3.8 blueprint sync (documented in DEPLOY.md).

🤖 Generated with Claude Code

https://claude.ai/code/session_01VVPszGbfxNrVLm5diaCsFr

Delete amplify/ (Data/Auth resources + 3 Lambdas: audit-logger,
generate-argument, generate-suggestion) and amplify_outputs.example.json.
Uninstall aws-amplify, @aws-amplify/backend, @aws-amplify/backend-cli, and
the amplify-only CDK deps (aws-cdk-lib, constructs).

src/main.tsx no longer imports amplify_outputs.json or calls
Amplify.configure() - the app boots straight from React/Redux.

demoAuthClient.ts's type-only 'aws-amplify/auth' import is replaced with
local interfaces for the auth shapes the app actually uses (nextStep,
signInStep, etc.) - no runtime behavior change.

Deleted src/utils/templateVersioning.ts (Amplify-typed dead code, zero
importers anywhere in src/, confirmed by grep and by the existing
dataClient.contract.test.ts inventory comment).

Updated stale Amplify/Cognito/DynamoDB/Lambda references left over in
comments and (in Admin.tsx) user-facing copy across auth/document/
suggestions slices, Admin, Login, and presence service, plus the
dead 'aws-amplify/data'+'aws-amplify/auth' vi.mock() blocks in
App.test.tsx, Editor.test.tsx, Pages.test.tsx, and demoAuthClient.test.ts
- none of those mocks were intercepting any real import (dataClient.ts
and demoAuthClient.ts already went through the server-backed clients),
so removing them changes no test behavior; confirmed via full vitest run
before and after (35 files / 525 tests, unchanged).

Assisted-by: Claude Code (Sonnet)
Its feature set (OpenRouter proxying for demo mode's AI calls) was fully
ported to server/ with equivalent test coverage in P3.5. Remove
demo-proxy/** from vite.config.ts's vitest excludes now that the
directory no longer exists.

Assisted-by: Claude Code (Sonnet)
Build no longer needs amplify_outputs.json (Amplify removed in this
branch's first commit); the vitest/build job runs npm ci straight into
npx vitest run.

Assisted-by: Claude Code (Sonnet)
docs/SETUP.md: drop the amplify_outputs.json copy step; document the
optional local server setup (server/.env, prisma generate, npm run dev)
and running the frontend against it via VITE_API_URL.

docs/DEPLOY.md: rewrite for the target architecture (lexforge-demo static
site + lexforge-api web service). Adds Neon provisioning, JWT_SECRET
generation, and a migrations section: Render's preDeployCommand is valid
render.yaml syntax but only runs on paid instance types, and lexforge-api
is on the free plan, so 'npx prisma migrate deploy' is documented as a
manual Render-shell step instead (with a pointer to preDeployCommand as
the automation path if the service is ever upgraded to paid).

docs/adr/0001-render-migration.md: commit the ADR based on
prd/ADR-0001-render-migration-draft.md, status flipped to Accepted and
the ticket-process framing (draft status note, 'separate issue'
scaffolding language) stripped down to the technical decision record.

Assisted-by: Claude Code (Sonnet)
Replace the demo-proxy-era blueprint with the target architecture:
- lexforge-demo (static site): npm ci && npm run build, VITE_DEMO_MODE=1
  + VITE_API_URL pointing at lexforge-api, SPA rewrite.
- lexforge-api (web service, free plan, rootDir server): npm ci &&
  npx prisma generate, npm start, healthCheckPath /healthz. envVars
  DATABASE_URL / JWT_SECRET / OPENROUTER_API_KEY (sync: false, set via
  the Render dashboard on blueprint apply), ALLOWED_ORIGIN pointing back
  at lexforge-demo, DAILY_CAP=300.

This deploys on merge to main per Render's existing auto-sync, but the
services only come alive when the owner applies the blueprint + fills in
the sync:false env vars at P3.8 - Render doesn't spin up new services
from a render.yaml diff on an existing deployment by itself.

Assisted-by: Claude Code (Sonnet)
@franciszver
franciszver merged commit 143c230 into main Jul 24, 2026
2 checks passed
@franciszver
franciszver deleted the feat/p3-7-remove-aws branch July 24, 2026 11:24
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.

P3.7: Remove AWS entirely + README/architecture rewrite (OWNER APPROVAL) + render.yaml

1 participant