/kit

Microservice compatible starter kit for golang sass project

Primary LanguageGoApache License 2.0Apache-2.0

This project is under development

go-saas-kit

Kit for golang sass project

Frontend Repo: https://github.com/go-saas/kit-frontend
Layout Repo( For creating new service): https://github.com/go-saas/kit-layout

Architecture

Architecture

Feature

  • Saas
  • Modularity
  • Microservice/Monolithic compatible
  • Distributed Eventbus: kafka, pulsar
  • Cache (Redis)
  • Background Job: asynq

Quick Start

For Microservice

docker compose -f docker-compose.yml -f docker-compose.ms.yml -f docker-compose.kafka.yml -f docker-compose.tracing.yml up -d

Or with build

docker compose -f docker-compose.yml -f docker-compose.ms.yml -f docker-compose.kafka.yml  -f docker-compose.tracing.yml up -d --build

For Monolithic

docker compose -f docker-compose.yml -f docker-compose.monolithic.yml -f docker-compose.kafka.yml  -f docker-compose.tracing.yml up -d

Or with build

docker compose -f docker-compose.yml -f docker-compose.monolithic.yml -f docker-compose.kafka.yml  -f docker-compose.tracing.yml up -d --build

Demo

Open http://localhost:80 to see the web ui

Username: admin
Password: 123456

Development

make init
make all
make build

Create New Service

kratos new <name> -r https://github.com/go-saas/kit-layout.git

Modularity

Module design:

Minimal

Api: Protobuf definition for public/internal service and models

Event: Protobuf definition for distributed event bus

Biz: Domain layer, definition for all entities and repository interface

Service: Business logic, depends on biz repository interface

Data: Data access layer, implement biz repository interface, init databases( mysql ,redis), init event bus (kafka ), expose migration function

Conf: Protobuf configuration definition

Server: Set up http and grpc server. register all services, set up middlewares. set up distributed event handler, seeding behavior

Host: Process entry point, read configuration, set up tracing, logging

For Microservice:

Minimal

For Monolithic:

Minimal