Skip to content
This repository has been archived by the owner on Jul 20, 2024. It is now read-only.

LookinLabs/GoBlitz

Repository files navigation

GoBlitz

⚠️ Warning: Archived Project. Please check instead - https://github.com/KostLinux/go-skeleton-app

GoBlitz is a powerful framework built on top of Gin Gonic, designed to help develop production ready web applications in Golang. GoBlitz creates an abstraction layer for the Gin-Gonic framework and provides a structured way to build web applications. It is designed to be fast, secure, and easy to use. The framework is built with security in mind and provides a set of security features to protect web applications from common web vulnerabilities.

Feel free to fork this repository as website boilerplate for your next project.

Technologies used

Available Make Commands

  • make build - Build the application
  • make run - Run the application
  • make test - Run the tests
  • make fumpt - Run the go fmt
  • make linter - Run the comprehensive GolangCILint to check the code quality
  • make gosec - Run the GoSec to check code for vulnerabilities
  • make mod-vendor - Vendor the dependencies
  • make validate - Runs make linter, make test and make gosec to validate the code
  • make migrate-create MIGRATION_NAME - Create a new migration
  • make migrate-up - Run the migrations
  • make migrate-down - Rollback the migrations

Available Paths

  • / - Home page
  • /status - Status page
  • API_PATH/ping - API check endpoint
  • API_PATH/users - Sample Users API endpoint

Note! Replace API_PATH with the actual path of the application. By default it's /api/v1/

Getting Started

Note! Before getting started, make sure you have Goose, Air, Golang CI Lint, Gosec and Go installed on your host

  1. Clone the repository
git clone git@github.com:KostLinux/GoBlitz.git my-web-application
  1. Change the directory
cd my-web-application
  1. Configure .env
cp .env.example .env
  1. Setup the database
docker-compose up -d db
  1. Run the migrations
make migrate-up
  1. Generate STATUSPAGE_API_KEY
go run bin/api/generate_api_key.go
  1. Paste the generated key into the .env file into the STATUSPAGE_API_KEY variable

  2. Run the application

make run
  1. Visit the application in your browser

Feel free to visit the application at localhost:8000 and move around available paths

Running the application with Live Reload (Air)

  1. Install Air
curl -sSfL https://raw.githubusercontent.com/cosmtrek/air/master/install.sh | sh -s
mv ./bin/air /usr/local/bin/air
  1. Run the application with Air
make

Docs

You can find the documentation page here.

Contribution

Feel free to contribute to the project by creating a pull request.

Make sure to follow the Contribution Guidelines.