Skip to content

Latest commit

 

History

History
93 lines (65 loc) · 2 KB

README.md

File metadata and controls

93 lines (65 loc) · 2 KB

golang-fullstack-boilerplate

This repository is a fullstack golang sample project. This repo includes Golang along with postgres database and Lit element as UI framework. This is going to be awesome!!

TODO

  • Update readme
  • Unit and integration test along with test architecture
  • singleton
  • Sample Todo working app with test sample.

Project Structure

dir.png

How to create multiple ENV files

Navigate to env folder and create files pattern application.{APP_MODE}.env Here {APP_MODE} is different profile.

Setup docker

docker compose up

How to run

  1. Local

    go run ./cmd/server
  2. Prod other env

    APP_MODE={env} go run ./cmd/server
    
    ## Example prod
    APP_MODE=prod go run ./cmd/server
  3. Using make command

    make run
    
    ## Dev mode
    make dev
    

How to set logger

You can set diff log level using env variable LOG_LEVEL={debug,info,warn,error} in environment filesapplication.env. The default is LOG_LEVEL=info.

APP_VERSION=1.0.0
LOG_LEVEL=error

Setup postgres database

To run application, You need to run postgres database. You can easily do that using postgres

docker-compose up --build -d 

Useful docker command

docker-compose up --build -d 

docker compose stop
docker compose rm -f
docker exec -it 4c0f5f4acb0c /bin/sh