Skip to content

cshimegi/go-gin-restaurant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-restaurant

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.

How to run?

$ 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

How to migrate database

# 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

API Calls with using docker-compose

  • 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

API Calls with using k3s

  • 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

Reference

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published