Skip to content

A simple golang fullstack boilerplate for smart developers, Trying to do it without Third-party dependency

Notifications You must be signed in to change notification settings

deepakshrma/golang-fullstack-boilerplate

Repository files navigation

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 

About

A simple golang fullstack boilerplate for smart developers, Trying to do it without Third-party dependency

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published