micro
develop
develop
  • Micro Starter Kit
  • Features
  • Getting Started
    • Why
    • Prerequisites
    • Installation
    • Makefile
  • Concepts
    • Introduction
    • Configuration
    • State
    • Select
  • Advanced
    • Dependency Injection
    • Logging
    • Error Handling
    • Life-cycle
    • Git Flow
    • Git Ops
    • mTLS
    • Release
    • Release Process
    • Pub Sub
    • Troubleshooting
  • Modules
    • Commands
      • Demo
    • Services
      • Account
      • Emailer
      • Greeter
      • Recorder
  • DevOps
    • Docker
    • KinD
    • Istio
  • Testing
    • Intro
    • Mock
    • Bloom RPC
  • Recipes
    • Authentication
    • Caching
    • Health Checks
    • Performance Testing
    • Dynamic Plugins
    • Immutability Helpers
    • Style Guide
    • Unit Testing
  • Community
    • Resources
    • Contributors
    • Contributing
  • Change Log
  • FAQ
Powered by GitBook
On this page
  • Build Status
  • Quality
  • Overview
  • What you get
  • Getting Started
  • Prerequisite
  • Initial Setup
  • Run
  • Test
  • GitOps
  • Make
  • Docker
  • Release
  • Deploy
  • Reference
  • Project Docs
  • External Docs

Was this helpful?

Micro Starter Kit

NextFeatures

Last updated 4 years ago

Was this helpful?

Microservices starter kit for Golang, aims to be developer friendly.

Build Status

Quality

Overview

What you get

Getting Started

Prerequisite

Initial Setup

clone the repo

git clone https://github.com/xmlking/micro-starter-kit ~/Developer/Work/go/micro-starter-kit
# pull dependencies (when every time `go.mod` changed)
go mod download

Run

Database

By default this project use embedded sqlite3 database. if you want to use postgreSQL,

  • start postgres via docker-compose command provided below

  • uncommend postgres import statement and comment sqlite in plugin.go

  • start micro server with --configFile=config.dev.postgres.yaml flag

    i.e., go run srv/account/main.go srv/account/plugin.go --configFile=config.dev.postgres.yaml

# to start postgres in foreground
docker-compose up postgres
# to stop postgres
docker-compose down
# if needed, remove `postgres_data` volume to recreate database next time, when you start.
docker system prune --volumes

Services

Node: --server_address=localhost:5501x --broker_address=localhost:5502x required only when you are behind VPN a.k.a Work From Home

# dev mode
make run-account
# or
make run-account ARGS="--server_address=localhost:55011 --broker_address=localhost:55021"
# or
go run srv/account/main.go srv/account/plugin.go \
--configDir deploy/bases/account-srv/config \
--server_address=localhost:55011 --broker_address=localhost:55021

make run-greeter
# or
make run-emailer ARGS="--server_address=localhost:55012 --broker_address=localhost:55022"

make run-emailer
# or
make run-emailer ARGS="--server_address=localhost:55013 --broker_address=localhost:55023"


# integration tests for config module via CMD
make run TARGET=demo TYPE=cmd
go run cmd/demo/main.go --help
go run cmd/demo/main.go --database_host=1.1.1.1 --database_port=7777

export APP_ENV=production
go run cmd/demo/main.go

Test

GitOps

Make

Docker

Release

Deploy

make docker DOCKER_REGISTRY=docker.pkg.github.com DOCKER_CONTEXT_PATH=xmlking/micro-starter-kit
docker rmi $(docker images -f "dangling=true" -q)

# make kustomize OVERLAY=e2e NS=default VERSION=v0.1.0-440-g6c7fb7a
make kustomize
kubectl apply -f build/kubernetes.yaml

POD_NAME=$(kubectl get pods  -lapp.kubernetes.io/name=account-srv -o jsonpath='{.items[0].metadata.name}')
kubectl logs -f -c srv $POD_NAME

kubectl delete -f build/kubernetes.yaml

Reference

Project Docs

External Docs

Input Validation with

CRUD Example using , , next?

GORM code gen via or use ?

Dependency injection , Try next?

One Step build/publish/deploy with

BuildInfo with

Linting with linters aggregator

Linting Protos with

CICD Pipelines with

Kubernetes Matrix Deployment with

Add k8s with

Service Mesh with

GraphQL Gateway with , ,

Graph-Based ORM

Switch to

Refer docs

Also Refer docs

Refer docs

Refer docs

Refer docs

Refer docs

- example usage code for micro

- a place for prebuilt microservices

- which aggregates micro based open source projects

extensible micro plugins

protoc-gen-validate (PGV)
GORM
benchmarks
XORM
protoc-gen-gorm
protoc-go-inject-tag
Container
wire
ko
govvv
GolangCI
Buf
GitHub Actions
Kustomize
healthchecks
cmux
Istio
gqlgen
rejoiner
gqlgen
ent
Bazel Build
prerequisites
scaffolding
testing
makefile
docker
releasing
prerequisites
scaffolding
makefile
testing
docker
gitops
Protobuf Style Guide
Google Protobuf Style Guide
Go-Micro Getting Started
examples
microhq
explorer
micro-plugins
step-by-step-guide-micro
micro-in-cn
Platform Web
grpc template
Simple API backed by PostgresQL, Golang and gRPC
Renovate dependency Status
MIT license
Build Status
Total alerts
codecov
Language grade: Go
Image of Deployment
Go
Go Report Card
GoDoc
fuzzit