fatkharrofiqi/go-starter-template — reverse-engineered prompt
Reverse engineered prompt
Build me a clean Go backend starter API that I can use as the base for a real app.
It should have user registration, login, logout, refresh token handling, and a protected endpoint where a logged in user can get their own profile. Use JWT access tokens and keep the refresh token in an HTTP only cookie. Make sure logout actually invalidates the refresh token so it can’t be reused.
Use PostgreSQL for users and migrations, Redis for caching or token blacklist support, and keep the code organized in a clean layered way so controllers, services, repositories, middleware, config, and routes are easy to understand. Add validation for incoming requests, structured logging, config from a YAML file, and simple auth middleware for protected routes.
Please include database migration files, a sample config file, Makefile commands to install, migrate, run, and test, plus basic unit tests and simple k6 performance test examples. The API should run locally on port 3000 and include clear curl examples in the README.
Want more depth? Deep Reverse