https://github.com/hokkung/go-groceries
An example of Go application
https://github.com/hokkung/go-groceries
clean-architecture clean-code golang
Last synced: 3 months ago
JSON representation
An example of Go application
- Host: GitHub
- URL: https://github.com/hokkung/go-groceries
- Owner: hokkung
- Created: 2023-08-18T23:22:59.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-25T06:20:07.000Z (8 months ago)
- Last Synced: 2025-01-18T01:43:59.480Z (5 months ago)
- Topics: clean-architecture, clean-code, golang
- Language: Go
- Homepage:
- Size: 97.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# @go-groceries
An example of microservice application written by Golang.
This project is implemented by applying clean code architecture.
```
├── cmd
│ └── api
│ └── main.go
├── config
├── go.mod
├── go.sum
├── internal
│ ├── client
│ ├── di
│ ├── entity
│ ├── handler
│ ├── repository
│ ├── server
│ └── service
├── pkg
└── utils
```## Table of Contents
- [Prerequisites](#prerequisites)
- [Getting started](#getting-started)
- [Environment](#environment)
- [Testing](#testing)
- [Internal Library](#internal-library)
- [Reference](#reference)---
## Prerequisites
1. install Go
2. Install Wire [Official-Site](https://github.com/google/wire)
3. Install MockGen [Official-Site](https://github.com/golang/mock)
4. Install GraphQL [Official-Site](https://gqlgen.com/getting-started)
5. Install [SwagGo](https://github.com/swaggo/swag)
---
## Getting Started
1. Start Admin, MySQL container
- `docker compose -f /docker-compose/{file_name} up`
2. Create a `grocery` database
3. Run `make api`---
## Environment
```
export APP_SERVER_ADDR=:8081
```---
## Testing
1. Simply run command `make test`---
## Internal Library
1. HTTP Server (https://github.com/hokkung/srv)
2. Gorm Repository (https://github.com/hokkung/gorem)
3. Redis (https://github.com/hokkung/redis)---
## Reference
- [Cat APIs](https://developers.thecatapi.com/view-account/ylX4blBYT9FaoVd6OhvR?report=bOoHBz-8t)