How tx7do/kratos-cms works
Project type and purpose
• This is a full-stack blog/CMS system called “Kratos-Blog.”
• Backend is written in Go, using the Kratos microservice framework, Bazel for builds, Docker for containerization.
• Frontend is a Vue-3 + TypeScript SPA (“admin” panel). There is also a visitor-facing frontend (not shown here).
High-level file-structure analysis
• Top-level:
• backend/ – Go microservices and shared code
• frontend/admin/ – Vue3 SPA for administrators
• Docker, CI/CD, and Bazel config files in root and .github/
• backend/app/ has three sub-services under app/:
• admin/service – Admin API service
• core/service – Core blog logic (posts, categories, ent ORM, DB access)
• front/service – Public (“view”) API service
• backend/api/protos & backend/api/gen – Protobuf definitions and generated Go stubs for gRPC + HTTP gateway
• backend/pkg – Shared utilities (cache, middleware, util packages)
• frontend/admin/src – Vue app split into modules: api (HTTP clients), store, router, components, views
Key insights from README
• The system provides CRUD for posts, comments, categories, tags, attachments, pages, subscriptions, etc.
• Backend services communicate via gRPC (with HTTP gateway for REST) and use registry/tracing/config from go-kratos.
• Frontend admin communicates over HTTP to the Admin service.
Main components
a. External actors:
• Admin user (browser)
• Public visitor (browser or RSS client)
b. Entry points / API layer:
• Frontend Admin SPA (served by web server or CDN)
• Admin API Gateway (HTTP → gRPC) – implemented in admin/service
• Public API Gateway (HTTP → gRPC) – implemented in front/service
c. Microservices mesh:
• admin/service
• core/service
• front/service
• (optionally comment, file, user domain services if separated, though in this project they’re packaged as modules under core or admin)
d. Shared infrastructure:
• Service Registry (Consul/Eureka/Zookeeper as configured)
• Configuration Service (remote.yaml in configs)
• Tracing/Logging backends (Jaeger, Prometheus)
e. Data stores:
• Relational DB (MySQL/PostgreSQL) – used by core/service via ent ORM
• Object Storage (MinIO or OSS) – for attachments/files
• Cache (Redis) – for tokens, sessions
f. CI/CD & Deployment:
• Docker images (frontend, each service)
• Bazel build pipelines (BUILD.bazel in each service, .github workflows)
Relationships & data-flow
• Admin SPA → HTTP (Axios) → admin/service (REST endpoint)
• admin/service → gRPC → core/service, comment module, file module, user module
• front/service mirrors admin flows for public endpoints
• core/service → MySQL + MinIO + Redis
• All services ↔ Service Registry & Config Service
• CI/CD pipeline builds Docker images & deploys to cluster
Architectural patterns / design principles
• Microservices (each bounded context as a separate service)
• API gateway pattern (HTTP → gRPC translation)
• Domain-driven modules (admin, core, front, file, comment, user)
• Code-generation from Protobuf for gRPC + REST
• Ent ORM for type-safe data access
• Centralized config, registry, tracing
Technologies / frameworks
• Go, go-kratos, Bazel, Docker
• gRPC, HTTP gateway, Protobuf, buf
• Ent ORM
• MySQL, MinIO, Redis, Prometheus, Jaeger
• Vue3, TypeScript, Vite, Axios, Pinia/Vuex, Vue-Router