Code Monkey home page Code Monkey logo

go-app-template's Introduction

Template Golang and Bun ORM w/ cli commands

Stack

CLI Commands

  • go run cmd/cli/main.go [command]
Command Description
app run Run fiber web server
db init Create orm default databases (locks, migrations table, etc.)
db migrate Run database migrations (migrations folder)
db rollback Rollback migrations
db create_go Create migration in golang format
db create_sql Create migration in SQL format
db create_tx_sql Create transactional migration in SQL format
db status Show database migrations status

Makefile commands

  • make [command]
Command Description
build Golang build
run-db Run docker compose database service
compose-build Run docker compose build
exec-bash Run docker compose exec in app service
run-dev Run application in dev mode with live reload

How to use

  • Create a repository choosing the template.
  • Rename go module.
  • Run make run-db to run database service.
  • Run make compose-build to build the app.
  • Run make run-dev to start the app and attach in container.
  • If application needs authentication, create a public key file and set the path in docker-compose environment (PUBLIC_KEY_PATH).
  • Inside container, run air . to run application with live reload.
  • Make sure your application is working correctly with database using GET /health, it should return {"ping":"pong"} and status code 200.
  • Enjoy !

go-app-template's People

Watchers

Douglas Simon Camargo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.