boldbug1/eCOMx ? reverse-engineered prompt

Reverse engineered prompt

Build me a secure REST API for a multi user ecommerce backend.

I want users to be able to register and log in, get a token, browse the product catalog without logging in, and manage their own cart and orders once they are signed in. Orders should belong to the logged in user, admins should be able to see everything, and only the right roles should be allowed to create, edit, or delete products. Please make ordering safe so stock cannot go negative, and make sure order prices are saved at the time of purchase even if product prices change later.

Use a solid TypeScript server with PostgreSQL for data, Redis for caching product reads and for rate limiting, and add basic security like CORS, helmet, and password hashing. I also want clean validation, good error handling, and a few tests that cover auth, permissions, ownership, stock checks, and the main catalog and order flows. If you need to look up current docs online, go ahead.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab