The second workshop of Night Login App Development Community (NADC) - Intro to gRPC using Go. This repo is intended to give an introduction to gRPC development using Go.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
There are three branches in this repository, they are:
master
: consists of basic code with no implementation on the methods. Used for code-along session.final
: consists of all implementations and ready for deployment.final-clean-arch
: consists of all implementations and ready for deployment. Developed using Clean Architecture.
- Clone repository:
git clone [email protected]:ridwanakf/nadc-intro-to-grpc.git
- Run dep:
dep ensure -v
- Generate protobuf code:
make proto
- Install postgresql: Postgresql
- Run database migrations: refer below
Running project:
make run
When running in Local, you need to run the db-migrations to setup the app's database for your local machine.
- Go to directory
nadc-intro-to-grpc/migrations
- Run
go run *.go up
This repository is organized in the following directory structure.
nadc-intro-to-grpc
|-- cmd # Contains executable codes and serves as entry point of the app
| |-- main # entry point of the app
|-- config # Configuration files needed for deployment
|-- constant # Collections of constants file for each module
|-- internal # Go files in this folder represent the Big-Pictures and Contracts of the system
| |-- app # Contains constructions of the app and other app's related configs
| | |-- config # Configuration struct for the app
| |-- delivery # Delivery layer of the app
| | |-- grpc # GRPC delivery of the app
| | |-- <other_delivery_mechanisms> # Other delivery mechanisms of the app (eg. GRPC, Console, Web, etc.)
| |
| |-- entity # Enterprise Data structures
| | |-- book.go # Data structurefor Book module
| | |-- <other_entities>.go # Other data structures, preferrably 1 struct 1 file
| |
| |-- repo # Implementations of Repository-pattern to data-sources
| | |-- db # Implementations of the repositories with Postgres database
| | |-- <other_repos> # Other Repositories implementations based on interfaces on folder internal.
| |
| |-- usecase # Usecases implementations for Application Business Logic
| | |-- book.go # Other use-case implementations based on interfaces on folder internal.
| |
| |-- repo.go # Interfaces / Contracts of all the repositories (Repository Pattern)
| |-- usecase.go # Interfaces / Contracts of all the use-cases (Application Business Logic)
|
|-- migrations # Contains Database migration files or the system
|-- vendor # Dependencies folder that's maintained by dep tool https://golang.github.io/dep/
|-- Gopkg.lock # https://golang.github.io/dep/docs/Gopkg.lock.html
|-- Gopkg.toml # https://golang.github.io/dep/docs/Gopkg.toml.html
- Golang
- Postgresql
- Protobuf
- gRPC