https://github.com/ganggas95/peken-be
This project only for learn go with gin
https://github.com/ganggas95/peken-be
dependency-injection gin golang google-wire jwt-go mvc pos postgres
Last synced: about 2 months ago
JSON representation
This project only for learn go with gin
- Host: GitHub
- URL: https://github.com/ganggas95/peken-be
- Owner: ganggas95
- Created: 2023-12-26T06:44:07.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-30T22:45:34.000Z (over 1 year ago)
- Last Synced: 2024-04-17T05:36:50.910Z (about 1 year ago)
- Topics: dependency-injection, gin, golang, google-wire, jwt-go, mvc, pos, postgres
- Language: Go
- Homepage:
- Size: 16.7 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PEKEN Backend
This app is for learning purpose. Here I will learn about Golang with [Gin Web Framework](https://gin-gonic.com/)
## Requirements
- Golang
- PostgreSQL### Environtment
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.
### Project Structure
In this project, I'm using MVC structure with Dependency Injection support using [Google Wire](https://github.com/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
## Generate generated file ```wire_gen.go```
As I mention before, this project running with Dependency Injection support using [Google Wire](https://github.com/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:
```bash
$ wire
````## Build, Run and Run Test
Building the application
```bash
$ make build
```Running the application
```bash
$ make run-dev
```Running the test case
```bash
$ make run-test
```