souravkarmakar300/ecom_MERN ? reverse-engineered prompt

Reverse engineered prompt

Build me the backend for a simple ecommerce app in JavaScript for a MERN project. I want a clean server that can handle users, products, a shopping cart, orders, and basic admin style actions like adding and updating products.

Please set it up so it’s easy to run locally, with sensible folder structure, environment config, and clear API routes. I’d like signup and login, protected routes for logged in users, and endpoints for browsing products, filtering or searching them, adding items to cart, placing orders, and viewing order history. If it makes sense, include password hashing, token based auth, and basic validation and error handling.

Use current best practices and feel free to look up current docs online if you need to. Keep it practical and simple, since I’m probably going to connect a frontend to it later. If anything is missing or unclear, make reasonable choices and keep the code easy to extend.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab