api/ Express backend is a 22-line stub — no real auth, no DB, no design CRUD #83
Labels
No labels
blocked:commit-ready-failed
blocked:gate-fetch
blocked:gate-lint
blocked:gate-plan
blocked:gate-research
blocked:needs-attention
blocked:needs-decision
blocked:needs-human
blocked:no-changes
blocked:verify-failed
bug
deferred
feature-request
in-progress
needs-decompose
needs-triage
quickfix
security/medium
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/Kimi_Agent_Brother_10_Digitizing_App#83
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Where:
api/src/index.ts(22 lines total).Bug:
GET /health(index.ts:7-9).POST /api/v1/auth/register(index.ts:11-13) which unconditionally returns{ status: 'ok' }with no body parsing, no validation, no user creation, no password hashing.cors,helmet,jsonwebtoken,multer,pg,drizzle-orm,bcrypt,@aws-sdk/client-s3,@aws-sdk/s3-request-presigner,winston,zod.grep -rn 'axios|/api/v1|fetch.*api' src/returns nothing./healthz(.forgejo/workflows/ci.yml:73), neverapi/src/index.ts.Why this matters:
api/is the "Express backend (design persistence, auth stub, drizzle schema)". The "auth stub" framing suggests this is deliberate — but a 201 on a no-op auth endpoint is misleading enough that any client code that calls it gets a green light for a session that doesn't exist.triage-approvedwalking in Phase C perIMPLEMENTATION_PLAN.md:23. That work has not landed.localStoragefor persistence (src/components/gallery/data.ts:16-19). That's fine for a single-device install but breaks across browsers/devices, which is the whole point of the API.Fix consistent with existing patterns:
Two paths, both grounded in what's already in the repo:
Wire the stub to a working contract (if #4 is meant to be in-flight):
api/src/db/schema.ts(3 tables:users,designs,exports).multerdep for design-file uploads.zoddep for input validation.bcrypt+jsonwebtokenfor auth (register/login → JWT in httpOnly cookie).@aws-sdk/client-s3for PES export storage inexports.pes_key.app.use(helmet())andapp.use(cors({ origin: ALLOWED_ORIGINS }))— the env var already exists atdocker-compose.actors.yml:34./api/v1/auth/{register,login,logout},/api/v1/designs(GET list / POST create / PATCH /:id / DELETE /:id),/api/v1/designs/:id/export(POST → triggers easystitch-service export).src/components/gallery/data.tsto fall back to API calls (token from cookie) when reachable.Make the stub honest (if #4 is deferred):
/api/v1/auth/register. Return 501 with{ status: 'not_implemented' }.deferred.Recommended: Path 2 first, fast. Then Path 1 as a single mega-issue tracked against the milestone for #4.
api/Express stub — zero callers, 11 unused deps, dead vite proxy/api/v1 → :3001#113