Giter VIP home page Giter VIP logo

x-user-service's Introduction

User service

This service will handle data login, avatar, followers & following and this service has own database. There are 2 service on this project, 1 is this service (user-service) and the other 1 is in different repo called (comment-service). User service will connect with Comment service through inter-communication using GRPC

Pre-requisite

  • Minikube
  • Docker
  • Kubectl

Technologies

  • Golang
  • GRPC
  • Gorm
  • Postgre
  • Docker
  • Kubernetes

How to deploy

$ minikube start

  • Start minikube

$ kubectl apply -f deployment/secret.yaml

  • Deploy initial secret containing env first before deploy the pod

$ sh deploy.sh

  • In this deployment command, will execute build docker image, cleanup existing deployment & pod service, and deploy it to minikube

$ kubectl port-forward service/user-svc 8081:8081

  • After pod is deployed on minikube, need to forward the port using above command because by default service port is not accesible by public. Here is using clusterIp, to make it similar like in production microservices. After that service will serve and can access using localhost:8081

Api Doc

  • HOST: localhost:8081
  • Get all organization members
    • description: in this endpoint, user-service will get related data by organization to comment-service using GRPC
    • method: GET
    • organization_name: xendit
    • endpoint: {HOST}/orgs/{organization_name}/members
    • example response: { "status": 200, "data": [ { "login": "robert", "avatar": "https://google.com", "followers": 1500, "following": 500 }, { "login": "maulana", "avatar": "https://google.com1", "followers": 324, "following": 44 } ], "message": "success" }

DB design

https://dbdiagram.io/d/5ef929340425da461f03fa2a

How to run testing

  • $ cd x-user-service/test/users
  • $ go users_test.go

x-user-service's People

Contributors

robertmaulana avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.