A backend API service built with Golang GIN framework for simple restaurant system. It's a practice project for learning how to utilize the framework and other libraries to build a backend system.
$ git clone <this-repository>
$ cd /project/top
# Build API service image with monolithic structure
$ make build-mono GO_VERSION=<ver>
# Run containers (API/MySQL) locally
$ cd intra/deploy
$ docker-compose up -d
# DSN => user:pass@tcp(host:port)/dbname
./migrate -source file://./migrations -database "mysql://$DB_USER:$DB_PASS@tcp($DB_HOST:$DB_PORT)/$DB_NAME" up
- For ARM machine, you can use colima like this to ensure the env setup is workable for other arch machines
- colima start -p x86 --arch x86_64 --with-kubernetes
- If you use --network-address option as well, you will have to use ip address (127.0.0.1) instead
# User API Endpoint
$ curl -v http://localhost:<port>/api/users
# Appetizer API Endpoint
$ curl -v http://localhost:<port>/api/appetizers
# Health API Endpoint
$ curl -v http://localhost:<port>/api/health
$ curl -v http://localhost:<port>/api/health/all
- nginx ingress controller is required
# User API Endpoint
$ curl -v http://localhost/api/users
# Appetizer API Endpoint
$ curl -v http://localhost/api/appetizers
# Health API Endpoint
$ curl -v http://localhost/api/health
$ curl -v http://localhost/api/health/all