尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证正在加载完整 README。 以下为已保存的摘录。
A full-stack e-commerce storefront for the luxury fashion brand "Vuja-de",
built as a portfolio project. Shoppers browse, add items to a cart and pay
through Stripe Checkout. Admins manage products, stock and orders.查看完整 README ↗A full-stack e-commerce storefront for the luxury fashion brand "Vuja-de", built as a portfolio project. Shoppers browse, add items to a cart and pay through Stripe Checkout. Admins manage products, stock and orders.
The storefront is the easy part. Most of the work is the engineering around it:
The filter throughout, from dejavu-mvp-roadmap.md,
is that every decision should hold up to fifteen minutes of questioning.
Anything justified only by "scale" was cut, because this store has no
traffic.
| Phase | What | State |
|---|---|---|
| 0–1 | Secret hygiene, test harness, CI gate | Done |
| 2 | Supabase → plain Postgres, versioned migrations | Done |
| 3 | Correctness fixes: transactional webhook, atomic stock | Done |
| 4 | Integration tests against real Postgres in CI | Done; browser E2E deferred |
| 5 | Terraform, GitHub OIDC, SSM-backed secrets | Done |
| 6 | Backend on Lambda + RDS in dev, verified live | Done |
| 7 | Dev (staging) → prod CD with automatic rollback | Code merged, not yet run against AWS. Prod isn't stood up. |
Phase 7's remaining steps touch live AWS, GitHub, Stripe and Vercel, so a
human runs them. They're tracked as needs-human issues and scripted in
phase-7-runbook.md. Nothing below describes the
pipeline as proven live until that runbook's checkpoint drill has run.
flowchart LR
user([Shopper]) --> spa["React SPA<br/>(Vercel)"]
spa -->|"HTTPS, VITE_API_URL"| url["Lambda Function URL<br/>(on the 'live' alias)"]
url --> api["api Lambda<br/>Express + Lambda Web Adapter<br/>arm64 container"]
subgraph vpc["VPC (private subnets)"]
api --> rds[("RDS Postgres 16<br/>private, TLS-only")]
mig["migrator Lambda<br/>node-pg-migrate"] --> rds
end
api -->|"via NAT instance"| stripe["Stripe API"]
api -->|"via NAT instance"| aws["SSM · Secrets Manager"]
stripe -->|"checkout.session.completed<br/>signed webhook"| url
spa -->|"redirect to pay"| checkout["Stripe Checkout"]
dejavu/): React 19 + Vite. The single-page app
is hosted on Vercel, and all global state lives in App.jsx.backend/): an Express REST API run unchanged on
Lambda through the Lambda Web Adapter. One Dockerfile builds two targets,
the api image and a migrator image.docker compose locally and a private RDS
instance when deployed. Schema changes are plain-SQL migrations run by
node-pg-migrate. The data layer is a single pg.Pool plus repositories;
there's no ORM..tf file. The database password rotates weekly without a redeploy.terraform/. There's one
bootstrap/ config, applied by a human, plus envs/dev and envs/prod,
applied by CI through GitHub OIDC roles. No AWS keys live in the repo.flowchart LR
pr["Pull request"] --> ci["CI: lint, unit, integration,<br/>migrations up/down/up,<br/>migration-safety guard, image build"]
ci -->|"required check 'ci'"| main["merge to main"]
main --> push["push images to ECR<br/>tagged by git SHA"]
push --> dev["deploy dev (staging)<br/>migrate → publish → move alias<br/>→ smoke → auto-rollback"]
dev --> gate{{"manual approval<br/>(production environment)"}}
gate --> promote["promote-check:<br/>same image digests as dev"]
promote --> prod["deploy prod<br/>same scripts"]
scripts/deploy/
publishes a version, points live at it, and runs smoke.sh. There are
three checks under a hard 15 s budget. If any fails, the alias goes back to
the previous version, and the rollback is smoke-tested too.backend/MIGRATIONS.md.checkout.oversell log-metric alarm.| Claim | How | Proven by |
|---|---|---|
| A webhook delivered twice, or concurrently, creates one order | The Stripe event id is claimed with INSERT … ON CONFLICT DO NOTHING in the same transaction as the order (stripeEventRepo.js) | concurrency.test.js drives two real connections into the race. webhook.test.js covers replay. |
| Stock never goes negative | UPDATE … SET stock = stock - $n WHERE stock >= $n (variantRepo.js) | concurrency.test.js and webhook.test.js ("overselling") |
| A failed webhook is retryable, a deterministic one isn't | 500 only for failures a retry can fix. Duplicates and oversells return 200 and are logged for a human. | webhook.test.js |
| Guest orders can't be taken over by knowing an email | Orders are claimed with the buyer's own stripeSessionId (POST /api/user/orders/claim), not linked by email at registration | orders.test.js |
| The API response shapes the frontend relies on don't drift | Repositories rebuild the nested JSON the old PostgREST layer returned. The key names are recorded in tests/fixtures/apiShapes.js. | catalog.test.js ("nests variants under the PostgREST key name", "nests User and OrderItem the way the dashboard reads them") |
Mutation check, re-run 2026-09-24 against real Postgres 16 on Node 22. Each guarantee was broken on purpose, then the suite was run:
| Code reverted to | Full suite |
|---|---|
| Event claim as a read-then-write | 1 failure: concurrency.test.js's race test |
| Stock update as a read-modify-write | 4 failures: 2 in concurrency.test.js, 2 in webhook.test.js |
One caveat. With the event claim broken, webhook.test.js's "two concurrent
deliveries" test still passes when its file runs as a whole, three runs
out of three. It fails only when run on its own. The guarantee is held by
concurrency.test.js, not by that test. The execution plan's older claim
that it failed "exactly the two idempotency tests" was overstated, and has
been corrected. Fixing the test is tracked in #40.
You need Node ≥ 20 (.nvmrc pins 22), Docker, and optionally the Stripe CLI
for checkout.
git clone https://github.com/Ayprusss/dejavu.git && cd dejavu
docker compose up -d db # Postgres 16 on :5432
cd backend
cp .env.example .env # set JWT_SECRET and Stripe test keys
npm ci
npm run migrate:up
npm run seed # truncates, then loads demo products
npm run dev # API on http://localhost:5000
# second terminal
cd dejavu && npm ci && npm run dev # storefront on http://localhost:5173
# third terminal, to complete a test checkout
stripe listen --forward-to localhost:5000/api/webhooks/stripe
# paste the printed whsec_… into backend/.env as STRIPE_WEBHOOK_SECRET
To run the API and a built storefront in containers instead, use
docker compose up: the storefront is served on :5173 and the API on :5000.
Its backend service reads JWT_SECRET and the Stripe keys from your shell
or a root .env. It doesn't migrate or seed, so run those from backend/
first.
Counts as of 2026-09-24:
| Suite | Command | Needs | Count |
|---|---|---|---|
| Backend unit | npm test in backend/ | nothing | 101 |
| Backend integration | npm run test:integration in backend/ | local Postgres, whose tables it truncates | 53 |
| Frontend unit | npm test in dejavu/ | nothing | 55 |
| Deploy scripts | bash scripts/deploy/test/run.sh | jq (it fakes aws and curl) | 70 |
The integration tests' setup refuses any database host that isn't local. CI
runs all four suites, plus lint, a Prettier check, shellcheck, a boot check
that the app refuses to start without JWT_SECRET, and migrations up → down
→ up. The integration suite runs against a Postgres service container.
With dev up it's about $25–26/month at list price, and about $50 with both
environments up. The resting state, both torn down, is about $0.20/month. So
far this account has paid $0: the free tier and credits cover it. Measured
numbers and the reasoning are in
dejavu-execution-plan.md.
Deferred on purpose, with the reasons in the linked docs:
main's tests against a
PR's schema. The expand/contract rule and the migration guard stand in for
it (backend/MIGRATIONS.md).dejavu_app role yet.value_wo is adopted.webhook.test.js's concurrent-delivery test doesn't catch a broken
event claim when run with its file. See the mutation check above and
#40.POST /api/user/orders/claim exists
and is tested, but the storefront doesn't call it yet.| Doc | For |
|---|---|
CLAUDE.md | Architecture and conventions reference: routes, middleware order, data layer, deployment |
dejavu-mvp-roadmap.md | What was in scope, what was cut, and why |
dejavu-execution-plan.md | Phase-by-phase plan, "what actually turned up", verification table, cost |
phase-6-steps.md, phase-7-steps.md | The Lambda/RDS deploy and the CD pipeline, step by step |
phase-7-runbook.md | The remaining live steps, in order |
terraform/README.md | First deploy, teardown and re-create, rotation, PITR restore |
backend/README.md, dejavu/README.md | Per-workspace setup and reference |