erweixin/Go-GenAI-Stack
54.3
Adequate · 20 September 2026
20.9k
lines of production code
TypeScript
with Go
4
measurements over time
What this system is
This system is a monorepo scaffolding for a GenAI-enabled application that provides dual backend implementations in Go and Node.js, alongside React Web and React Native frontends. It establishes a complete full-stack foundation featuring user authentication, task management, and shared type synchronization between services and clients. The project includes comprehensive infrastructure for local development, testing, and production deployment, supported by extensive observability and AI-assisted development tooling.
Features
Add pluggable database persistence and Redis caching infrastructure
The persistence layer now supports switching between PostgreSQL and MySQL via a unified provider interface and factory, allowing users to configure their preferred SQL database through a single configuration type. Each database implementation includes specific SQL dialects for handling identifiers, placeholders, and auto-increment syntax. Additionally, a Redis caching layer has been introduced, supporting both standalone and cluster modes, with automatic JSON serialization for cache values and utilities for distributed locking via SetNX operations.
backend/infrastructure/persistence · high confidence
Add unified monitoring stack with Sentry, Jaeger, Prometheus, and Grafana
Introduces a new \docker/monitoring\ directory that deploys a complete observability suite via Docker Compose. This includes Sentry (v24.1.0) for frontend error tracking and performance monitoring, Jaeger for backend distributed tracing, Prometheus for metrics collection, and Grafana for visualization. The addition provides new configuration files (\docker-compose.yml\, \prometheus.yml\, \grafana-datasources.yml\), environment templates, and management scripts (\start.sh\, \stop.sh\) to enable end-to-end visibility across the application.
docker/monitoring · high confidence
Added domain linting and test automation scripts
New shell scripts have been added to the backend to automate development workflows. The \lint\_domain.sh\ script validates domain directories against specific DDD requirements, checking for mandatory files (such as \usecases.yaml\ and \ai-metadata.json\), directory structure, and consistency between use case definitions and handler implementations. The \test\_all.sh\ script provides a unified way to run Go tests across all or specific domains, with optional support for generating code coverage reports.
backend/scripts · high confidence
Backend server initialization with environment loading and observability
The backend entry point (main.go) now loads configuration from a .env file using godotenv, initializes observability components (logging, metrics, tracing), and establishes connections to PostgreSQL and Redis before starting the HTTP server. It also implements graceful shutdown handling for SIGINT/SIGTERM signals.
backend/cmd · high confidence
Centralized database management with Atlas migrations
The backend/database directory now provides a unified workflow for managing the PostgreSQL schema using Atlas. Developers can define the target state in schema.sql and use Makefile commands (init, diff, apply) to generate and apply declarative migrations automatically. The setup includes a production-ready configuration with safety constraints (preventing destructive drops) and a seed script to load demo task data for testing.
backend/database · high confidence
Initial Node.js backend bootstrap with Fastify, DDI, and monitoring
The Node.js backend infrastructure is initialized using Fastify with a Zod-based validation provider, establishing a Dependency Injection container that wires Repository, Service, and Handler layers for Auth, User, and Task domains. The server setup includes request tracing, Prometheus metrics collection, security headers, and a custom validator compiler that skips path parameter validation while enforcing body and querystring checks. A health check endpoint is exposed, and domain routes are registered dynamically via the DI container.
backend-nodejs/infrastructure/bootstrap · high confidence
Initial Node.js backend server entry point
Added the main entry point for the new Node.js backend implementation, which initializes the Fastify HTTP server, establishes connections to PostgreSQL and Redis, and registers domain-specific routes for user, auth, and task management along with middleware and dependency injection.
backend-nodejs/cmd · high confidence
Initial project scaffolding with AI-friendly architecture and documentation
Establishes the Go-GenAI-Stack monorepo structure, defining the directory layout for backend (Go, DDD), frontend (React Web, React Native), and shared resources. Introduces explicit knowledge files (rules.md, glossary.md, usecases.yaml) to support AI-assisted development and configures tygo for automatic synchronization of Go structs to TypeScript interfaces. Includes comprehensive English and Chinese documentation (README.md, README.zh.md), a .cursorrules file for AI coding assistant guidance, and standard project files like .gitignore and the MIT License.
(repo-wide) · high confidence
Initialize PostgreSQL and Redis persistence layers with connection and transaction utilities
This change introduces the foundational persistence infrastructure for the Node.js backend, adding type-safe PostgreSQL connection management via Kysely (including connection pooling, SSL support, and a connection test utility) alongside Redis connection handling with configurable timeouts and exponential backoff retry strategies. It also provides transaction helper functions to automatically manage commit and rollback logic for database operations, ensuring reliable data integrity for subsequent domain features.
backend-nodejs/infrastructure/persistence · high confidence
Initialize mobile app structure with Expo and React Native
The mobile application scaffold has been established within the frontend/mobile directory, utilizing the Expo framework (version \~54.0.25) and React Native (version 0.81.5) with the New Architecture enabled. This change introduces the core entry point (App.tsx), Expo configuration (app.json), and TypeScript setup, providing the foundational environment for building the cross-platform mobile client. Documentation including a README and an infrastructure checklist has also been added to outline the project structure and future development roadmap.
frontend/mobile · high confidence
Introduce Node.js backend with Fastify, Kysely, and TypeScript
Adds a new Node.js backend implementation for the Go-GenAI-Stack, providing an alternative to the existing Go service. The backend is built on Fastify, Kysely, and TypeScript, and includes core infrastructure such as health checks (verifying PostgreSQL and Redis), Prometheus metrics, and API rate limiting. It also establishes the User and Auth domains with full CRUD operations, handlers, and JWT-based authentication, alongside comprehensive unit and integration tests using Vitest.
backend-nodejs · high confidence
Introduce User Domain with profile management and password change capabilities
This change introduces the User Domain, providing the core infrastructure for user account management. It includes a DDD-compliant model with business rules for email uniqueness, username constraints, and bcrypt password hashing. The domain exposes three authenticated HTTP endpoints via the Hertz framework: GET /api/users/me to retrieve the profile, PUT /api/users/me to update profile details (username, full name, avatar), and POST /api/users/me/change-password to securely update passwords. Data access is implemented using the goqu SQL builder, supporting PostgreSQL, MySQL, and SQLite dialects, with a dedicated repository layer and comprehensive unit tests using sqlmock.
backend/domains/user · high confidence
Introduce shared event bus and domain event types
The backend now includes a shared eventing infrastructure within the \backend/domains/shared\ package. This adds an \InMemoryEventBus\ implementation that allows services to publish and subscribe to domain events, with built-in logging and panic recovery for handlers. Alongside the bus, a set of structured event types is introduced for the Chat and LLM domains, including \MessageSent\, \MessageReceived\, \ConversationCreated\, \ModelSelected\, and \GenerationCompleted\ events, each carrying specific payloads like token counts and latency. Additionally, common utility types for pagination, user context, request metadata, and standardized error responses are provided to support consistent API interactions across the application.
backend/domains/shared · high confidence
Introduce shared frontend packages for cross-platform type safety and utilities
This change establishes a new \frontend/shared\ directory containing three reusable packages: \@go-genai-stack/types\ (auto-generated TypeScript interfaces synced from Go backend DTOs), \@go-genai-stack/constants\ (centralized API endpoints, error codes, and LLM model metadata), and \@go-genai-stack/utils\ (shared formatting, validation, and storage adapters for Web and Mobile). These packages are configured as pnpm workspaces to ensure type consistency and code reuse across the web and mobile frontends.
frontend/web · high confidence
Introduce structured domain error types with HTTP status mapping
Added a new shared error handling package that defines a \DomainError\ type, allowing application errors to carry specific error codes, user-facing messages, and corresponding HTTP status codes. This enables consistent, structured error responses across the backend by wrapping underlying errors and providing predefined common errors for client (4xx) and server (5xx) issues, such as invalid requests, unauthorized access, and internal server errors.
backend/shared · high confidence
Introduces core middleware and observability infrastructure
This change adds the foundational HTTP middleware and monitoring infrastructure for the backend. It introduces an authentication middleware that validates JWT Bearer tokens and an optional authentication variant for mixed-access endpoints, alongside CORS, request logging, distributed tracing (OpenTelemetry), and a Redis-based rate limiter. It also establishes a unified error handling middleware for consistent JSON error responses and a panic recovery handler. On the observability side, it implements structured logging with Zap, Prometheus metrics collection for HTTP and system stats, and health checks for database and Redis connectivity.
backend/infrastructure/middleware · high confidence
Introduces shared error handling and request context types for the Node.js backend
This change adds two new shared modules to the backend-nodejs package: a unified error handling system and a request context type definition. The new errors module defines a DomainError class with specific error codes (covering Auth, User, Task, and general categories) and maps them to standard HTTP status codes, providing utilities to create and parse structured errors. Additionally, the context module introduces a RequestContext interface to carry request-scoped data such as requestId, userId, and traceId across service layers, facilitating better logging and distributed tracing.
backend-nodejs/shared · high confidence
New Auth Domain: User Registration, Login, and Token Management
The backend now includes a new Auth domain in \backend-nodejs/domains/auth\ that provides user registration, login, and JWT token management. This feature introduces HTTP endpoints for registering new users (\POST /api/auth/register\), authenticating existing users (\POST /api/auth/login\), and refreshing access tokens (\POST /api/auth/refresh\). It implements a service layer with \AuthService\ for business logic and \JWTService\ for generating and verifying HS256-signed Access Tokens (1-hour expiry) and Refresh Tokens (7-day expiry). The implementation includes input validation via Zod schemas, rate limiting middleware for login and registration endpoints, and comprehensive unit and integration tests covering successful flows, error handling, and security constraints like unified error messages for invalid credentials.
backend-nodejs/domains/auth · high confidence
New Auth and Task domains with DDD architecture
This change introduces two new domain modules, Auth and Task, structured using a Domain-Driven Design (DDD) and Hexagonal architecture pattern. The Auth domain provides user registration, login, and JWT token management (Access and Refresh tokens) via HTTP handlers and services, while the Task domain implements a CRUD system for managing tasks with status tracking and priority levels. Both domains include comprehensive documentation (README, glossary, rules, events), DTOs, and error handling definitions, establishing a foundational structure for user identity and task management capabilities.
backend/domains/task · high confidence
New Task Management Domain with Full CRUD and Validation
This change introduces the Task domain, providing a complete set of HTTP endpoints for managing tasks (Create, Read, Update, Delete, and Complete). The implementation includes a Fastify router with Zod-based schema validation for request bodies and query parameters, handlers that enforce authentication via JWT, and a service layer that orchestrates business logic. The domain model enforces strict business rules, such as preventing updates to completed tasks, validating title/description lengths, and ensuring due dates are not in the past. Data persistence is handled by a Kysely-based repository interacting with PostgreSQL, supporting filtering, sorting, and pagination for task lists.
backend-nodejs/domains/task · high confidence
New User Domain: Profile Management and Password Change APIs
This change introduces the User Domain in the Node.js backend, providing the core infrastructure for user profile management and password security. It implements HTTP endpoints for retrieving the current user's profile (GET /api/users/me), updating profile details such as username, full name, and avatar (PUT /api/users/me), and changing passwords (POST /api/users/me/change-password). The implementation includes a domain model with validation rules (e.g., email uniqueness, password strength via bcrypt), a Kysely-based repository for PostgreSQL persistence, and comprehensive unit and integration tests covering these workflows.
backend-nodejs/domains/user · high confidence
New centralized configuration system with environment variable support
The backend now uses a new configuration package in \backend/infrastructure/config\ that loads settings from environment variables (prefixed with \APP\_\) and applies sensible defaults. This system covers server, database (PostgreSQL, MySQL, SQLite), Redis, LLM, JWT, logging, and monitoring settings, including validation to ensure required fields are present and values are within valid ranges.
backend/infrastructure/config · high confidence
New development and operational scripts for streamlined setup and code quality
This change introduces a suite of new shell scripts in the \scripts/\ directory to improve the developer experience. A one-click quickstart script (\quickstart.sh\) automates environment setup, dependency checks, database migration, and seed data loading. Development workflows are enhanced with linting (\lint.sh\, \lint-fix.sh\) and a pre-commit hook (\pre-commit-format.sh\) that automatically formats Go and frontend code. Additionally, new scripts manage the full service lifecycle (\start-all.sh\, \stop-all.sh\, \dev\_all.sh\) including monitoring infrastructure, and a type synchronization script (\sync\_types.sh\) ensures consistency between Go backend structs and TypeScript frontend interfaces.
scripts · high confidence
New frontend authentication feature with login, registration, and token management
The frontend now includes a complete authentication feature in \frontend/web/src/features/auth\ that aligns with the backend \backend/domains/auth\ domain. This adds user registration, login, token refresh, and logout capabilities via the \/api/auth\ endpoints. The implementation uses a Zustand store (\auth.store.ts\) with \zustand/middleware/persist\ to manage session state and persist access/refresh tokens in \localStorage\. It also integrates Sentry error tracking by setting user context upon successful registration and clearing it on logout. Comprehensive unit tests have been added for the \useLogin\, \useRegister\ hooks and the \auth.store\ to verify successful flows, error handling, and state transitions.
frontend/web/src/features/auth · high confidence
New isolated E2E test environment with Node.js backend support
Developers can now spin up a fully isolated end-to-end testing environment using the new scripts in docker/e2e. This setup includes a dedicated PostgreSQL instance (port 5433), a Redis cache (port 6381) with memory-optimized settings, and the Go backend (port 8081). Crucially, it adds support for the Node.js backend (port 8082) as a first-class service, allowing tests to run against either backend implementation. The environment is managed via start.sh and stop.sh scripts that handle health checks and container lifecycle, with pre-seeded test data for immediate use.
docker/e2e · high confidence
New isolated debug environment for Node.js backend with Redis and PostgreSQL
Developers can now spin up a dedicated, isolated Docker Compose environment for debugging the Node.js backend, featuring a separate PostgreSQL instance (port 5436) and a Redis cache (port 6380) to avoid conflicts with other services. The setup includes automated schema initialization, pre-loaded test data (including a sample user and tasks), and health checks for both services, streamlining local development and testing workflows.
docker/backend-nodejs-debug · high confidence
New isolated debug environments for backend and frontend development
Added dedicated Docker Compose configurations and management scripts for two new debug environments. The backend debug environment (docker/backend-debug) provides an isolated PostgreSQL 15 instance on port 5435 with pre-seeded test data, allowing backend developers to run and debug code locally against a dedicated database. The frontend debug environment (docker/frontend-debug) provisions a full stack including PostgreSQL on port 5434 and the backend API on port 8082, enabling frontend developers to work with a consistent, isolated backend service and test data without affecting other development environments.
docker/backend-debug, docker/frontend-debug · high confidence
New middleware layer for authentication, tracing, metrics, and rate limiting
The backend now includes a new middleware infrastructure in \backend-nodejs/infrastructure/middleware\ that adds request tracing, metrics collection, API rate limiting, and JWT-based authentication. The \tracing.ts\ middleware generates and propagates TraceID/RequestID headers for distributed tracing and structured logging. The \metrics.ts\ middleware records HTTP request counts and latency using Prometheus-style counters and histograms. The \ratelimit.ts\ module provides Redis-backed rate limiting with specific presets for login (5 attempts/minute), registration (3 attempts/hour), and general API access (100 requests/minute), returning 429 status codes when limits are exceeded. The \auth.ts\ module implements JWT verification middleware that extracts user claims (userId, email) from Bearer tokens and supports optional authentication for endpoints that can serve both authenticated and anonymous users.
backend-nodejs/infrastructure/middleware · high confidence
New production deployment configuration for Go-GenAI-Stack
A new, self-contained production environment configuration has been added to the \docker/prod\ directory. This includes a \docker-compose.yml\ file that defines the core application stack (PostgreSQL, Redis, and the Backend service) with production-specific settings such as resource limits, health checks, and persistent volumes. The release also provides operational scripts (\start.sh\, \stop.sh\, \validate-config.sh\) to automate environment checks, service startup, and graceful shutdown, along with an \env.example\ template to simplify initial setup. Additionally, configuration files for Prometheus and Grafana are included to support observability, while the README documents the deployment architecture and requirements.
docker/prod · high confidence
Task management feature with React Query and form validation
The task feature now provides full CRUD operations (create, read, update, complete, delete) aligned with the backend domain. Data fetching and mutations are handled by TanStack Query (React Query) hooks, which manage caching, loading states, and automatic cache invalidation. Form inputs for creating and editing tasks use React Hook Form with Zod schemas for robust validation. The UI includes components for listing tasks with filters (status, priority, keyword), individual task items, and dialogs for creation and editing, all supported by comprehensive unit tests for hooks, components, and schemas.
frontend/web/src/features/task · high confidence
Unified error handling and request context utilities for handlers
A new helper package in the backend infrastructure layer provides standardized utilities for HTTP handlers. It introduces a unified error handling function that converts domain errors into structured JSON responses with appropriate HTTP status codes, supporting both structured error objects and legacy string-based error formats. Additionally, it offers helper functions to extract the authenticated user ID from the request context and retrieve required path parameters, reducing boilerplate code in handler implementations.
_backend/infrastructure/handler\utils · high confidence
Architecture
Introduces centralized application bootstrap and dependency injection
The backend now uses a new \infrastructure/bootstrap\ package to orchestrate application startup. This change introduces a structured dependency injection container (\AppContainer\) that wires up the Auth, User, and Task domains, replacing the previous ad-hoc initialization. It also centralizes the setup of the Hertz HTTP server, global middleware (tracing, CORS, logging, recovery), and observability components (structured logging, Prometheus metrics, and OpenTelemetry tracing). Additionally, it provides a pluggable database initialization mechanism that supports switching between PostgreSQL and MySQL via configuration.
backend/infrastructure/bootstrap · high confidence
Behavioural changes
Added custom validation rules for API inputs
The backend now enforces stricter validation on incoming requests through new custom validators. These rules ensure that model names match supported providers (e.g., GPT-4, Claude), message roles are valid (user, assistant, system), token counts and temperature/top-p parameters fall within acceptable ranges, and conversation titles meet length and content requirements. This prevents invalid configurations from reaching downstream services.
backend/pkg · high confidence
Introduce type-safe configuration management with flexible time parsing
The backend now uses a centralized, Zod-validated configuration module that enforces type safety for server, database, Redis, and JWT settings. A key behavioral change is the support for flexible time-string formats (e.g., '15m', '1h', '7d') for JWT access and refresh token expiry, which are automatically parsed into seconds. The server port configuration now explicitly prioritizes the SERVER\_PORT environment variable over the generic PORT variable, ensuring consistent behavior across different environments.
backend-nodejs/infrastructure/config · high confidence
Test coverage
Add Playwright E2E testing infrastructure for authentication and task management; Added centralized test infrastructure for database and user management; Added tests for the removeTestId Vite plugin.
Dependencies
Initialize Node.js backend and frontend monorepo with core dependencies
This change introduces the initial dependency manifests for the project's new Node.js backend and frontend monorepo structure. The Node.js backend (\backend-nodejs/package.json\) establishes a Fastify-based server using TypeScript, Kysely for database access, Zod for validation, and Redis for caching, alongside Vitest for testing. The frontend monorepo (\frontend/package.json\) sets up a pnpm workspace containing a web application (\frontend/web/package.json\) built with React, Vite (via rolldown-vite override), Radix UI, TanStack Query, and Sentry, as well as a mobile application (\frontend/mobile/package.json\) using Expo and React Native. Shared TypeScript packages for constants, types, and utilities are also defined to support type synchronization across platforms.
(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 57 → 54 (-2.7)
- Rubric changed (rubric-2026.08.17 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 85 → 92 (+7.0)
- Architecture 91 → 75 (-15.5)
- Maturity 69 → 70 (+1.1)
- Readiness 46 → 69 (+23.5)
- Security 60 → 43 (-16.9)
- Accessibility 64 → 55 (-9.4)
Resolved (115)
- Coverage not included — suite not readable by the collector
- Critical CVE: [GHSA redacted] (backend/go.mod)
- Critical CVE: [GHSA redacted] (backend-nodejs/pnpm-lock.yaml)
- Critical CVE: [GHSA redacted] (backend/go.mod)
- Critical CVE: [GHSA redacted] (backend/go.mod)
- Critical CVE: [GHSA redacted] (backend/go.mod)
- Critical CVE: [GHSA redacted] (backend/go.mod)
- Critical CVE: [GHSA redacted] (backend/go.mod)
- Critical CVE: [GHSA redacted] (backend/go.mod)
- Critical CVE: [GHSA redacted] (frontend/pnpm-lock.yaml)
- Critical CVE: [GHSA redacted] (backend/go.mod)
- Dependency hygiene not measured — no supported dependency manifest was read
- Duplicated block (11 lines × 2) (backend/domains/task/events/events.go)
- Duplicated block (11 lines × 2) (backend/infrastructure/config/loader.go)
- Duplicated block (11–13 lines × 2) (backend/domains/task/repository/task_repo.go)
- Duplicated block (11–14 lines × 2) (backend/domains/auth/service/auth_service.go)
- Duplicated block (12 lines × 2) (backend/domains/auth/service/jwt_service.go)
- Duplicated block (12 lines × 3) (backend/domains/task/repository/task_repo.go)
- Duplicated block (12 lines × 3) (backend/domains/task/repository/task_repo.go)
- Duplicated block (13 lines × 2) (backend/infrastructure/persistence/mysql/provider.go)
- …and 95 more
New (203)
- ClassTooLong: ShowcasePage (frontend/web/src/pages/ShowcasePage/ShowcasePage.tsx)
- Critical CVE: [GHSA redacted] (frontend/pnpm-lock.yaml)
- Critical CVE: [GHSA redacted] (backend/go.mod)
- Critical CVE: [GHSA redacted] (backend-nodejs/pnpm-lock.yaml)
- Critical CVE: [GHSA redacted] (frontend/pnpm-lock.yaml)
- Critical CVE: [GHSA redacted] (backend/go.mod)
- Critical CVE: [GHSA redacted] (frontend/pnpm-lock.yaml)
- Documentation: no architecture or design documentation (README.md)
- Documentation: no installation or build instructions (README.md)
- Duplicated block (10 lines × 2) (backend/domains/auth/service/jwt_service.go)
- Duplicated block (12 lines × 2) (backend/domains/auth/handlers/helpers.go)
- Duplicated block (12 lines × 2) (backend/domains/auth/service/auth_service.go)
- Duplicated block (12 lines × 2) (backend/domains/task/repository/task_repo.go)
- Duplicated block (12 lines × 2) (backend/domains/user/repository/user_repo.go)
- Duplicated block (12 lines × 2) (backend/infrastructure/persistence/mysql/provider.go)
- Duplicated block (13 lines × 2) (backend/domains/auth/handlers/helpers.go)
- Duplicated block (13 lines × 2) (backend/domains/task/handlers/helpers.go)
- Duplicated block (14 lines × 4) (backend/domains/task/service/task_service.go)
- Duplicated block (16 lines × 6) (backend/domains/task/handlers/complete_task.handler.go)
- Duplicated block (18–19 lines × 2) (backend/domains/task/repository/task_repo.go)
- …and 183 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
erweixin/Go-GenAI-Stack 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 80a85bfbea38f6f87f43508f72ec9a4acb6a9702 — 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.