This app is for learning purpose. Here I will learn about Golang with Gin Web Framework
- Golang
- PostgreSQL
To prepare the environment for building and running the application, please follow these steps:
- Create a new file with the name
.env
. - Copy all the variables from the
.baseEnv
file. - Paste the copied variables into the
.env
file. - Edit the values of the variables in the
.env
file to match your configuration.
This will ensure that the application is properly configured before building and running it.
In this project, I'm using MVC structure with Dependency Injection support using Google Wire library. Here is the structure that I used:
Source Image from: https://medium.com/@adamszpilewicz/golang-web-application-with-mvc-like-structure-using-gin-and-pgx-dc19132adc12
As I mention before, this project running with Dependency Injection support using Google Wire library. Before we run the application, we must generate the wire_gen.go
. Every changed files that we made that configured in injector.go
, we must run this command:
$ wire
Building the application
$ make build
Running the application
$ make run-dev
Running the test case
$ make run-test