Categorygithub.com/ferdiebergado/go-fullstack-boilerplate
repository
3.0.1+incompatible
Repository: https://github.com/ferdiebergado/go-fullstack-boilerplate.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

go-fullstack-boilerplate

A template to scaffold a fullstack golang web application.

Features

  • Standard Go Project Layout
  • Postgresql database using database/sql with pgx driver
  • Router based on net/http ServeMux
  • Templating based on html/template
  • Optimized css and js builds
  • Database migrations
  • Hot reloading

Requirements

  • Go version 1.22 or higher
  • Docker or Podman
  • esbuild

Usage

  1. Install the cli tools.
make install
  1. Rename .env.example to .env.
mv .env.example .env
  1. Change the database password (DB_PASS).
# .env
DB_PASS=CHANGE_ME
  1. Start the database.
make db
  1. Run the server in development mode.
make dev
  1. Open the web application at localhost:8888.

Migrations

Creating Migrations

Run the migration target with the name argument set to the name of the migration.

make migration name=create_users_table

Running Migrations

Run the migrate target.

make migrate

Rolling Back Migrations

Run the rollback target.

make rollback

Running Tests

make test

Other Tasks

Consult the Makefile.

Linting

This project comes with a golangci-lint config file. Just install golangci-lint to use it.