{"repo":"dhax/go-base","free":true,"listed":false,"github":"https://github.com/dhax/go-base","clone":"git clone https://github.com/dhax/go-base.git","description":"Go RESTful API Boilerplate with JWT Authentication backed by PostgreSQL","language":"Go","stars":1695,"topics":["go","restful","api","jwt","chi","postgres"],"license":"MIT","category":"auth-billing-email","readme_excerpt":"Go Restful API Boilerplate [![GoDoc Badge]][godoc] Easily extendible RESTful API boilerplate aiming to follow idiomatic go and best practice. The goal of this boiler is to have a solid and structured foundation to build upon on. Any feedback and pull requests are welcome and highly appreciated. Feel free to open issues just for comments and discussions. Features The following feature set is a minimal selection of typical Web API requirements: - Configuration using viper - CLI features using cobra - PostgreSQL support including migrations using bun - Structured logging with Logrus - Routing with chi router and middleware, following chi rest example - JWT Authentication using lestrrat-go/jwx with example passwordless email authentication - Request data validation using ozzo-validation - HTML emails with go-mail Start Application - Clone and change into this repository Local - Create a postgres database and adjust environment variables in dev.env, especially you need to change the default AUTH JWT SECRET - Run the application to see available commands: go run main.go - Run all migrations from database/migrate folder: go run main.go migrate - Run the application with command serve : go run main.go serve Using Docker Compose - Change the default AUTH JWT SECRET env var in docker-compose.yml - First start the database only: docker compose up -d postgres - Once initialize the database by running all migrations in database/migrate folder: docker compose run server ./main migrate - St","default_branch":null,"files":null,"tree":[],"storefront":"/r/dhax","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/dhax/go-base/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}