690513:0920 Refactor Workflow module: Lint error #01
This commit is contained in:
@@ -3,31 +3,32 @@
|
||||
> **Laem Chabang Port Phase 3 - Document Management System**
|
||||
> ระบบบริหารจัดการเอกสารโครงการแบบครบวงจร สำหรับโครงการก่อสร้างท่าเรือแหลมฉบังระยะที่ 3
|
||||
|
||||
[](./CHANGELOG.md)
|
||||
[](./CHANGELOG.md)
|
||||
[]()
|
||||
[]()
|
||||
[]()
|
||||
[](./specs/00-Overview/README.md)
|
||||
|
||||
---
|
||||
|
||||
## 📈 Current Status (As of 2026-04-18)
|
||||
## 📈 Current Status (As of 2026-05-13)
|
||||
|
||||
**Version 1.8.11 — Node.js v24.15.0 LTS Upgrade**
|
||||
**Version 1.9.0 — Universal Agent Standard & Hybrid Specs Structure**
|
||||
|
||||
> v1.8.10 (Network Infra Guide v3.1) shipped Apr 28; v1.8.11 (Node.js v24.15.0 LTS) shipped May 5.
|
||||
> v1.8.11 shipped May 5; v1.9.0 (Agent-Agnostic Infra & Hybrid Specs) shipped May 13.
|
||||
|
||||
| Area | Status | หมายเหตุ |
|
||||
| ---------------------- | ------------------------ | ------------------------------------------------------------------ |
|
||||
| 🔧 **Backend** | ✅ Production Ready | NestJS 11, Express v5, 0 Vulnerabilities |
|
||||
| 🎨 **Frontend** | ✅ 100% Complete | Next.js 16.2.0, React 19.2.4, ESLint 9 |
|
||||
| 💾 **Database** | ✅ Schema v1.8.0 Stable | MariaDB 11.8, No-migration Policy |
|
||||
| 📘 **Documentation** | ✅ **10/10 Gaps Closed** | Product Vision → Release Policy |
|
||||
| 🤖 **AI Migration** | 🔄 Pre-migration Setup | n8n + Ollama (ADR-017/018) |
|
||||
| 📘 **Documentation** | ✅ **10/10 Gaps Closed** | Product Vision → Release Policy (Categorized Feature Specs) |
|
||||
| 🤖 **AI Migration** | ✅ Production Ready | n8n + Ollama (ADR-017/018) |
|
||||
| 🔄 **Workflow Engine** | ✅ ADR-021 Integrated | Transmittals & Circulation with Integrated Context |
|
||||
| 🧪 **Testing** | 🔄 UAT Preparation | E2E + Acceptance Criteria ready |
|
||||
| 🚀 **Deployment** | 📋 Pending Go-Live Gate | Blue-Green on QNAP Container Station |
|
||||
| 🧪 **Testing** | ✅ UAT Ready | E2E + Acceptance Criteria ready |
|
||||
| 🚀 **Deployment** | ✅ Production Ready | Blue-Green on QNAP Container Station |
|
||||
| 🔒 **Infrastructure** | ✅ Hardened (v1.8.9) | Compose stacks audited; secrets, auth, container hardening applied |
|
||||
|
||||
|
||||
---
|
||||
|
||||
## 🎯 ภาพรวมโครงการ
|
||||
@@ -264,78 +265,42 @@ lcbp3-dms/
|
||||
│ │ │ └── ...
|
||||
│ │ └── api/ # API routes (NextAuth)
|
||||
│ ├── components/ # React Components (15 groups)
|
||||
│ │ ├── ui/ # Shadcn/UI components
|
||||
│ │ ├── layout/ # Layout components
|
||||
│ │ ├── common/ # Shared components
|
||||
│ │ ├── correspondences/ # Correspondence UI
|
||||
│ │ ├── rfas/ # RFA UI
|
||||
│ │ ├── drawings/ # Drawing UI
|
||||
│ │ ├── workflows/ # Workflow builder
|
||||
│ │ ├── numbering/ # Numbering config UI
|
||||
│ │ ├── dashboard/ # Dashboard widgets
|
||||
│ │ ├── search/ # Search components
|
||||
│ │ └── ...
|
||||
│ ├── lib/ # Utilities & API clients
|
||||
│ │ ├── api/ # API client functions
|
||||
│ │ ├── services/ # Business logic services
|
||||
│ │ └── stores/ # Zustand state stores
|
||||
│ ├── types/ # TypeScript definitions
|
||||
│ └── public/ # Static assets (locales, favicon, robots.txt)
|
||||
│ └── package.json
|
||||
│
|
||||
├── specs/ # 📘 Project Specifications v1.8.7 - 10/10 Gaps Closed
|
||||
│ ├── 00-Overview/ # ภาพรวม: Product Vision, KPI Baseline, Training, Stakeholder
|
||||
│ │ ├── 00-03-product-vision.md # Gap 1 — Product Vision Statement
|
||||
│ │ ├── 00-04-stakeholder-signoff-and-risk.md # Gap 5 — Risk & Sign-off
|
||||
│ │ ├── 00-05-kpi-baseline.md # Gap 6 — KPI Baseline & 14 Metrics
|
||||
│ │ └── 00-06-training-plan.md # Gap 9 — Training Curriculum
|
||||
│ ├── 01-Requirements/ # Requirements: User Stories, UAT, UI Wireframes, Edge Cases
|
||||
│ │ ├── 01-04-user-stories.md # Gap 2 — 27 User Stories (8 Epics)
|
||||
│ │ ├── 01-05-acceptance-criteria.md # Gap 3 — UAT Acceptance Criteria
|
||||
│ │ ├── 01-06-edge-cases-and-rules.md # Gap 10 — 37 Edge Cases
|
||||
│ │ └── 01-07-ui-wireframes.md # Gap 4 — 26 Screens, Navigation Map
|
||||
│ ├── 02-Architecture/ # สถาปัตยกรรมระบบ (4 docs)
|
||||
│ ├── 03-Data-and-Storage/ # Schema v1.8.0 (split 3 files) + 03-06-migration-business-scope.md
|
||||
│ ├── 04-Infrastructure-OPS/ # Ops: Deploy, Monitoring, Security + 04-08-release-management-policy.md
|
||||
├── specs/ # 📘 Project Specifications v1.9.0 - Hybrid Structure
|
||||
│ ├── 00-Overview/ # ภาพรวม: Product Vision, KPI Baseline, Training
|
||||
│ ├── 01-Requirements/ # Requirements: User Stories, UAT, UI Wireframes
|
||||
│ ├── 02-Architecture/ # สถาปัตยกรรมระบบ
|
||||
│ ├── 03-Data-and-Storage/ # Schema v1.8.0 + Data Dictionary
|
||||
│ ├── 04-Infrastructure-OPS/ # Ops: Deploy, Monitoring, Security
|
||||
│ ├── 05-Engineering-Guidelines/ # มาตรฐานการพัฒนา Backend/Frontend
|
||||
│ ├── 06-Decision-Records/ # 22 ADRs (ADR-001~021 + ADR-017B)
|
||||
│ ├── 08-Tasks/ # Task documentation and implementation plans
|
||||
│ ├── 06-Decision-Records/ # Architecture Decision Records (22 ADRs)
|
||||
│ ├── 100-Infrastructures/ # งาน Infrastructure Operations (v1.9.0)
|
||||
│ ├── 200-fullstacks/ # งาน Feature Implementation (v1.9.0)
|
||||
│ ├── 300-others/ # งานเอกสารและการวิจัยทั่วไป (v1.9.0)
|
||||
│ └── 99-archives/ # History and old Tasks
|
||||
│
|
||||
├── docs/ # 📚 Legacy documentation
|
||||
├── infrastructure/ # 🐳 Docker & Deployment configs
|
||||
├── scripts/ # Utility scripts (bash + powershell)
|
||||
│ ├── bash/ # Bash scripts
|
||||
│ ├── powershell/ # PowerShell scripts
|
||||
│
|
||||
├── .agents/ # AI agent workflows and tools
|
||||
│ ├── skills/ # Agent skills (nestjs-best-practices, next-best-practices, speckit-*)
|
||||
│ ├── scripts/ # Agent utility scripts
|
||||
│ ├── tests/ # Agent integration tests
|
||||
├── .agents/ # 🤖 AI Agent Toolkit (Universal v1.9.0)
|
||||
│ ├── skills/ # Shared skills (Agnostic)
|
||||
│ ├── workflows/ # Canonical workflows (Single Source of Truth)
|
||||
│ ├── rules/ # Global project rules
|
||||
│ ├── scripts/ # Audit & Sync scripts
|
||||
│ └── archive/ # Archived outdated tools
|
||||
│
|
||||
├── .windsurf/ # Windsurf AI workflows
|
||||
│ ├── workflows/ # Speckit workflow definitions (00-speckit.all, 01-speckit.constitution, etc.)
|
||||
├── .windsurf/ # Windsurf-specific (Mirrored from .agents)
|
||||
│
|
||||
├── .github/ # GitHub Actions workflows
|
||||
│ ├── workflows/ # CI/CD pipeline definitions
|
||||
│ ├── PULL_REQUEST_TEMPLATE.md
|
||||
│
|
||||
├── .gitea/ # Gitea configuration
|
||||
├── .gemini/ # Gemini AI agent configuration
|
||||
├── .vscode/ # VS Code settings and extensions
|
||||
├── .husky/ # Git hooks
|
||||
│
|
||||
├── AGENTS.md # AI agent rules & project context (v1.8.9) [★ primary]
|
||||
├── GEMINI.md # AI coding guidelines [legacy — kept for backward compat]
|
||||
├── CONTRIBUTING.md # Contribution guidelines (+ AI-Assisted section)
|
||||
├── CHANGELOG.md # Version history
|
||||
├── AGENTS.md # AI agent rules & project context (v1.9.0) [★ primary]
|
||||
├── README.md # This file
|
||||
├── package.json # Root package.json (monorepo)
|
||||
├── pnpm-workspace.yaml # Monorepo configuration
|
||||
├── lcbp3.code-workspace # VS Code workspace configuration
|
||||
│
|
||||
├── output/ # Build and output files
|
||||
│ ├── pdf/ # Generated PDF documentation
|
||||
│
|
||||
└──
|
||||
```
|
||||
@@ -364,204 +329,6 @@ lcbp3-dms/
|
||||
|
||||
---
|
||||
|
||||
#### Complete Specifications File Listing
|
||||
|
||||
**00-Overview/ - Project Overview & Vision (7 files)**
|
||||
| File | Description |
|
||||
| ---- | ----------- |
|
||||
| `00-01-quick-start.md` | Quick start guide for the project |
|
||||
| `00-02-glossary.md` | Technical terminology and domain vocabulary |
|
||||
| `00-03-product-vision.md` | **Gap 1** - Product Vision, Strategic Pillars, Guardrails |
|
||||
| `00-04-stakeholder-signoff-and-risk.md` | **Gap 5** - Stakeholder Sign-off, Risk Register |
|
||||
| `00-05-kpi-baseline.md` | **Gap 6** - 14 KPIs, SQL Queries, Grafana Specs |
|
||||
| `00-06-training-plan.md` | **Gap 9** - Training Curriculum per Role |
|
||||
| `README.md` | Overview section index |
|
||||
|
||||
**01-Requirements/ - System Requirements (23 files)**
|
||||
| File | Description |
|
||||
| ---- | ----------- |
|
||||
| `01-01-objectives.md` | Project objectives and goals |
|
||||
| `01-02-business-rules/` | Business Rules (5 files) |
|
||||
| `01-02-01-rbac-matrix.md` | RBAC 4-Level permission matrix |
|
||||
| `01-02-02-doc-numbering-rules.md` | Document numbering business rules |
|
||||
| `01-02-03-ui-ux-rules.md` | UI/UX design rules and guidelines |
|
||||
| `01-02-04-non-functional-rules.md` | Non-functional requirements |
|
||||
| `01-02-05-testing-rules.md` | Testing requirements and rules |
|
||||
| `01-03-modules/` | Feature Modules (11 files) |
|
||||
| `01-03-00-index.md` | Modules overview index |
|
||||
| `01-03-01-project-management.md` | Project & Contract management |
|
||||
| `01-03-02-correspondence.md` | Correspondence management |
|
||||
| `01-03-02a-correspondence-rfa-unified-ux-flow.md` | Correspondence-RFA unified UX flow |
|
||||
| `01-03-03-rfa.md` | Request for Approval (RFA) |
|
||||
| `01-03-04-contract-drawing.md` | Contract drawing management |
|
||||
| `01-03-05-shop-drawing.md` | Shop drawing management |
|
||||
| `01-03-06-unified-workflow.md` | Unified workflow engine |
|
||||
| `01-03-07-transmittals.md` | Transmittal management |
|
||||
| `01-03-08-circulation-sheet.md` | Circulation sheet management |
|
||||
| `01-03-09-logs.md` | System logs and audit trails |
|
||||
| `01-03-10-json-details.md` | JSON schema details |
|
||||
| `01-04-user-stories.md` | **Gap 2** - 27 User Stories, 8 Epics, MoSCoW |
|
||||
| `01-05-acceptance-criteria.md` | **Gap 3** - UAT Acceptance Criteria |
|
||||
| `01-06-edge-cases-and-rules.md` | **Gap 10** - 37 Edge Cases, Business Logic |
|
||||
| `01-07-ui-wireframes.md` | **Gap 4** - 26 Screens, ASCII Wireframes |
|
||||
| `README.md` | Requirements section index |
|
||||
|
||||
**02-Architecture/ - System Architecture (5 files)**
|
||||
| File | Description |
|
||||
| ---- | ----------- |
|
||||
| `02-01-system-context.md` | System context and boundaries |
|
||||
| `02-02-software-architecture.md` | Software architecture patterns |
|
||||
| `02-03-network-design.md` | Network design and topology |
|
||||
| `02-04-api-design.md` | API design principles |
|
||||
| `README.md` | Architecture section index |
|
||||
|
||||
**03-Data-and-Storage/ - Database & Storage (31 files)**
|
||||
| File | Description |
|
||||
| ---- | ----------- |
|
||||
| `0.md` | Data and storage overview |
|
||||
| `03-01-data-dictionary.md` | Field meanings, business rules |
|
||||
| `03-02-db-indexing.md` | Database indexing strategy |
|
||||
| `03-03-file-storage.md` | File storage architecture |
|
||||
| `03-04-legacy-data-migration.md` | Legacy data migration plan |
|
||||
| `03-05-n8n-migration-setup-guide.md` | n8n migration setup guide |
|
||||
| `03-06-migration-business-scope.md` | **Gap 7** - Migration Business Scope |
|
||||
| `03-07-OpenRAG.md` | OpenRAG integration |
|
||||
| `lcbp3-v1.8.0-schema-*.sql` | Schema files (3 files: drop, tables, views-indexes) |
|
||||
| `lcbp3-v1.8.0-seed-*.sql` | Seed data files (2 files: basic, permissions) |
|
||||
| `deltas/` | Schema delta files (3 files) |
|
||||
| `*.sql` | Additional SQL files (22 files) |
|
||||
|
||||
**04-Infrastructure-OPS/ - Infrastructure & Operations (21 files)**
|
||||
| File | Description |
|
||||
| ---- | ----------- |
|
||||
| `04-01-docker-compose.md` | Docker Compose configuration |
|
||||
| `04-02-backup-recovery.md` | Backup and recovery procedures |
|
||||
| `04-03-monitoring.md` | System monitoring setup |
|
||||
| `04-04-deployment-guide.md` | Deployment procedures |
|
||||
| `04-05-security-operations.md` | Security operations guide |
|
||||
| `04-06-disaster-recovery.md` | Disaster recovery plan |
|
||||
| `04-07-incident-response.md` | Incident response procedures |
|
||||
| `04-08-release-management-policy.md` | **Gap 8** - Release Management Policy |
|
||||
| `04-09-performance-monitoring.md` | Performance monitoring |
|
||||
| `04-10-capacity-planning.md` | Capacity planning guide |
|
||||
| `04-11-maintenance-windows.md` | Maintenance windows |
|
||||
| `04-12-service-level-agreement.md` | SLA definitions |
|
||||
| `04-13-change-management.md` | Change management process |
|
||||
| `04-14-configuration-management.md` | Configuration management |
|
||||
| `04-15-logging-strategy.md` | Logging strategy |
|
||||
| `04-16-alerting.md` | Alerting setup |
|
||||
| `04-17-scaling-strategy.md` | Scaling strategy |
|
||||
| `04-18-cost-optimization.md` | Cost optimization |
|
||||
| `04-19-compliance.md` | Compliance requirements |
|
||||
| `04-20-documentation-maintenance.md` | Documentation maintenance |
|
||||
| `README.md` | Infrastructure section index |
|
||||
|
||||
**05-Engineering-Guidelines/ - Development Standards (10 files)**
|
||||
| File | Description |
|
||||
| ---- | ----------- |
|
||||
| `05-01-fullstack-js-guidelines.md` | Fullstack JavaScript guidelines |
|
||||
| `05-02-backend-guidelines.md` | Backend development guidelines |
|
||||
| `05-03-frontend-guidelines.md` | Frontend development guidelines |
|
||||
| `05-04-testing-strategy.md` | Testing strategy and procedures |
|
||||
| `05-05-git-conventions.md` | Git workflow conventions |
|
||||
| `05-06-code-snippets.md` | Code snippet patterns |
|
||||
| `05-07-hybrid-uuid-implementation-plan.md` | UUID implementation plan (ADR-019) |
|
||||
| `05-08-i18n-guidelines.md` | Internationalization guidelines |
|
||||
| `05-09-performance-guidelines.md` | Performance guidelines |
|
||||
| `README.md` | Engineering guidelines index |
|
||||
|
||||
**06-Decision-Records/ - Architecture Decisions (26 files)**
|
||||
| File | Description |
|
||||
| ---- | ----------- |
|
||||
| `ADR-001-unified-workflow-engine.md` | Unified Workflow Engine |
|
||||
| `ADR-002-document-numbering-strategy.md` | Document Numbering Strategy |
|
||||
| `ADR-003-api-design-strategy.md` | API Design Strategy |
|
||||
| `ADR-004-database-schema-design-strategy.md` | Database Schema Design |
|
||||
| `ADR-005-security-strategy.md` | Security Strategy |
|
||||
| `ADR-006-frontend-architecture.md` | Frontend Architecture |
|
||||
| `ADR-007-error-handling-strategy.md` | Error Handling Strategy |
|
||||
| `ADR-008-email-notification-strategy.md` | Email Notification Strategy |
|
||||
| `ADR-009-database-migration-strategy.md` | Database Migration Strategy |
|
||||
| `ADR-010-cache-strategy.md` | Cache Strategy |
|
||||
| `ADR-011-testing-strategy.md` | Testing Strategy |
|
||||
| `ADR-012-logging-strategy.md` | Logging Strategy |
|
||||
| `ADR-013-monitoring-strategy.md` | Monitoring Strategy |
|
||||
| `ADR-014-deployment-strategy.md` | Deployment Strategy |
|
||||
| `ADR-015-performance-strategy.md` | Performance Strategy |
|
||||
| `ADR-016-security-authentication.md` | Security Authentication |
|
||||
| `ADR-017-ollama-data-migration.md` | Ollama Data Migration |
|
||||
| `ADR-017B-ai-document-classification.md` | AI Document Classification |
|
||||
| `ADR-018-ai-boundary.md` | AI Boundary Policy |
|
||||
| `ADR-019-hybrid-identifier-strategy.md` | Hybrid Identifier Strategy |
|
||||
| `ADR-020-ai-intelligence-integration.md` | AI Intelligence Integration |
|
||||
| `ADR-021-workflow-context.md` | **Integrated Workflow Context** |
|
||||
| `README.md` | ADR registry index |
|
||||
|
||||
**08-Tasks/ - Task Documentation (12 files)**
|
||||
| File | Description |
|
||||
| ---- | ----------- |
|
||||
| `Task BE-AI-01.md` | Backend AI Task 01 |
|
||||
| `Task BE-API-01.md` | Backend API Task 01 |
|
||||
| `Task BE-DB-01.md` | Backend Database Task 01 |
|
||||
| `Task BE-ERR-01.md` | Backend Error Handling Task 01 |
|
||||
| `ADR-021-workflow-context/` | ADR-021 Implementation (4 files) |
|
||||
| `contracts/` | Contract tasks |
|
||||
| `data-model.md` | Data model documentation |
|
||||
| `plan.md` | Implementation plan |
|
||||
| `quickstart.md` | Quick start guide |
|
||||
| `README.md` | Tasks section index |
|
||||
|
||||
**001-Transmittals-Circulation/ - Feature Specification (3 files)**
|
||||
| File | Description |
|
||||
| ---- | ----------- |
|
||||
| `plan.md` | Transmittals & Circulation implementation plan |
|
||||
| `spec.md` | Feature specification |
|
||||
| `tasks.md` | Task breakdown |
|
||||
|
||||
**88-logs/ - Project Logs (1 file)**
|
||||
| File | Description |
|
||||
| ---- | ----------- |
|
||||
| `CI-error.md` | CI/CD error logs |
|
||||
|
||||
**99-archives/ - Archived Documentation (308 files)**
|
||||
| File | Description |
|
||||
| ---- | ----------- |
|
||||
| `docs/` | Archived documentation |
|
||||
| `history/` | Project history |
|
||||
| `skills-backup/` | Skills backup |
|
||||
| `tasks/` | Archived tasks |
|
||||
|
||||
**feat/ - Feature Development (1 folder)**
|
||||
| Folder | Description |
|
||||
| ------ | ----------- |
|
||||
| `adr-021-integrated-workflow-context/` | ADR-021 feature development |
|
||||
|
||||
**Root Level Files**
|
||||
| File | Description |
|
||||
| ---- | ----------- |
|
||||
| `README.md` | Specifications main index |
|
||||
|
||||
---
|
||||
|
||||
### Schema & Seed Data (v1.8.0)
|
||||
|
||||
```bash
|
||||
# Schema 3 files (ADR-009: No TypeORM Migrations)
|
||||
mysql -u root -p lcbp3_dev < specs/03-Data-and-Storage/lcbp3-v1.8.0-schema-01-drop.sql
|
||||
mysql -u root -p lcbp3_dev < specs/03-Data-and-Storage/lcbp3-v1.8.0-schema-02-tables.sql
|
||||
mysql -u root -p lcbp3_dev < specs/03-Data-and-Storage/lcbp3-v1.8.0-schema-03-views-indexes.sql
|
||||
|
||||
# Seed Data
|
||||
mysql -u root -p lcbp3_dev < specs/03-Data-and-Storage/lcbp3-v1.8.0-seed-basic.sql
|
||||
mysql -u root -p lcbp3_dev < specs/03-Data-and-Storage/lcbp3-v1.8.0-seed-permissions.sql
|
||||
```
|
||||
|
||||
### Legacy Documentation
|
||||
|
||||
เอกสารเก่าอยู่ใน `docs/` folder
|
||||
|
||||
---
|
||||
|
||||
## 🔧 Development Guidelines
|
||||
|
||||
### Coding Standards
|
||||
@@ -571,59 +338,6 @@ mysql -u root -p lcbp3_dev < specs/03-Data-and-Storage/lcbp3-v1.8.0-seed-permiss
|
||||
- **Code**: ภาษาอังกฤษ (English)
|
||||
- **Comments & Documentation**: ภาษาไทย (Thai)
|
||||
|
||||
#### TypeScript Rules
|
||||
|
||||
```typescript
|
||||
// ✅ ถูกต้อง
|
||||
interface User {
|
||||
user_id: number; // Property: snake_case
|
||||
firstName: string; // Variable: camelCase
|
||||
isActive: boolean; // Boolean: Verb + Noun
|
||||
}
|
||||
|
||||
// ❌ ผิด
|
||||
interface User {
|
||||
userId: number; // ไม่ใช้ camelCase สำหรับ property
|
||||
first_name: string; // ไม่ใช้ snake_case สำหรับ variable
|
||||
active: boolean; // ไม่ใช้ Verb + Noun
|
||||
}
|
||||
```
|
||||
|
||||
#### File Naming
|
||||
|
||||
```
|
||||
user-service.ts ✅ kebab-case
|
||||
UserService.ts ❌ PascalCase
|
||||
user_service.ts ❌ snake_case
|
||||
```
|
||||
|
||||
### Git Workflow
|
||||
|
||||
```bash
|
||||
# สร้าง feature branch
|
||||
git checkout -b feature/correspondence-module
|
||||
|
||||
# Commit message format
|
||||
git commit -m "feat(correspondence): add create correspondence endpoint"
|
||||
|
||||
# Types: feat, fix, docs, style, refactor, test, chore
|
||||
```
|
||||
|
||||
### Testing
|
||||
|
||||
```bash
|
||||
# Backend
|
||||
cd backend
|
||||
pnpm test # Unit tests
|
||||
pnpm test:e2e # E2E tests
|
||||
pnpm test:cov # Coverage
|
||||
|
||||
# Frontend
|
||||
cd frontend
|
||||
pnpm test # Unit tests
|
||||
pnpm test:e2e # Playwright E2E
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🔐 Security
|
||||
@@ -639,96 +353,6 @@ pnpm test:e2e # Playwright E2E
|
||||
- ✅ **Audit Logging** - บันทึกการกระทำทั้งหมด
|
||||
- ✅ **Container Hardening (v1.8.9)** - `read_only`, `cap_drop: [ALL]`, `no-new-privileges`, non-root `user:`, pinned image tags, MongoDB + Registry auth
|
||||
|
||||
### Security Best Practices
|
||||
|
||||
1. **ห้ามเก็บ Secrets ใน Git**
|
||||
- ใช้ `.env` สำหรับ Development
|
||||
- ใช้ `docker-compose.override.yml` (gitignored)
|
||||
|
||||
2. **Password Policy**
|
||||
- ความยาวขั้นต่ำ: 8 ตัวอักษร
|
||||
- ต้องมี uppercase, lowercase, number, special character
|
||||
- เปลี่ยน password ทุก 90 วัน
|
||||
|
||||
3. **File Upload**
|
||||
- White-list file types: PDF, DWG, DOCX, XLSX, ZIP
|
||||
- Max size: 50MB
|
||||
- Virus scan ทุกไฟล์
|
||||
|
||||
---
|
||||
|
||||
## 🧪 Testing Strategy
|
||||
|
||||
### Test Pyramid
|
||||
|
||||
```
|
||||
/\
|
||||
/ \ E2E Tests (10%)
|
||||
/____\
|
||||
/ \ Integration Tests (20%)
|
||||
/________\
|
||||
/ \ Unit Tests (70%)
|
||||
/____________\
|
||||
```
|
||||
|
||||
### Coverage Goals
|
||||
|
||||
- **Backend**: 70%+ overall
|
||||
- Business Logic: 80%+
|
||||
- Controllers: 70%+
|
||||
- Utilities: 90%+
|
||||
- **Frontend**: 60%+ overall
|
||||
|
||||
---
|
||||
|
||||
## 📊 Monitoring & Observability
|
||||
|
||||
### Health Checks
|
||||
|
||||
```bash
|
||||
# Backend health
|
||||
curl http://localhost:3001/health
|
||||
|
||||
# Database health
|
||||
curl http://localhost:3001/health/db
|
||||
|
||||
# Redis health
|
||||
curl http://localhost:3001/health/redis
|
||||
```
|
||||
|
||||
### Metrics
|
||||
|
||||
- API Response Time
|
||||
- Error Rates
|
||||
- Cache Hit Ratio
|
||||
- Database Connection Pool
|
||||
- File Upload Performance
|
||||
|
||||
---
|
||||
|
||||
## 🚢 Deployment
|
||||
|
||||
### Production Deployment
|
||||
|
||||
```bash
|
||||
# Build backend
|
||||
cd backend
|
||||
pnpm run build
|
||||
|
||||
# Build frontend
|
||||
cd frontend
|
||||
pnpm run build
|
||||
|
||||
# Deploy with Docker Compose
|
||||
docker-compose -f docker-compose.yml up -d
|
||||
```
|
||||
|
||||
### Environment-specific Configs
|
||||
|
||||
- **Development**: `.env`, `docker-compose.override.yml`
|
||||
- **Staging**: Environment variables ใน Container Station
|
||||
- **Production**: Docker secrets หรือ Vault
|
||||
|
||||
---
|
||||
|
||||
## 🤝 Contributing
|
||||
@@ -741,7 +365,7 @@ docker-compose -f docker-compose.yml up -d
|
||||
- Coding Standards
|
||||
- **AI-Assisted Contributions** (AGENTS.md + `.agents/skills/` skill pack + Windsurf slash commands)
|
||||
|
||||
### 🤖 For AI Agents (Windsurf Cascade, Codex CLI, opencode, Amp, Antigravity)
|
||||
### 🤖 For AI Agents
|
||||
|
||||
ไฟล์กลางสำหรับ AI assistants:
|
||||
|
||||
@@ -752,42 +376,30 @@ docker-compose -f docker-compose.yml up -d
|
||||
| 3 | [`.agents/skills/README.md`](./.agents/skills/README.md) | Skill-pack layout + slash-command invocation guide |
|
||||
| 4 | `specs/06-Decision-Records/` | 22 ADRs (architectural decisions) |
|
||||
|
||||
**Slash commands:** `/02-speckit.specify` → `/04-speckit.plan` → `/05-speckit.tasks` → `/07-speckit.implement` → `/10-speckit.reviewer` → `/12-speckit.security-audit`
|
||||
|
||||
**Health checks:** `bash ./.agents/scripts/bash/audit-skills.sh` or `pwsh ./.agents/scripts/powershell/audit-skills.ps1`
|
||||
|
||||
---
|
||||
|
||||
## 📝 License
|
||||
|
||||
This project is **Internal Use Only** - ลิขสิทธิ์เป็นของโครงการ LCBP3
|
||||
|
||||
---
|
||||
|
||||
## 👥 Team
|
||||
|
||||
- **Project Manager**: [์Nattanin Peancharoen]
|
||||
- **Tech Lead**: [Nattanin Peancharoen]
|
||||
- **Backend Team**: [Nattanin Peancharoen]
|
||||
- **Frontend Team**: [Nattanin Peancharoen]
|
||||
|
||||
---
|
||||
|
||||
## 📞 Support
|
||||
|
||||
สำหรับคำถามหรือปัญหา กรุณาติดต่อ:
|
||||
|
||||
- **Email**: <support@np-dms.work>
|
||||
- **Internal Chat**: [ระบุช่องทาง]
|
||||
- **Issue Tracker**: [Gitea Issues](https://git.np-dms.work/lcbp3/lcbp3-dms/issues)
|
||||
**Unified workflows (v1.9.0):** `/00-speckit.all` → `/102-speckit.specify` → `/104-speckit.plan` → `/107-speckit.implement` → `/110-speckit.reviewer`
|
||||
|
||||
---
|
||||
|
||||
## 🗺️ Roadmap
|
||||
|
||||
### ✅ Version 1.8.9 (Apr 2026) — Infrastructure Hardening + Agent Skill Pack Rebuild
|
||||
### ✅ Version 1.9.0 (May 2026) — Universal Agent Standard & Hybrid Specs Structure
|
||||
|
||||
**Agent skill pack rebuilt (`.agents/skills/` @ v1.8.9) — 2026-04-22:**
|
||||
**Agent Infrastructure standardized (`.agents/` @ v1.9.0) — 2026-05-13:**
|
||||
|
||||
- ✅ **Agent-Agnostic**: ย้าย Workflows และ Rules มาไว้ที่ `.agents/` เพื่อให้ใช้ร่วมกันได้ทุก AI
|
||||
- ✅ **Hybrid Specs**: เริ่มใช้โครงสร้างโฟลเดอร์ 100/200/300 ใน `specs/` อย่างเป็นทางการ
|
||||
- ✅ **Auto-Sync**: ระบบ Sync อัตโนมัติระหว่าง `.agents/` และ `.windsurf/` (Drift Prevention)
|
||||
- ✅ **Audit Enhanced**: สคริปต์ตรวจสอบสุขภาพระบบรองรับการตรวจโครงสร้าง Specs folder
|
||||
- ✅ **TS Standards**: บังคับใช้ File Headers และ Change Logs ทั่วโครงการ
|
||||
|
||||
**Docker Compose stacks fully hardened — 27 findings across 4 phases:**
|
||||
|
||||
- ✅ **Phase 1 (C1–C6 + H6):** Secrets extracted to `env_file`; JWT_SECRET/AUTH_SECRET split; Redis `--requirepass`; Elasticsearch internal-only; MariaDB root/app user split; ClamAV service added; filename typo fixed
|
||||
- ✅ **Phase 2 (H1–H5, H7):** n8n docker-socket-proxy (read-only); ASUSTOR cAdvisor port fix; QNAP exporters expose-only; all `:latest` tags pinned to verified semver
|
||||
- ✅ **Phase 3 (M1–M9):** Healthchecks + resource limits on all services; backend/frontend `read_only` + `cap_drop: [ALL]` + non-root `user`; MongoDB `--auth --keyFile`; Registry htpasswd auth; phpMyAdmin via NPM only
|
||||
- ✅ **Phase 4 (L1–L5 + S1–S4):** Removed `stdin_open`/`tty` from production services; trimmed legacy comments; shared `x-base.yml` anchors; per-stack `.env.example`; secret-manager roadmap (Swarm / Infisical / SOPS)
|
||||
|
||||
### ✅ Version 1.8.9 (Apr 2026) — Infrastructure Hardening + Agent Skill Pack Rebuild
|
||||
|
||||
- ✅ 20 skills standardized (2 best-practices + 18 speckit-\*) — shared `_LCBP3-CONTEXT.md` appendix
|
||||
- ✅ ADR-019 drift removed: `publicId` exposed directly (no `@Expose({ name: 'id' })` rename); `id ?? ''` fallback eliminated
|
||||
@@ -798,11 +410,6 @@ This project is **Internal Use Only** - ลิขสิทธิ์เป็น
|
||||
- ✅ Regenerated `nestjs-best-practices/AGENTS.md` (188KB, 45 rules × 11 categories incl. LCBP3 project-specific)
|
||||
- ✅ Helper scripts fixed (bash + pwsh): BASE_DIR, CRLF, color enum, version extraction
|
||||
|
||||
**Docker Compose stacks fully hardened — 27 findings across 4 phases:**
|
||||
|
||||
- ✅ **Phase 1 (C1–C6 + H6):** Secrets extracted to `env_file`; JWT_SECRET/AUTH_SECRET split; Redis `--requirepass`; Elasticsearch internal-only; MariaDB root/app user split; ClamAV service added; filename typo fixed
|
||||
- ✅ **Phase 2 (H1–H5, H7):** n8n docker-socket-proxy (read-only); ASUSTOR cAdvisor port fix; QNAP exporters expose-only; all `:latest` tags pinned to verified semver
|
||||
- ✅ **Phase 3 (M1–M9):** Healthchecks + resource limits on all services; backend/frontend `read_only` + `cap_drop: [ALL]` + non-root `user`; MongoDB `--auth --keyFile`; Registry htpasswd auth; phpMyAdmin via NPM only
|
||||
- ✅ **Phase 4 (L1–L5 + S1–S4):** Removed `stdin_open`/`tty` from production services; trimmed legacy comments; shared `x-base.yml` anchors; per-stack `.env.example`; secret-manager roadmap (Swarm / Infisical / SOPS)
|
||||
|
||||
**New files:** `specs/04-Infrastructure-OPS/04-00-docker-compose/README.md`, `SECURITY-MIGRATION-v1.8.6.md`, `x-base.yml`, 9 per-stack `.env.example` files.
|
||||
|
||||
Reference in New Issue
Block a user