k11ngp1ng/jwt-authentication-api ? reverse-engineered prompt

Reverse engineered prompt

Build me a backend API for user sign up and login, with JWT based authentication and role based access. I want people to be able to register with a username, email, and strong password, then log in and get a bearer token they can use on protected routes. New users should always get a normal user role, and there should also be an admin only endpoint that regular users cannot access.

Please make it secure, with hashed passwords, validation for bad input, unique emails and usernames, and error responses that do not leak whether an account exists. Use SQLite for storage, create the database automatically on startup, and include Swagger so I can test the endpoints easily. I also want a clean layered setup, with separate application, domain, infrastructure, and API code, plus automated unit and integration tests. If anything needs current package or framework details, look them up online first.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab