Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mishnit/Grab

Backend for E-commerce using Go microservices, GRPC, Protobuf, Postgresql, Elastic search, Docker and GraphQL
https://github.com/mishnit/Grab

docker elasticsearch go golang gqlgen graphql grpc microservice postgresql protobuf

Last synced: 3 months ago
JSON representation

Backend for E-commerce using Go microservices, GRPC, Protobuf, Postgresql, Elastic search, Docker and GraphQL

Awesome Lists containing this project

README

        

# Grab

Grab: Online store based on Go microservices, GRPC, protobuf, postgresql, elastic search and GraphQL.

## create pb files
```
$ go generate catalog/server.go
$ go generate account/server.go
$ go generate order/server.go
```

## create gqlgen generated file [DO NOT DO THIS]
Note: (first make backup of graph folder before doing so or please do not re-generate this again as this will remove all the modifications made to the resolvers inside this folder, you will be bombarded with errors)
```
$ sudo go generate graphql/graph/graph.go
```

## update go.mod and go.sum files
```
$ go mod tidy
```

## Build
install all the dependencies from go.mod into vendor folder
```
$ go mod vendor
$ docker-compose up -d --build
```

Open in your browser.
or
Try sending Post request for query and mutation to in postman.

## Accesing postgres from docker container

```
$ docker ps (copy container id where postgres is running)
$ docker exec -it bash
$root@05b3a3471f6f:/# psql -U
$ \dt (look for schema name and table name)
$ SELECT * FROM .; (Example: SELECT * FROM public.orders;)
$ \q
$ exit
```