tx7do/kratos-cqrs
52.0
Adequate · 20 September 2026
1.7k
lines of production code
Go
primary language
4
measurements over time
What this system is
This system is a Go-based microservice designed for IoT sensor data logging and analytics, built on the Kratos framework with a CQRS architecture. It provides gRPC APIs to list sensors and retrieve aggregated time-series data, such as averages and latest readings, while persisting information in TimescaleDB. The backend processes data asynchronously via Kafka and supports distributed tracing, service discovery, and secure authentication.
Features
Add third-party protobuf definitions and generated code
The \third\_party\ directory now includes standard Google API protobuf definitions (\google/api/annotations.proto\, \http.proto\, \httpbody.proto\) for gRPC-HTTP transcoding, validation rules from \protoc-gen-validate\ (\validate.proto\), and error code extensions (\errors.proto\). It also adds a custom \pagination\ package with \PagingRequest\ and \PagingResponse\ messages and a corresponding Go implementation (\pagination.pb.go\), enabling standardized pagination and validation across the API.
_third\party · high confidence
Initial Logger API contract and generated code
This change introduces the initial API definition for the Logger service, adding the \logger.service.v1\ package with Protobuf definitions for \Sensor\ and \SensorData\ entities. It exposes four RPC methods: \ListSensor\, \ListSensorData\, \GetSensorAvgData\, and \GetSensorAvgAndLatestData\. The commit also includes the corresponding generated Go code (gRPC clients/servers, error reasons, and Swagger JSON) for both the service and a separate \logger.job\ package, establishing the foundational interface for sensor data retrieval and aggregation.
api · high confidence
Initial SQL schema for IoT sensor data and analytics
Added the initial database schema for IoT sensor monitoring, defining 'sensors' and 'sensor\_data' tables with TimescaleDB hypertable support for time-series data. The change includes seed data for testing and provides SQL queries to retrieve sensor metrics, calculate 30-minute interval averages for CPU and temperature, and join sensor locations with their latest readings.
sql · high confidence
Initial implementation of logger job data layer and business logic
This change introduces the foundational internal structure for the logger job service. It adds the \biz\ package containing \SensorUseCase\ and \SensorDataUseCase\ to handle business operations, and the \data\ package which provides the \ent\ ORM client for database interactions (supporting MySQL and PostgreSQL) and Redis connectivity. The \conf\ package is added to define configuration schemas for servers, tracing, and data sources via Protocol Buffers. Additionally, the data layer explicitly selects the Confluent Kafka client over Sarama to address known partition consumption issues.
app/logger/job/internal · high confidence
Initial implementation of logger service data and business layers
This change introduces the core internal structure for the logger service, adding the business logic layer (biz) with use cases for listing sensors and sensor data, and the data access layer (data) which initializes connections to MySQL/PostgreSQL via the Ent ORM and Redis. It also includes the generated Ent schema definitions for the 'sensors' and 'sensor\_data' tables, configuration structures for server, database, and registry settings, and dependency injection wiring using Google Wire.
app/logger/service/internal · high confidence
Initial project scaffolding with Kratos CQRS architecture and build tooling
This change introduces the initial structure for a Go-based microservice project using the Kratos framework, implementing a CQRS (Command Query Responsibility Segregation) pattern. It adds a Makefile and app.mk to automate the generation of Protobuf API/gRPC code, Wire dependency injection, and Ent ORM models, as well as building, testing, and Docker image creation. The project is configured to use TimeScaleDB for storage, Kafka for message handling, Consul for service discovery, and Jaeger for tracing. A .gitignore file is also added to exclude build artifacts and IDE-specific files for Go, JetBrains, and VS Code environments.
(repo-wide) · high confidence
Initial release of common utility and bootstrap packages
This change introduces a new set of foundational utility packages for the application. The \pkg/util/bootstrap\ module provides infrastructure for initializing services, including configuration sources (Nacos, Consul, etcd), logging, tracing (Jaeger/OpenTelemetry), and command-line flag parsing. The \pkg/util/crypto\ package adds password hashing and verification utilities. The \pkg/util/jwt\ package handles JWT token generation and user ID extraction. The \pkg/util/entgo/mixin\ directory supplies reusable schema mixins for the Ent ORM, supporting various ID strategies (UUID, Snowflake, Auto-increment, String) and common fields (timestamps, tenant ID, tree structure). Additionally, the \pkg/util/sonyflake\ package implements distributed ID generation, and \pkg/util/pagination\ offers helper functions for database pagination.
pkg · high confidence
Initial release of logger job and service entry points
This change introduces the main entry points and dependency injection wiring for the logger job and logger service components. The job service (\app/logger/job/cmd/server\) is configured to run both gRPC and Kafka servers, while the service component (\app/logger/service/cmd/server\) exposes only a gRPC server. Both services utilize Google Wire for dependency injection to assemble their internal business, data, and configuration layers, and are set up to register with a service discovery registry (Consul) and load configuration from a remote center.
app/logger/job/cmd, app/logger/service/cmd · high confidence
Dependencies
Initial dependency manifest for kratos-cqrs
The project now includes a go.mod file defining the module 'kratos-cqrs' with Go 1.19. This establishes the core dependency graph, including go-kratos v2.6.2, ent v0.11.4, and various configuration and registry integrations for Consul, etcd, and Nacos. It also adds support for Redis, MySQL, PostgreSQL, Kafka, and OpenTelemetry tracing via Jaeger.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 49 → 52 (+2.8)
- Rubric changed (rubric-2026.08.17 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 97 → 100 (+2.9)
- Architecture 100 → 76 (-23.6)
- Maturity 44 → 52 (+7.6)
- Readiness 24 → 36 (+11.2)
- Security 100 → 81 (-19.5)
Resolved (18)
- Coverage not included — suite not readable by the collector
- Dependency hygiene not measured — no supported dependency manifest was read
- Duplicated block (10 lines × 2) (app/logger/job/internal/data/data.go)
- Duplicated block (11 lines × 2) (app/logger/job/internal/data/data.go)
- Duplicated block (11 lines × 2) (app/logger/job/internal/server/grpc.go)
- Duplicated block (13 lines × 2) (app/logger/job/internal/data/data.go)
- Duplicated block (14–15 lines × 2) (app/logger/job/internal/data/ent/schema/sensordata.go)
- Duplicated block (15 lines × 2) (app/logger/job/cmd/server/main.go)
- Duplicated block (15 lines × 2) (app/logger/job/cmd/server/main.go)
- Duplicated block (15 lines × 2) (app/logger/job/internal/data/ent/schema/sensor.go)
- Duplicated block (6 lines × 2) (app/logger/service/internal/data/sensor_data.go)
- Duplicated block (9 lines × 2) (app/logger/job/internal/server/registrar.go)
- No exposed public API
- Test reliability not included
- complexity unreadable for .go — churn × complexity hotspots could not be measured
- early-stage repository — too little history to judge knowledge freshness
- git history depth insufficient
- single-maintainer — knowledge-concentration (bus factor) risk
New (49)
- Critical CVE: [GHSA redacted] (go.mod)
- Critical CVE: [GHSA redacted] (go.mod)
- Dependency pinned to a stale untagged commit: github.com/go-kratos/kratos/contrib/config/consul/v2
- Dependency pinned to a stale untagged commit: github.com/go-kratos/kratos/contrib/config/etcd/v2
- Dependency pinned to a stale untagged commit: github.com/go-kratos/kratos/contrib/config/nacos/v2
- Dependency pinned to a stale untagged commit: github.com/go-kratos/kratos/contrib/registry/consul/v2
- Dependency pinned to a stale untagged commit: github.com/tx7do/kratos-transport/transport/kafka
- Deprecated module: go.opentelemetry.io/otel/exporters/jaeger
- Documentation: no installation or build instructions (README.md)
- Documentation: no usage examples (README.md)
- High CVE: [GHSA redacted] (go.mod)
- High CVE: [GHSA redacted] (go.mod)
- High CVE: [GHSA redacted] (go.mod)
- High CVE: [GHSA redacted] (go.mod)
- High CVE: [GHSA redacted] (go.mod)
- High CVE: [GHSA redacted] (go.mod)
- Low CVE: [GHSA redacted] (go.mod)
- Medium CVE: [GHSA redacted] (go.mod)
- Medium CVE: [GHSA redacted] (go.mod)
- Medium CVE: GO-2023-2041 (go.mod)
- …and 29 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
tx7do/kratos-cqrs was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 20 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 7a9d042cd97d92353b02a4eb6925ba29df913b5a — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-28e75b8e3254.