go-modular

module
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2024 License: MIT

README

Go REST API Boilerplate

Go PostgreSQL

This is a boilerplate project for building a Modular REST API in Go, aimed to speed up the process of starting a new project and structuring the app.


It uses the following major libraries:

Usage

Make sure to refactor the go module in go.mod with your corresponding module.

A .env.example file is provided in the root directory. Copy it to .env and adjust the values to your needs.

# App
APP_DEBUG=
APP_PORT=

# Database
DB_DSN="database://user:password@host:port/dbname?sslmode=&TimeZone="
DB_CONN_OPEN=
DB_CONN_IDLE=
DB_CONN_LIFETIME=

To initialize new modules, run the following command:

go run scripts/module.go <module name>

To initialize new submodules, run the following command:

go run scripts/submodule.go <module name> <submodule name>

To run the app, execute the following command:

go run cmd/app/main.go

Directories

Path Synopsis
cmd
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL