Skip to content

bariscan97/grpc-microservices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ecomm Microservice

This is an ecomm microservice that consists of ecomm-api, ecomm-grpc, and an ecomm-notification microservices.

Ecomm Architecture

Ecomm Architecture

Run the gRPC and API Microservices

Database Setup


docker pull mysql:8.4

docker run --name ecomm-mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=password -d mysql:8.4

Pull and run the mysql image in a detached mode (-d) with port-forwarding and an environment variable.


docker exec -i ecomm-mysql mysql -uroot -ppassword <<< "CREATE DATABASE ecomm;"

Make the CREATE DATABASE query in the mysql container with docker exec.


docker run -it --rm --network host --volume ./db:/db migrate/migrate:v4.17.0 -path=/migrations -database "mysql://root:password@tcp(localhost:3306)/ecomm" up

Apply the migration files in db/migrations by running the golang-migrate image with the up command.

Run the Go Apps


go run cmd/ecomm-grpc/main.go

go run cmd/ecomm-api/main.go

About

🔰 golang grpc-microservices

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published