soybeanjs/soybean-admin-nestjs
29.3
Weak · 9 November 2026
29.7k
lines of production code
TypeScript
primary language
7
measurements over time
What this system is
This system is a full-stack web application framework built on a monorepo architecture, featuring a Vue 3 frontend and a NestJS backend. It provides a comprehensive suite of infrastructure libraries for identity and access management, including role-based access control, JWT and API key authentication, and cryptographic data protection. The platform also includes standardized utilities for structured logging, caching, error handling, and database management via Prisma and PostgreSQL.
Features
Added REST Client API script for backend development
A new HTTP client script file has been added to the backend directory, providing a ready-to-use collection of API requests for local development and testing. The script includes examples for authentication, user management (CRUD operations), domain and role management, route authorization, and logging endpoints, all configured to target the local development server on port 9528.
backend/.http · high confidence
Automated database seeding for initial system setup
The backend now includes a Prisma-based seeding mechanism that automatically initializes the database with essential system data upon startup. This process creates default system domains, pre-configured user accounts (Super Admin, Admin, General User) with hashed passwords, and establishes the foundational RBAC structure by linking roles to specific system menus and Casbin authorization rules, ensuring the application is ready for use immediately after deployment.
backend/prisma/seeds · high confidence
Automatic API endpoint collection and Swagger documentation initialization
The bootstrap library now automatically scans NestJS controllers at startup to collect API endpoint metadata (paths, methods, permissions, summaries) and emits them via an event, making this data available for downstream services. Additionally, it provides a standardized Swagger/OpenAPI documentation initialization function that configures the API document with versioning, security schemes, and custom styling, controlled by application configuration.
backend/libs/bootstrap · high confidence
Centralized configuration module with AES/RSA encryption support
The backend now includes a dedicated \libs/config\ module that centralizes application settings using \@nestjs/config\. This module defines typed configuration profiles for the app server (port, Swagger), CORS policies, Redis (standalone, cluster, sentinel modes), security (JWT secrets, Casbin model), and API throttling. Notably, it introduces a new \CryptoConfig\ profile that exposes environment variables for AES and RSA encryption keys, allowing users to configure cryptographic parameters for data protection.
backend/libs/config · high confidence
Centralized constants library for API keys, caching, events, and REST responses
A new constants library has been introduced to centralize shared configuration and identifiers across the backend. This includes definitions for API key authentication strategies and sources, cache key prefixes (e.g., 'soybean:'), standardized event names for route collection, operation logging, and API key validation, as well as common REST response codes and HTTP header constants. This change consolidates these values into a single location to ensure consistency and reduce duplication in other parts of the application.
backend/libs/constants · high confidence
Frontend scaffolding and core library packages added
The frontend area now includes the foundational project structure and core utility libraries. This adds environment configuration files (.env, .env.prod, .env.test) and build tooling (Dockerfile, nginx.conf, Vite plugins) to support the application's runtime and deployment. It also introduces the \packages/alova\ and \packages/axios\ libraries, which provide the HTTP client implementations with features like token refresh, request cancellation, and error handling, alongside the \packages/materials\ UI components for page tabs.
frontend · high confidence
Initial PostgreSQL database schema and seed data for deployment
The deployment package now includes a complete set of SQL migration scripts (01 through 08) to initialize the PostgreSQL database. These scripts create the core system tables, including \sys\_user\, \sys\_role\, \sys\_menu\, \sys\_domain\, \casbin\_rule\, and various log tables, along with the necessary enumerations. Additionally, seed data is provided to establish default built-in users (Soybean, Administrator, GeneralUser), roles (Super Admin, Admin, User), a default domain, and initial menu structures with associated role-based access control permissions via Casbin rules.
deploy · high confidence
Initial database schema and migration structure for PostgreSQL
The backend now includes the initial Prisma migration files to establish the PostgreSQL database schema. This introduces core tables for system administration and security, including \sys\_user\, \sys\_role\, \sys\_domain\, \sys\_organization\, and \sys\_menu\ for RBAC and navigation, alongside \sys\_login\_log\ and \sys\_operation\_log\ for audit trails. It also adds \sys\_tokens\ for managing access and refresh tokens, and \sys\_access\_key\ to support AccessKey/SecretKey authentication mechanisms. The migration lock is configured for PostgreSQL.
backend/prisma/migrations · high confidence
Initial database schema for authentication, RBAC, and audit logging
This change introduces the Prisma schema for the backend, defining the core data models required for the application's security and operational features. It establishes tables for user management (SysUser, SysRole, SysOrganization), access control via Casbin (CasbinRule), and domain/tenant isolation (SysDomain). Crucially, it adds models for authentication token storage (SysTokens, supporting both access and refresh tokens) and comprehensive audit trails, including login history (SysLoginLog) and detailed operation logs (SysOperationLog) that capture request metadata, performance metrics, and I/O bodies.
backend/prisma · high confidence
Initial release of frontend UI framework and layout components
This change introduces the foundational frontend packages and layout components for the application. It adds a color system package providing named colors, Tailwind-style palettes (Slate, Gray, Zinc, etc.), and Ant Design-compatible palette generation logic. It also introduces a materials package containing the core AdminLayout component (supporting vertical/horizontal modes, header, tab, sider, and footer regions), a SimpleScrollbar wrapper, and a UnoCSS preset with utility shortcuts. Additionally, it adds a global-breadcrumb layout module for navigation, a global-footer with copyright information, and a global-logo component.
(repo-wide) · high confidence
Introduce API key authentication with signature support
The guard library now includes a new API key authentication system alongside the existing JWT guard. This adds an ApiKeyGuard that supports both simple API key validation (checking existence in a set) and complex signed-request validation (verifying timestamps, nonces, and cryptographic signatures using MD5, SHA1, SHA256, or HMAC-SHA256). The complex service stores secrets in Redis and validates request parameters against a calculated signature, while emitting an ApiKeyValidationEvent upon validation attempts. A global ApiKeyModule registers these services and the guard, making them available for injection throughout the application.
backend/libs/infra/guard · high confidence
Introduce base-demo app with encryption, file upload, and caching endpoints
The new base-demo application provides a set of public API endpoints for demonstration purposes. Users can now encrypt and decrypt data via GET and POST /crypto routes, upload files with multipart handling to a local directory structure, and test caching functionality using Redis-backed storage. The module integrates rate limiting via Redis, configures AES encryption defaults, and sets up Casbin-based authorization, while exposing these features under the v1 prefix with Swagger documentation.
backend/apps/base-demo/src · high confidence
New Casbin-based authorization library with Prisma adapter and NestJS integration
The backend now includes a new \casbin\ library in \backend/libs/infra/casbin\ that provides role-based access control (RBAC) using the Casbin engine. This library introduces a \PrismaAdapter\ to persist authorization policies in the database via Prisma, a NestJS \AuthZModule\ for dependency injection, and an \AuthZGuard\ that enforces permissions by checking user roles against the Casbin enforcer. It also exposes services (\AuthZService\, \AuthZRBACService\, \AuthZManagementService\) and decorators (\UsePermissions\) to manage roles, permissions, and enforce access rules on routes.
backend/libs/infra/casbin · high confidence
New REST API endpoints for IAM, access keys, and audit logs
The base-system module now exposes a comprehensive set of REST controllers for Identity and Access Management (IAM), access keys, and audit logging. Users can manage domains, roles, users, and routes via dedicated endpoints (e.g., /domain, /role, /user, /route) and assign permissions, routes, and users to roles through the /authorization endpoints. Additionally, new endpoints allow for the creation, listing, and deletion of access keys (/access-key), as well as viewing paginated login and operation logs (/login-log, /operation-log). Authentication is handled via a new /auth/login endpoint supporting password-based login with JWT issuance, and all protected endpoints utilize the Casbin-based authorization guard.
backend/apps/base-system · high confidence
New REST infrastructure library with pagination and response helpers
A new \backend/libs/infra/rest\ library has been added, providing reusable utilities for REST API development. It includes a \PaginationParams\ class for handling page and size validation with Swagger documentation, and an \ApiRes\ generic class for standardizing API success, error, and custom responses. The library is configured with its own TypeScript build settings.
backend/libs/infra/rest · high confidence
New crypto library for AES and RSA encryption
A new \backend/libs/infra/crypto\ library has been added to the backend infrastructure, providing a NestJS module for data encryption and decryption. It supports both AES (with CBC, ECB, and CTR modes) and RSA encryption, configurable via decorators (\@Crypto\, \@AESCrypto\, \@RSACrypto\) or a global interceptor. The module exposes a \CryptoService\ for programmatic use and a \CryptoInterceptor\ that can automatically decrypt incoming request bodies and encrypt outgoing responses based on metadata or headers.
backend/libs/infra/crypto · high confidence
New global navigation menu layouts and components
The global menu module now includes dedicated Vue components for four distinct navigation layouts: vertical, vertical-mix, horizontal, and horizontal-mix (including a reversed variant). The main index component dynamically renders the active layout based on the theme store's layout mode. These components implement the specific UI behaviors for each mode, such as the vertical-mix layout's collapsible side drawer with a first-level menu and logo, the horizontal-mix layout's split header/sider structure, and the standard vertical/horizontal menus' integration with the route store for navigation.
frontend/src/layouts/modules/global-menu · high confidence
New logging and response transformation interceptors
The backend now includes two new NestJS interceptors in the infra library. The LogInterceptor automatically captures operation details (user, timing, request/response data) and emits an event for audit logging when methods are decorated with the log decorator. The TransformInterceptor standardizes API responses by wrapping data in a consistent success envelope and enforces a 3-second request timeout, throwing a timeout exception if exceeded.
backend/libs/infra/interceptors · high confidence
New reusable Vue hooks and global sidebar layout component
This change introduces a new \@sa/hooks\ package providing reusable Vue composables for application state and UI logic, including \useBoolean\ and \useLoading\ for toggle states, \useCountDown\ for timer-based interactions, \useContext\ for parent-child store management, \useSvgIconRender\ for dynamic icon rendering, and \useHookTable\ for declarative data-table handling with pagination and column visibility. It also adds a new \GlobalSider\ layout component that renders the application's sidebar navigation, dynamically adjusting its appearance (such as logo visibility and menu inversion) based on the current theme and layout mode.
frontend/packages/hooks, frontend/src/layouts/modules/global-sider · high confidence
New security and Fastify adapter infrastructure in backend/libs/infra/adapter
The backend/libs/infra/adapter module now provides a dedicated Fastify adapter and a security middleware integration. The Fastify adapter configures multipart file uploads with specific limits (6MB file size, 10 non-file fields, 5 file fields) and adds an error hook that logs IP, user agent, and URL for not-found errors. Additionally, a security adapter registers the @fastify/helmet middleware with sensible defaults for Content Security Policy, HSTS, XSS filtering, and other security headers, allowing for optional custom configuration.
backend/libs/infra/adapter · high confidence
New structured logging library with request interception and sensitive data redaction
The backend now includes a new \backend/libs/logger\ library that integrates Winston for structured logging. This library provides a global NestJS module (\LoggerModule\) which automatically registers an interceptor to log HTTP requests, responses, and errors. The interceptor sanitizes incoming data by redacting sensitive fields (such as passwords, tokens, and secrets) before logging. It supports both synchronous and asynchronous configuration, allowing users to customize log levels, file rotation settings, and console output. The library handles log buffering and flushing to ensure efficient I/O operations.
backend/libs/logger · high confidence
New utility library for environment, ID, IP, and tree operations
A new \backend/libs/utils\ library has been introduced, providing shared utilities for the application. This includes environment variable parsing helpers (env.ts), a ULID generator for unique identifiers (id.util.ts), client IP and port extraction from HTTP requests (ip.util.ts), and a function to build hierarchical tree structures from flat lists (tree.util.ts).
backend/libs/utils · high confidence
Architecture
Backend project initialized with monorepo structure and infrastructure libraries
The backend has been restructured into a monorepo, introducing a \libs\ directory containing shared infrastructure packages such as \infra/decorators\, \infra/strategies\, and \typings\. This change includes new TypeScript path mappings in \tsconfig.json\ to support the new library imports, adds a Dockerfile for containerized builds, and provides a Makefile with commands for Prisma database migrations. Additionally, configuration files for ESLint, Prettier, and npm registry settings have been added to standardize development workflows.
backend · high confidence
Behavioural changes
New cache manager module with Keyv and Redis integration
The backend now uses a new CacheManagerModule that integrates Keyv with Redis as the underlying store, replacing the previous custom KeyvCacheStore implementation. This module supports both standalone and cluster Redis configurations, automatically constructing the appropriate connection URL based on the mode defined in the configuration. The cache is configured with a default TTL of 24 hours and is exported via the SharedModule, making it available across the application. Additionally, the GlobalCqrsModule has been introduced to provide CQRS functionality globally.
backend/libs/global · high confidence
New global exception filter for standardized error responses
The backend now includes a new \AllExceptionsFilter\ in the \infra/filters\ library that intercepts all unhandled exceptions and returns a consistent JSON structure. This filter normalizes responses for \UnprocessableEntityException\, \HttpException\, and custom \BizException\ instances, ensuring that validation errors and business logic failures include specific error codes and messages in the response payload, while falling back to a standard internal server error format for unknown errors.
backend/libs/infra/filters · high confidence
Shared libraries restructured into a monorepo with new error handling and service modules
The backend's shared code has been reorganized into a monorepo structure under \backend/libs/shared\, introducing several new, independently configurable libraries. A new \errors\ library provides a standardized \BizException\ class and \ErrorCode\ enum for consistent error reporting. New service modules have been added for IP geolocation (\ip2region\), supporting File, VectorIndex, and Full search modes; object storage (\oss\) wrapping Alibaba Cloud OSS for file uploads and URL generation; and Prisma database access with environment-aware logging. Additionally, a singleton-based Redis utility has been introduced to manage both standalone and cluster connections, while shared constants for audit info and pagination models are now available in the \prisma\ library.
backend/libs/shared · high confidence
Test coverage
Added e2e test suite for the base-demo application
Added end-to-end tests for the base-demo application, including a new test file (app.e2e-spec.ts) that verifies the root endpoint returns 'Hello World!' and a Jest configuration file (jest-e2e.json) to support running these tests.
backend/apps/base-demo/test · high confidence
Dependencies
Initial dependency manifests for backend and frontend workspaces
The backend and frontend directories now include their \package.json\ files and corresponding \pnpm-lock.yaml\ lockfiles, establishing the dependency graph for the application. The backend (NestJS) specifies \@nestjs/common\ 11.1.3, \fastify\ 5.4.0, \prisma\ 6.10.1, and \casbin\ 5.38.0, while the frontend (Vue 3) specifies \vue\ 3.5.13, \vite\ 6.2.2, and \naive-ui\ 2.41.0.
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 28 → 29 (+1.6)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 56 → 56 (+0.0)
- Architecture 70 → 70 (-0.1)
- Maturity 33 → 49 (+16.1)
- Readiness 19 → 19 (+0.0)
- Security 57 → 58 (+1.3)
- Domain Modelling 40 → 40 (+0.0)
- Accessibility 26 → 26 (-0.2)
- Performance 60 → 60 (+0.0)
Resolved (20)
- Divergent failure handling patterns. Axios uses a dedicated onBackendFail hook that can return a new response (allowing for retry/interception logic), while Alova relies on isBackendSuccess to determine flow. This creates two different mental models for handling business logic errors (e.g., 401/403) vs network errors.
- Documentation: no architecture or design documentation (README.md)
- High CVE: [GHSA redacted] (backend/pnpm-lock.yaml)
- High CVE: [GHSA redacted] (backend/pnpm-lock.yaml)
- High CVE: [GHSA redacted] (backend/pnpm-lock.yaml)
- High CVE: [GHSA redacted] (backend/pnpm-lock.yaml)
- High CVE: [GHSA redacted] (frontend/pnpm-lock.yaml)
- High CVE: [GHSA redacted] (backend/pnpm-lock.yaml)
- High CVE: [GHSA redacted] (backend/pnpm-lock.yaml)
- High CVE: [GHSA redacted] (frontend/pnpm-lock.yaml)
- High CVE: [GHSA redacted] (backend/pnpm-lock.yaml)
- High CVE: [GHSA redacted] (frontend/pnpm-lock.yaml)
- High CVE: [GHSA redacted] (backend/pnpm-lock.yaml)
- Inconsistent error handler signature. Alova's onError receives the original response (which may be null) and the method instance, whereas Axios's onError only receives the error object. This makes it difficult to write a unified error handling strategy across both HTTP clients.
- Inconsistent return type for success validation. Alova's isBackendSuccess returns a Promise<boolean>, while Axios's isBackendSuccess returns a synchronous boolean. This forces consumers to handle async/sync differences inconsistently when abstracting over multiple HTTP clients.
- Medium CVE: [GHSA redacted] (backend/pnpm-lock.yaml)
- Medium CVE: [GHSA redacted] (frontend/pnpm-lock.yaml)
- Medium CVE: [GHSA redacted] (frontend/pnpm-lock.yaml)
- Medium CVE: [GHSA redacted] (frontend/pnpm-lock.yaml)
- Split backend
New (44)
- High CVE: [GHSA redacted] (backend/pnpm-lock.yaml)
- High CVE: [GHSA redacted] (backend/pnpm-lock.yaml)
- High CVE: [GHSA redacted] (backend/pnpm-lock.yaml)
- High CVE: [GHSA redacted] (backend/pnpm-lock.yaml)
- High CVE: [GHSA redacted] (frontend/pnpm-lock.yaml)
- High CVE: [GHSA redacted] (frontend/pnpm-lock.yaml)
- High CVE: [GHSA redacted] (frontend/pnpm-lock.yaml)
- High CVE: [GHSA redacted] (frontend/pnpm-lock.yaml)
- High CVE: [GHSA redacted] (frontend/pnpm-lock.yaml)
- High CVE: [GHSA redacted] (backend/pnpm-lock.yaml)
- High CVE: [GHSA redacted] (backend/pnpm-lock.yaml)
- High CVE: [GHSA redacted] (backend/pnpm-lock.yaml)
- High CVE: [GHSA redacted] (frontend/pnpm-lock.yaml)
- High CVE: [GHSA redacted] (frontend/pnpm-lock.yaml)
- High CVE: [GHSA redacted] (frontend/pnpm-lock.yaml)
- High CVE: [GHSA redacted] (frontend/pnpm-lock.yaml)
- High CVE: [GHSA redacted] (frontend/pnpm-lock.yaml)
- High CVE: [GHSA redacted] (frontend/pnpm-lock.yaml)
- High CVE: [GHSA redacted] (frontend/pnpm-lock.yaml)
- Low CVE: [GHSA redacted] (backend/pnpm-lock.yaml)
- …and 24 more
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
soybeanjs/soybean-admin-nestjs 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 9 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit a6be4f246857ebc3a38bcc9d2b3785dee8661f1e — the exact code this score is about.
- Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.3+preprod-bb0cb800cd0f.