Production config management for any backend — centralized config module, env vars, no hardcoded secrets, fail-fast validation
86
77%
Does it follow best practices?
Impact
100%
1.88xAverage score across 5 eval scenarios
Passed
No known issues
A content team needs a headless CMS API to manage blog posts. Build it using Express and TypeScript with PostgreSQL for storage and AWS S3 for image uploads.
Endpoints:
GET /api/posts -- list posts with pagination and optional ?status=draft|published filterGET /api/posts/:slug -- get a single post by URL slugPOST /api/posts -- create a new post (title, body, author, tags, status)PUT /api/posts/:id -- update a postDELETE /api/posts/:id -- soft-delete a post (set deleted_at timestamp)POST /api/posts/:id/images -- upload an image to S3, return the URLBusiness rules:
Use pg for PostgreSQL and @aws-sdk/client-s3 for S3 uploads.
Produce:
src/server.ts -- server entry pointsrc/app.ts -- Express application setupsrc/routes/posts.ts -- post CRUD route handlerssrc/routes/images.ts -- image upload handlersrc/db.ts -- database connection and queriespackage.json -- with dependencies listed (no need to run npm install).gitignore -- standard Node.js gitignoreYou may create additional files as needed for a well-structured codebase.