{"id":28100250,"url":"https://github.com/selfmadeengineercode/ride-sharing","last_synced_at":"2025-05-13T18:33:28.513Z","repository":{"id":287204665,"uuid":"951968788","full_name":"SelfMadeEngineerCode/ride-sharing","owner":"SelfMadeEngineerCode","description":" (WIP 🚧) Final project code for the Microservices with Go course","archived":false,"fork":false,"pushed_at":"2025-05-13T14:57:48.000Z","size":121,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-13T15:49:52.431Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SelfMadeEngineerCode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-20T14:24:43.000Z","updated_at":"2025-05-13T14:57:51.000Z","dependencies_parsed_at":"2025-04-10T14:51:55.476Z","dependency_job_id":"3aedf49c-6345-49d9-b0da-6a9c0c705a9f","html_url":"https://github.com/SelfMadeEngineerCode/ride-sharing","commit_stats":null,"previous_names":["selfmadeengineercode/ride-sharing"],"tags_count":0,"template":false,"template_full_name":"SelfMadeEngineerCode/microservices-go-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SelfMadeEngineerCode%2Fride-sharing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SelfMadeEngineerCode%2Fride-sharing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SelfMadeEngineerCode%2Fride-sharing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SelfMadeEngineerCode%2Fride-sharing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SelfMadeEngineerCode","download_url":"https://codeload.github.com/SelfMadeEngineerCode/ride-sharing/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254003391,"owners_count":21997880,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-13T18:32:12.476Z","updated_at":"2025-05-13T18:33:28.487Z","avatar_url":"https://github.com/SelfMadeEngineerCode.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Microservices with Go starter project\n\nThis is the Microservices with Go course project using Kubernetes for both local development and for production.\n\nThe goal of this template is to provide a stable starting point for building microservices with Go. \nIt comes basic, already configured Tiltfile, Dockerfiles, and a basic architecture for building microservices.\n\n## Installation\nThe project requires a couple tools to run, most of which are part of many developer's toolchains.\n\n- Docker\n- Go\n- Tilt\n- A local Kubernetes cluster\n\n### MacOS\n\n1. Install Homebrew from [Homebrew's official website](https://brew.sh/)\n\n2. Install Docker for Desktop from [Docker's official website](https://www.docker.com/products/docker-desktop/)\n\n3. Install Minikube from [Minikube's official website](https://minikube.sigs.k8s.io/docs/)\n\n4. Install Tilt from [Tilt's official website](https://tilt.dev/)\n\n5. Install Go on MacOS using Homebrew:\n```bash\nbrew install go\n```\n\n6. Make sure [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl-macos/) is installed.\n\n### Windows (WSL)\n\nThis is a step by step guide to install Go on Windows using WSL.\nYou can either install via WSL (recommended) or using powershell (not covered, but similar to WSL).\n\n1. Install WSL for Windows from [Microsoft's official website](https://learn.microsoft.com/en-us/windows/wsl/install)\n\n2. Install Docker for Windows from [Docker's official website](https://www.docker.com/products/docker-desktop/)\n\n3. Install Minikube from [Minikube's official website](https://minikube.sigs.k8s.io/docs/)\n\n4. Install Tilt from [Tilt's official website](https://tilt.dev/)\n\n5. Install Go on Windows using WSL:\n```bash\n# 1. Get the Go binary\nwget https://dl.google.com/go/go1.23.0.linux-amd64.tar.gz\n\n# 2. Extract the tarball\nsudo tar -xvf go1.23.0.linux-amd64.tar.gz\n\n# 3. Move the extracted folder to /usr/local\nsudo mv go /usr/local\n\n# 4. Add Go to PATH (following the steps from the video)\ncd ~\nexplorer.exe .\n\n# Open .bashrc file and add following lines at the bottom and save the file.\nexport GOROOT=/usr/local/go\nexport GOPATH=$HOME/go\nexport PATH=$GOPATH/bin:$GOROOT/bin:$PATH\n\n# 5. Verify the installation\ngo version\n```\n\n6. Make sure [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl-macos/) is installed.\n\n## Run\n\n```bash\ntilt up\n```\n\n## Monitor\n\n```bash\nkubectl get pods\n```\n\nor\n\n```bash\nminikube dashboard\n```\n\n## Deployment (Google Cloud example)\nIt's advisable to first run the steps manually and then build a proper CI/CD flow according to your infrastructure.\n\n## 0. Environments\n```bash\nREGION: europe-west1 # change according to your location\nPROJECT_ID: \u003cyour-gcp-project-id\u003e\n```\n\n## 1. Create and Switch to Application Namespace\n```bash\n# Create the namespace\nkubectl apply -f infra/production/k8s/namespace.yaml\n\n# Switch to the namespace for subsequent commands\nkubectl config set-context --current --namespace=ride-sharing\n```\n\n## 2. Build Docker Images\nBuild all docker images and tag them accordingly to push to Artifact Registry.\n```bash\n# Api gateway \ndocker build -t {REGION}-docker.pkg.dev/{PROJECT_ID}/ride-sharing/api-gateway:latest --platform linux/amd64 -f infra/production/docker/api-gateway.Dockerfile .\n\n# Driver service \ndocker build -t {REGION}-docker.pkg.dev/{PROJECT_ID}/ride-sharing/driver-service:latest --platform linux/amd64 -f infra/production/docker/driver-service.Dockerfile .\n\n# Trip service \ndocker build -t {REGION}-docker.pkg.dev/{PROJECT_ID}/ride-sharing/trip-service:latest --platform linux/amd64 -f infra/production/docker/trip-service.Dockerfile .\n\n# Payment service \ndocker build -t {REGION}-docker.pkg.dev/{PROJECT_ID}/ride-sharing/payment-service:latest --platform linux/amd64 -f infra/production/docker/payment-service.Dockerfile .\n```\n\n## 3. Create a Artifact Registry repository\nGo to Google Cloud \u003e Artifact Registry and manually create a docker repository to host your project images. \n\n## 4. Push the Docker images to artifact registry\n\nDocker push the images. \nIf you get errors pushing:\n1. Make sure to `gcloud login`, select the right project or even `gcloud init`.\n2. Configure artifact on your docker config `gcloud auth configure-docker {REGION}-docker.pkg.dev` [Docs](https://cloud.google.com/artifact-registry/docs/docker/pushing-and-pulling#cred-helper)\n\n\n## 5. Create a Google Kubernetes Cluster\nYou can either run a `gcloud` command to start a GKE cluster or manually create a cluster on the UI (recommended).\n\n## 6. Update manifests files\n\nConnect to your remote cluster and apply the kubernetes manifests.\n\n```bash\ngcloud container clusters get-credentials ride-sharing-cluster --region {REGION}--project {PROJECT_ID}\n```\n\nNext, upload each manifest by hand to make sure the correct order is maintained.\n\n```bash\n# First, apply the app-config secret\nkubectl apply -f infra/production/k8s/app-config.yaml\n\n# Storage\nkubectl apply -f infra/production/k8s/mongodb-deployment.yaml\nkubectl apply -f infra/production/k8s/mongodb-express-deployment.yaml\n\n# Jaeger\nkubectl apply -f infra/production/k8s/jaeger-deployment.yaml\n\n# RabbitMQ\nkubectl apply -f infra/production/k8s/rabbitmq-deployment.yaml\n\n# Then, apply the services\nkubectl apply -f infra/production/k8s/api-gateway-deployment.yaml\nkubectl apply -f infra/production/k8s/driver-service-deployment.yaml\nkubectl apply -f infra/production/k8s/trip-service-deployment.yaml\nkubectl apply -f infra/production/k8s/payment-service-deployment.yaml\n```\n\nIf you need to redeploy you can use the same command above or just `kubectl apply -f infra/production/k8s`\nSometimes pods might need to be deleted for new ones to be deployed.\n\n```bash\nkubectl get pods\nkubectl delete pod \u003cpod-name\u003e\n\n# or for all deployments\nkubectl rollout restart deployment\n```\n\n## 7. Enjoy!\n```bash\nGet the External IP from the api-gateway\nkubectl get services\n```\n\nGo back to locally developing your project by changing kubernetes context\n```bash\nkubectl config get-contexts\n\n# For Docker Desktop\nkubectl config use-context docker-desktop\n\n# OR for Minikube\nkubectl config use-context minikube\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselfmadeengineercode%2Fride-sharing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fselfmadeengineercode%2Fride-sharing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselfmadeengineercode%2Fride-sharing/lists"}