royfullstack/MERN-BASIC-AUTHENTICATION ? reverse-engineered prompt

Reverse engineered prompt

Build me a simple MERN style authentication app with a Node and Express backend, MongoDB for users, and basic login and signup flows.

I want users to be able to register, log in, stay signed in with a secure cookie, and log out. Please include a protected route that only works when someone is authenticated, and a public route too so I can test that the auth is working. Use environment variables for the database connection and secret values, and keep the code clean and easy to follow.

If it makes sense, set up a basic project structure in the src folder, connect everything from the server entry file, and make sure the app starts without extra manual steps. Keep it simple and practical, since this is just a basic authentication starter. If you need to check current docs for anything, go ahead and look them up online.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab