15 Commits
Author SHA1 Message Date
Bruno GaoandQwen-Coder 17fa2a6b8d feat: add system management Response DTOs
- Add UserResponse for user management endpoints
- Add RoleResponse for role management endpoints
- Add PermissionResponse for permission management endpoints
- Add MenuResponse for flat menu list endpoints
- Add MenuTreeResponse for hierarchical menu structure
- Add MeResponse for current user information endpoint

These DTOs align with the SystemController and MeController endpoints
for complete system management functionality.

Co-authored-by: Qwen-Coder <[email protected]>
2026-02-13 08:21:50 +08:00
Bruno GaoandQwen-Coder a977951366 feat: add startup scripts and fix application configuration
- Add start_app.sh script for one-click application startup
- Add STARTUP_GUIDE.md with detailed startup instructions
- Add init_and_start.sh alternative startup script
- Fix JpaAuditingConfig to remove duplicate @EnableJpaRepositories
- Update application-dev.yml to use environment variables for database config
- Fix TenantContextFilterTest to use proper MockFilterChain implementation
- Fix OrderAuditIntegrationTest to use correct TenantScope constructor
- Fix OrderCacheIntegrationTest to use correct method names and return types
- Add tmpl-admin frontend project
- Update OrderControllerTest with correct method mappings and return codes

Co-authored-by: Qwen-Coder <[email protected]>
2026-02-12 23:25:56 +08:00
Bruno GaoandQwen-Coder 2fd1eb59ab docs: Complete production-grade documentation set
- Create SECURITY.md with vulnerability disclosure policy
- Create docs/README.md as documentation index page
- Create docs/observability.md with metrics/logs/traces/alerting/SLO specs
- Create docs/runbook.md with troubleshooting scenarios (RB-01 to RB-05)
- Create docs/security.md with security design and compliance
- Create docs/release.md with versioning and rollback strategies
- Create docs/database.md with database design and migration strategy
- Create docs/adr/0005-cache-error-handler.md for cache error handling ADR
- Update README.md with documentation index section
- Update docs/architecture.md to update B-7 rule and add trust boundary section
- Create docs/api-guide.md with API specifications
- Fix method names in OrderDao.java to match OrderMapper interface
- Add Spring Boot Actuator dependency to tmpl-infrastructure
- Fix Redis ping method in RedisHealthContributor.java
- Fix syntax errors and method names in OrderAppService.java

Co-authored-by: Qwen-Coder <[email protected]>
2026-02-12 21:47:33 +08:00
Bruno GaoandQwen-Coder a6a016e5ea feat: Batch 9 - Actuator security, metrics, cache resilience and K8s deployments
- Implement dual-tier security with ActuatorSecurityConfig having higher priority
- Add metrics collection for order creation with tenant tagging
- Enhance cache resilience with graceful error handling
- Create custom Redis ping health indicator
- Add comprehensive K8s deployment manifests with Kustomize overlays
- Update OrderController to align with Batch 8 AppService methods
- Configure management endpoints with separate port in production
- Add deployment scripts for image tag updates

Co-authored-by: Qwen-Coder <[email protected]>
2026-02-12 19:22:08 +08:00
Bruno GaoandQwen-Coder 95adc3b03c feat: implement batch 8 Redis caching and distributed locks
- Add BaseAuditPO with audit fields (createUserId, updateUserId, createTime, updateTime, deleted, version)
- Implement MapStruct for Order ↔ OrderPO mapping with @BeanMapping(ignoreByDefault=true)
- Create RedisCacheConfig with conditional loading (app.cache.enabled=true)
- Create RedisLockService with SET NX EX distributed locking
- Add Redis profile configuration (application-redis.yml)
- Update OrderAppService with @Cacheable/@CacheEvict annotations
- Create comprehensive integration tests for cache and lock functionality
- Update docker-compose.yml to include Redis service
- Update application-dev.yml to include redis profile
- Add proper error handling and tenant isolation for cache keys
- Follow M2 v5 frozen contracts for audit trail and persistence layer

Co-authored-by: Qwen-Coder <[email protected]>
2026-02-12 18:26:31 +08:00
Bruno GaoandQwen-Coder 68ff2ce8b9 feat: implement batch 7 order CRUD API with MapStruct, audit trail, and integration tests
- Add OrderAppService with tenant validation and business logic
- Create OrderController with full CRUD endpoints (create/get/list/update/delete)
- Implement DTOs (CreateOrderRequest, UpdateOrderRequest, OrderResponse, ApiResponse)
- Add OpenApiConfig for SpringDoc integration
- Create comprehensive unit tests with @WebMvcTest
- Create integration tests with Testcontainers (AbstractPostgresIT)
- Update OrderPO to extend BaseAuditPO for audit fields
- Update OrderDao to use MapStruct for entity conversion
- Update OrderRepository interface with findAllByTenantId method
- Add package-info.java files for proper documentation
- Update ErrorCode with COMMON_BAD_REQUEST for validation errors
- Update infrastructure POM with MapStruct dependencies
- Follow M2 v5 frozen contracts for audit trail and tenant isolation

Co-authored-by: Qwen-Coder <[email protected]>
2026-02-12 15:08:23 +08:00
Bruno GaoandQwen-Coder a88085a6c1 feat: implement batch 6 BaseAuditPO, MapStruct, Docker, and init script
- Add BaseAuditPO with audit fields (createUserId, updateUserId, createTime, updateTime, deleted, version)
- Implement MapStruct for Order ↔ OrderPO mapping with @BeanMapping(ignoreByDefault=true)
- Create Dockerfile with multi-stage build and runtime-only mode support
- Add .dockerignore for optimized build context
- Create init.sh script for project scaffolding with macOS/Linux compatibility
- Update OrderPO to extend BaseAuditPO
- Update OrderDao to use MapStruct mapper
- Add MapStruct processor dependency to infrastructure module
- Follow M2 v5 frozen contracts for audit trail and persistence layer

Co-authored-by: Qwen-Coder <[email protected]>
2026-02-12 14:18:07 +08:00
Bruno GaoandQwen-Coder f254a74174 feat: implement batch 5 minimal CRUD with audit trail
- Add Order domain model and repository port
- Implement OrderPO JPA entity with audit fields
- Create OrderJpaRepository (package-private) and OrderDao adapter
- Add V2 Flyway migration for order table
- Implement JPA auditing configuration with TenantContext integration
- Create comprehensive integration tests with Testcontainers
- Update TmplApplication with proper entity/repo scanning
- Enhance ArchUnit rules for persistence isolation
- Follow M2 v5 frozen contracts for audit trail and tenant isolation

Co-authored-by: Qwen-Coder <[email protected]>
2026-02-12 13:49:26 +08:00
Bruno GaoandQwen-Coder eaac739e6b feat: implement batch 4 archunit tests and ci workflow
- Add comprehensive ArchUnit A-class rules for architecture validation
- Implement layer dependency rules (api → infra → app → domain)
- Add domain layer purity checks (no Spring/JPA/Hibernate dependencies)
- Create application layer import restrictions
- Add @Transactional boundary enforcement
- Implement API layer rules (no field injection, no infra dependency)
- Add persistence isolation and cycle detection rules
- Create CI workflow with quality gate and build-deploy jobs
- Follow M2 v5 frozen contracts for architecture validation

Co-authored-by: Qwen-Coder <[email protected]>
2026-02-12 13:29:03 +08:00
Bruno GaoandQwen-Coder 86a11db54e feat: implement batch 3 tenant context filters and validation
- Add TraceIdFilter for request tracing
- Add TenantContextFilter for header parsing and validation
- Implement header compatibility logic (new/legacy headers)
- Add TenantHeaderProperties for configuration
- Add TenantHeaderStartupValidator for prod safety check
- Create GlobalExceptionHandler for unified error responses
- Add PingController for integration testing
- Implement deptId=0 scope validation
- Add comprehensive unit and integration tests
- Update TmplApplication with @ConfigurationPropertiesScan
- Follow M2 v5 frozen contracts for security context

Co-authored-by: Qwen-Coder <[email protected]>
2026-02-12 13:18:22 +08:00
Bruno GaoandQwen-Coder b7355b33d8 feat: implement batch 2 domain exceptions and tenant context
- Create ErrorCode enum with comprehensive error codes
- Create DomainException as base class for business exceptions
- Implement TenantScope value object for tenant context
- Implement TenantContext with ThreadLocal management
- Add SecurityLogMarker constants for security events
- Add comprehensive unit tests for all components
- Follow M2 architecture specifications for error handling and multi-tenancy

Co-authored-by: Qwen-Coder <[email protected]>
2026-02-12 13:02:36 +08:00
Bruno GaoandQwen-Coder 1849110f3f feat: implement batch 1 skeleton for Java service template
- Create parent POM with multi-module structure
- Set up four modules: tmpl-domain, tmpl-application, tmpl-infrastructure, tmpl-api
- Configure Spring Boot 3.4.1 with Java 21
- Add application configurations for dev/staging/prod
- Set up logging with structured JSON output
- Configure database with PostgreSQL and Flyway
- Add security configuration with minimal setup
- Include docker-compose for local development
- Add all necessary build and dependency management plugins

Co-authored-by: Qwen-Coder <[email protected]>
2026-02-12 12:51:20 +08:00
Bruno GaoandQwen-Coder 442dc4f237 Remove all existing code - preparing for fresh start
Co-authored-by: Qwen-Coder <[email protected]>
2026-02-12 08:20:52 +08:00
Bruno GaoandQwen-Coder eefe2c5b34 M2: Add complete Java21 template with Clean Architecture implementation
- Add four-layer modular structure (domain, application, infrastructure, api)
- Implement complete CRUD example with Order entity
- Add ArchUnit architecture compliance tests
- Add Maven configuration with proper dependency management
- Add Dockerfile for containerization
- Add Kustomize deployment templates
- Add initialization script (init.sh)
- Add CI/CD workflow configuration
- Add comprehensive documentation and configuration files

Co-authored-by: Qwen-Coder <[email protected]>
2026-02-11 23:54:21 +08:00
Bruno GaoandQwen-Coder 43d1229bd7 M1: Add complete documentation structure and contract specifications
- Add comprehensive docs/ directory with standardized structure
- Include architecture specification and contract documents
- Add prompt templates for development workflows
- Establish M1 deliverables as frozen specifications

Co-authored-by: Qwen-Coder <[email protected]>
2026-02-11 23:41:04 +08:00