bagashiz/go-pos
61.7
Adequate · 21 September 2026
4.3k
lines of production code
Go
primary language
4
measurements over time
What this system is
Features
Add Redis cache adapter implementation
The codebase now includes a new Redis storage adapter at internal/adapter/storage/redis. This component implements the port.CacheRepository interface, providing Set, Get, Delete, and DeleteByPrefix operations backed by the go-redis/v9 client. Users can now configure and connect to a Redis instance for caching, with the adapter handling connection setup, ping verification, and resource cleanup.
internal/adapter/storage/redis · high confidence
Core domain ports and mocks for user, category, product, order, and payment domains
The internal/core/port package now includes interface definitions and corresponding GoMock mocks for multiple core domains: user, category, product, order, and payment. Each domain has a repository interface (e.g., UserRepository, CategoryRepository) and a service interface (e.g., UserService, CategoryService) that define the core operations for that domain. Additionally, mock implementations are provided in the mock subpackage to support testing of these interfaces.
internal/core/port · high confidence
Implemented core domain services with caching and authentication
Added service implementations for authentication, categories, orders, payments, products, and users within the internal/core/service package. Each service integrates with its respective repository and a cache layer (utilizing JSON serialization and key generation utilities) to store and retrieve data. The auth service specifically handles user login by verifying credentials and generating tokens, while other services manage CRUD operations with cache invalidation strategies.
internal/core/service · high confidence
Initial HTTP API layer with authentication, user, category, product, payment, and order management
The HTTP adapter now provides a complete set of RESTful endpoints for managing users, categories, products, payments, and orders, all protected by Bearer token authentication. Users can register and log in to receive access tokens. Authenticated users can perform CRUD operations on categories, products, and payments, with admin-only write access. Orders can be created and retrieved. The router enforces role-based access control (admin vs. cashier) and validates input using custom validators for user roles and payment types. A structured logging system using slog is also introduced, switching to JSON-formatted, rotated logs in production.
internal/adapter/handler · high confidence
Initialize HTTP server with full dependency injection and service wiring
The application entry point (cmd/http/main.go) has been expanded to wire up the entire application startup sequence. This includes loading configuration, initializing structured logging, connecting to PostgreSQL and Redis, and setting up the Paseto token service. The main function now explicitly instantiates repositories, services, and HTTP handlers for users, authentication, payments, categories, products, and orders, then passes them to the router. This change establishes the complete request handling pipeline for the POS system.
cmd · high confidence
Introduce PASETO-based token service and centralized environment configuration
The application now uses PASETO for generating and verifying authentication tokens, with the new \paseto\ package implementing the \TokenService\ interface to handle token creation, encryption, and expiration checks. Additionally, a new \config\ package has been added to centralize environment variable loading for application, database, Redis, and HTTP server settings, providing a structured container for configuration values.
internal/adapter/auth · high confidence
Introduce core domain entities and error definitions
The internal/core/domain package now includes new domain entities for the application's core business logic. This includes models for User, Category, Product, Order, Payment, and TokenPayload, along with a centralized error definitions file (error.go) that standardizes error handling across the system. These changes establish the foundational data structures and error types required for the domain layer.
internal/core/domain · high confidence
PostgreSQL storage adapter initialization and migration support
The PostgreSQL adapter now includes a new db.go file that establishes the database connection using pgxpool and integrates the golang-migrate library to automatically run SQL migration files embedded in the binary. This change also adds an ErrorCode helper to extract PostgreSQL error codes from database errors, providing more specific error information to the application.
internal/adapter/storage/postgres · high confidence
Behavioural changes
Initial database schema for users, payments, orders, categories, products, and order items
The application's PostgreSQL database is initialized with six new migration files that define the core data model. This includes tables for users (with roles), payments, orders, categories, and products, along with an order-products junction table to link orders to their constituent items. These migrations establish the necessary schema for the application's primary business entities.
internal/adapter/storage/postgres/migrations · high confidence
Postgres repository layer restructured with new domain error handling
The Postgres repository layer has been restructured, introducing new repository implementations for Category, Order, Payment, Product, and User entities, each implementing their respective domain interfaces. The changes include improved error handling that maps database-specific errors (such as unique constraint violations and 'not found' conditions) to specific domain-level errors (e.g., ErrConflictingData, ErrDataNotFound), ensuring consistent error reporting across the application.
internal/adapter/storage/postgres/repository · medium confidence
Updated database schema and environment configuration
The database schema was updated to include a new 'payments' table with a 'payments\_type\_enum' for payment types (CASH, E-Wallet, EDC) and changed the 'products' table's 'sku' column from varchar to uuid with a default generation. Environment variables were expanded to include Redis configuration (REDIS\_ADDR, REDIS\_PASSWORD), token duration, and HTTP settings, while the .env.example was restructured to reflect these new configuration options.
(repo-wide) · high confidence
Dependencies
Update Go dependencies and upgrade to Go 1.22
The project's Go version is upgraded to 1.22, and numerous dependencies are updated to newer versions, including gin v1.10.0, go-paseto v1.5.2, pgx v5.6.0, and testify v1.9.0, which refreshes the project's external library versions.
(dependencies) · medium 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 62 → 62 (-0.2)
- Rubric changed (rubric-2026.08.18 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 90 → 90 (+0.6)
- Architecture 100 → 66 (-34.3)
- Maturity 60 → 55 (-4.3)
- Readiness 56 → 61 (+4.4)
- Security 56 → 69 (+13.5)
- Domain Modelling 100 → 100 (+0.0)
Resolved (42)
- Coverage not included — suite not readable by the collector
- Critical CVE: [GHSA redacted] (go.mod)
- Critical CVE: [GHSA redacted] (go.mod)
- Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
- Duplicated block (11 lines × 3) (internal/adapter/storage/postgres/repository/payment.go)
- Duplicated block (12 lines × 3) (internal/adapter/storage/postgres/repository/category.go)
- Duplicated block (12 lines × 3) (internal/adapter/storage/postgres/repository/category.go)
- Duplicated block (14 lines × 2) (internal/adapter/storage/postgres/repository/category.go)
- Duplicated block (14 lines × 2) (internal/adapter/storage/postgres/repository/order.go)
- Duplicated block (15 lines × 2) (internal/adapter/storage/postgres/repository/category.go)
- Duplicated block (15 lines × 2) (internal/adapter/storage/postgres/repository/order.go)
- Duplicated block (15 lines × 2) (internal/adapter/storage/postgres/repository/payment.go)
- Duplicated block (15 lines × 2) (internal/adapter/storage/postgres/repository/product.go)
- Duplicated block (15 lines × 2) (internal/adapter/storage/postgres/repository/user.go)
- Duplicated block (15 lines × 2) (internal/core/service/category.go)
- Duplicated block (15 lines × 2) (internal/core/service/order.go)
- Duplicated block (15 lines × 2) (internal/core/service/payment.go)
- Duplicated block (15 lines × 2) (internal/core/service/product.go)
- Duplicated block (15 lines × 2) (internal/core/service/user.go)
- Duplicated block (15 lines × 3) (internal/core/service/category.go)
- …and 22 more
New (91)
- Critical CVE: [GHSA redacted] (go.mod)
- Critical CVE: [GHSA redacted] (go.mod)
- Documentation: no licence statement (README.md)
- Duplicated block (10 lines × 4) (internal/adapter/storage/postgres/repository/category.go)
- Duplicated block (10 lines × 4) (internal/adapter/storage/postgres/repository/category.go)
- Duplicated block (10 lines × 5) (internal/core/service/category.go)
- Duplicated block (10 lines × 5) (internal/core/service/category.go)
- Duplicated block (11 lines × 4) (internal/adapter/storage/postgres/repository/category.go)
- Duplicated block (12 lines × 2) (internal/core/service/order.go)
- Duplicated block (12 lines × 3) (internal/adapter/storage/postgres/repository/category.go)
- Duplicated block (13 lines × 2) (internal/adapter/storage/postgres/repository/order.go)
- Duplicated block (13 lines × 3) (internal/adapter/storage/postgres/repository/category.go)
- Duplicated block (13 lines × 3) (internal/adapter/storage/postgres/repository/category.go)
- Duplicated block (13 lines × 4) (internal/core/service/category.go)
- Duplicated block (13 lines × 7) (internal/core/service/category.go)
- Duplicated block (14 lines × 2) (internal/adapter/storage/postgres/repository/order.go)
- Duplicated block (14 lines × 3) (internal/adapter/storage/postgres/repository/payment.go)
- Duplicated block (14 lines × 4) (internal/adapter/storage/postgres/repository/category.go)
- Duplicated block (14 lines × 4) (internal/core/service/category.go)
- Duplicated block (14 lines × 4) (internal/core/service/order.go)
- …and 71 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
bagashiz/go-pos 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 21 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 30833c4511e18ad9f02210e24f2a3b08dc84518e — 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.