manthanank/otp-generator ? reverse-engineered prompt
Reverse engineered prompt
Build me a simple backend app that can generate a one time password, email it to a user, and then verify it when they send it back. I want it to feel like a clean starter project for email OTP login or verification.
Use Node and Express with MongoDB for storing OTP records, and set it up so email sending works through SMTP. There should be two main API routes, one to request an OTP with an email address, and one to verify the email plus OTP. If it makes sense, return a JWT after successful verification. Please make sure OTPs are generated securely, saved properly, and handled with sensible validation and error messages.
Include environment variable setup for the port, database connection, SMTP settings, sender email, and JWT secret, with an example env file. Add a small public facing page or basic test UI only if it’s already natural for the project, otherwise focus on the API. Make it easy to run in dev and production, and look up current docs online if you need to.
Have a live product UI? Try website reverse