Skip to content

Commit 0a63e11

Browse files
SchenLongclaude
andcommitted
feat: add Web UI implementation with CI/CD pipeline
- Add web-ui-ci.yml GitHub Actions workflow for continuous integration - Add Next.js web application in apps/web directory - Configure Husky for git hooks - Update package.json dependencies and scripts - Update .gitignore for Next.js and web app exclusions - Update README with Web UI features and setup instructions - Update various package.json files with scoped @BlackUnicorn packages - Add security configuration updates - Update test files for new dependencies Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 7eac970 commit 0a63e11

601 files changed

Lines changed: 190053 additions & 4263 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/validators-node/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,11 @@
4646
"license": "MIT",
4747
"dependencies": {
4848
"@aws-sdk/client-s3": "^3.980.0",
49-
"@typescript-eslint/eslint-plugin": "8.54.0",
50-
"@typescript-eslint/parser": "8.54.0",
49+
"@typescript-eslint/eslint-plugin": "^8.54.0",
50+
"@typescript-eslint/parser": "^8.54.0",
5151
"commander": "^14.0.2",
52-
"eslint": "9.39.2"
52+
"eslint": "9.39.2",
53+
"eslint-config-next": "12.0.4",
54+
"typescript-eslint": "8.36.0"
5355
}
5456
}

.github/workflows/web-ui-ci.yml

Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
name: BMAD Web UI CI
2+
3+
on:
4+
push:
5+
branches: [main, develop, BMAD-CYBEROPS-RP, WEB-UI]
6+
paths:
7+
- 'apps/web-ui/**'
8+
- '.github/workflows/web-ui-ci.yml'
9+
pull_request:
10+
branches: [main, develop, BMAD-CYBEROPS-RP]
11+
paths:
12+
- 'apps/web-ui/**'
13+
- '.github/workflows/web-ui-ci.yml'
14+
workflow_dispatch:
15+
inputs:
16+
run-e2e:
17+
description: 'Run E2E tests (slower)'
18+
required: false
19+
default: 'false'
20+
type: choice
21+
options:
22+
- 'true'
23+
- 'false'
24+
run-performance:
25+
description: 'Run performance tests'
26+
required: false
27+
default: 'false'
28+
type: choice
29+
options:
30+
- 'true'
31+
- 'false'
32+
33+
env:
34+
NODE_VERSION: '20'
35+
WORKING_DIR: './apps/web-ui'
36+
37+
defaults:
38+
run:
39+
working-directory: ${{ env.WORKING_DIR }}
40+
41+
jobs:
42+
security:
43+
name: Security Tests
44+
runs-on: ubuntu-latest
45+
timeout-minutes: 10
46+
47+
steps:
48+
- name: Checkout code
49+
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v4.3.1
50+
51+
- name: Setup Node.js
52+
uses: actions/setup-node@d02c89dce7e1ba9ef629ce0680989b3a1cc72edb # v4.4.0
53+
with:
54+
node-version: ${{ env.NODE_VERSION }}
55+
cache: 'npm'
56+
cache-dependency-path: ${{ env.WORKING_DIR }}/package-lock.json
57+
58+
- name: Install dependencies
59+
run: npm ci
60+
61+
- name: Run security audit
62+
run: npm run security:audit
63+
64+
- name: Run OWASP Top 10 tests
65+
run: npm run test:owasp
66+
67+
- name: Run security tests
68+
run: npm run test:security
69+
70+
test:
71+
name: Unit & Integration Tests
72+
runs-on: ubuntu-latest
73+
timeout-minutes: 15
74+
75+
steps:
76+
- name: Checkout code
77+
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v4.3.1
78+
79+
- name: Setup Node.js
80+
uses: actions/setup-node@d02c89dce7e1ba9ef629ce0680989b3a1cc72edb # v4.4.0
81+
with:
82+
node-version: ${{ env.NODE_VERSION }}
83+
cache: 'npm'
84+
cache-dependency-path: ${{ env.WORKING_DIR }}/package-lock.json
85+
86+
- name: Install dependencies
87+
run: npm ci
88+
89+
- name: Run unit tests
90+
run: npm run test:unit
91+
92+
- name: Run integration tests
93+
run: npm run test:integration
94+
95+
- name: Run tests with coverage
96+
run: npm run test:ci
97+
98+
- name: Upload coverage report
99+
uses: actions/upload-artifact@47309c993abb98030a35d55ef7ff34b7fa1074b5 # v4.6.2
100+
with:
101+
name: coverage-report
102+
path: ${{ env.WORKING_DIR }}/coverage/
103+
retention-days: 7
104+
105+
lint:
106+
name: Lint & Build
107+
runs-on: ubuntu-latest
108+
timeout-minutes: 10
109+
110+
steps:
111+
- name: Checkout code
112+
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v4.3.1
113+
114+
- name: Setup Node.js
115+
uses: actions/setup-node@d02c89dce7e1ba9ef629ce0680989b3a1cc72edb # v4.4.0
116+
with:
117+
node-version: ${{ env.NODE_VERSION }}
118+
cache: 'npm'
119+
cache-dependency-path: ${{ env.WORKING_DIR }}/package-lock.json
120+
121+
- name: Install dependencies
122+
run: npm ci
123+
124+
- name: Run ESLint
125+
run: npm run lint
126+
127+
- name: Build project
128+
run: npm run build
129+
env:
130+
NEXT_TELEMETRY_DISABLED: 1
131+
132+
# E2E tests (optional - manual trigger or push)
133+
e2e:
134+
name: E2E Tests
135+
runs-on: ubuntu-latest
136+
timeout-minutes: 20
137+
if: github.event.inputs.run-e2e == 'true' || github.event_name == 'push'
138+
139+
steps:
140+
- name: Checkout code
141+
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v4.3.1
142+
143+
- name: Setup Node.js
144+
uses: actions/setup-node@d02c89dce7e1ba9ef629ce0680989b3a1cc72edb # v4.4.0
145+
with:
146+
node-version: ${{ env.NODE_VERSION }}
147+
cache: 'npm'
148+
cache-dependency-path: ${{ env.WORKING_DIR }}/package-lock.json
149+
150+
- name: Install dependencies
151+
run: npm ci
152+
153+
- name: Install Playwright browsers
154+
run: npx playwright install --with-deps chromium firefox webkit
155+
156+
- name: Run E2E tests
157+
run: npm run test:e2e
158+
env:
159+
CI: true
160+
161+
- name: Upload Playwright report
162+
uses: actions/upload-artifact@47309c993abb98030a35d55ef7ff34b7fa1074b5 # v4.6.2
163+
if: always()
164+
with:
165+
name: playwright-report
166+
path: ${{ env.WORKING_DIR }}/playwright-report/
167+
retention-days: 7
168+
169+
# Performance tests (optional)
170+
performance:
171+
name: Performance Tests
172+
runs-on: ubuntu-latest
173+
timeout-minutes: 15
174+
if: github.event.inputs.run-performance == 'true' || github.event_name == 'push'
175+
176+
steps:
177+
- name: Checkout code
178+
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v4.3.1
179+
180+
- name: Setup Node.js
181+
uses: actions/setup-node@d02c89dce7e1ba9ef629ce0680989b3a1cc72edb # v4.4.0
182+
with:
183+
node-version: ${{ env.NODE_VERSION }}
184+
cache: 'npm'
185+
cache-dependency-path: ${{ env.WORKING_DIR }}/package-lock.json
186+
187+
- name: Install dependencies
188+
run: npm ci
189+
190+
- name: Install K6
191+
run: |
192+
curl https://github.com/grafana/k6/releases/download/v1.6.1/k6-v1.6.1-linux-amd64.tar.gz -L | tar xvz
193+
sudo mv k6-v1.6.1-linux-amd64/k6 /usr/local/bin/
194+
195+
- name: Run smoke test
196+
run: npm run test:perf:smoke
197+
198+
quality-gate:
199+
name: Quality Gate
200+
runs-on: ubuntu-latest
201+
needs: [security, test, lint]
202+
timeout-minutes: 5
203+
204+
steps:
205+
- name: Quality Gate Passed
206+
run: |
207+
echo "## BMAD Web UI Quality Gate" >> $GITHUB_STEP_SUMMARY
208+
echo "" >> $GITHUB_STEP_SUMMARY
209+
echo "### Status: PASSED ✅" >> $GITHUB_STEP_SUMMARY
210+
echo "" >> $GITHUB_STEP_SUMMARY
211+
echo "All required checks passed:" >> $GITHUB_STEP_SUMMARY
212+
echo "- ✅ Security Tests" >> $GITHUB_STEP_SUMMARY
213+
echo "- ✅ Unit & Integration Tests" >> $GITHUB_STEP_SUMMARY
214+
echo "- ✅ Lint & Build" >> $GITHUB_STEP_SUMMARY

.gitignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,3 +260,42 @@ team/test-fixes-plan.md
260260

261261
# Backup files - NEVER commit
262262
team/backups/
263+
264+
# ===================
265+
# Web Applications
266+
# ===================
267+
# WebUI application - local development files
268+
apps/web-ui/.next/
269+
apps/web-ui/node_modules/
270+
apps/web-ui/.env
271+
apps/web-ui/.env.*
272+
apps/web-ui/*.db
273+
apps/web-ui/*.db-journal
274+
apps/web-ui/coverage/
275+
apps/web-ui/playwright-report/
276+
apps/web-ui/test-results/
277+
apps/web-ui/build/
278+
apps/web-ui/out/
279+
apps/web-ui/.turbo/
280+
apps/web-ui/.vercel
281+
apps/web-ui/.github/
282+
apps/web-ui/performance-results.json
283+
apps/web-ui/prisma/*.db
284+
apps/web-ui/prisma/*.db-journal
285+
apps/web-ui/prisma/*.bak
286+
287+
# But keep source code and configuration
288+
!apps/web-ui/src/
289+
!apps/web-ui/public/
290+
!apps/web-ui/app/
291+
!apps/web-ui/*.ts
292+
!apps/web-ui/*.tsx
293+
!apps/web-ui/*.js
294+
!apps/web-ui/*.mjs
295+
!apps/web-ui/*.json
296+
!apps/web-ui/*.css
297+
!apps/web-ui/.*.example
298+
!apps/web-ui/prisma/migrations/
299+
!apps/web-ui/prisma/schema.prisma
300+
!apps/web-ui/README.md
301+
!apps/web-ui/.gitignore

.husky/pre-commit

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#!/bin/bash
2+
# BMAD Pre-commit Hook
3+
# Runs security validation and fast quality checks
4+
5+
set -e
6+
7+
echo "🔐 Running pre-commit checks..."
8+
9+
# ============================================
10+
# Part 1: BMAD Security Validation
11+
# ============================================
12+
# Run security validation if script exists
13+
if [[ -f "security-validation.js" ]]; then
14+
if ! node security-validation.js --quiet; then
15+
echo "❌ Security validation failed!"
16+
echo " Review security-validation-results.json for details"
17+
echo " Fix security issues before committing"
18+
exit 1
19+
fi
20+
fi
21+
22+
# Check for sensitive files
23+
SENSITIVE_FILES=(".bmad-key" ".bmad-token")
24+
for file in "${SENSITIVE_FILES[@]}"; do
25+
if git diff --cached --name-only | grep -q "^$file$"; then
26+
echo "❌ Attempting to commit sensitive file: $file"
27+
echo " Remove from staging area and use environment variables"
28+
exit 1
29+
fi
30+
done
31+
32+
echo "✅ BMAD security validation passed"
33+
34+
# ============================================
35+
# Part 2: BMAD Web UI Quality Checks
36+
# ============================================
37+
# Only run if web-ui files are being committed
38+
WEB_UI_FILES=$(git diff --cached --name-only | grep -c "^team/bmad-web-ui/" || true)
39+
40+
if [[ "$WEB_UI_FILES" -gt 0 ]]; then
41+
echo "📦 BMAD Web UI files changed, running quality checks..."
42+
43+
# Change to web-ui directory for commands
44+
cd team/bmad-web-ui || exit 1
45+
46+
# Run ESLint on staged files
47+
echo "🔍 Running ESLint..."
48+
if ! npm run lint -- --quiet 2>/dev/null; then
49+
echo "❌ ESLint failed!"
50+
echo " From web-ui dir run: npm run lint"
51+
echo " Or use: git commit --no-verify to bypass (not recommended)"
52+
exit 1
53+
fi
54+
echo "✅ ESLint passed"
55+
56+
# Run security audit for high/critical vulnerabilities
57+
echo "🔒 Running security audit..."
58+
if ! npm run security:audit --audit-level=high 2>/dev/null; then
59+
echo "⚠️ Security audit found high/critical vulnerabilities!"
60+
echo " From web-ui dir run: npm audit fix"
61+
echo " Review with: npm audit"
62+
echo " Or use: git commit --no-verify to bypass (not recommended)"
63+
exit 1
64+
fi
65+
echo "✅ Security audit passed (no high/critical vulnerabilities)"
66+
67+
cd ../..
68+
fi
69+
70+
echo "✅ All pre-commit checks passed!"

.husky/pre-push

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/bash
2+
# BMAD Pre-push Hook
3+
# Runs full test suite before pushing to remote
4+
5+
set -e
6+
7+
echo "🚀 Running pre-push checks..."
8+
9+
# ============================================
10+
# BMAD Web UI Test Suite
11+
# ============================================
12+
# Only run if web-ui files were modified in commits being pushed
13+
WEB_UI_FILES=$(git diff --name-only HEAD@{push} 2>/dev/null | grep -c "^team/bmad-web-ui/" || true)
14+
15+
# Fallback: check if uncommitted changes exist in web-ui
16+
if [[ "$WEB_UI_FILES" -eq 0 ]]; then
17+
WEB_UI_FILES=$(git diff --name-only | grep -c "^team/bmad-web-ui/" || true)
18+
fi
19+
20+
if [[ "$WEB_UI_FILES" -gt 0 ]] && [[ -d "team/bmad-web-ui" ]]; then
21+
echo "📦 BMAD Web UI files changed in push, running test suite..."
22+
23+
# Change to web-ui directory for commands
24+
cd team/bmad-web-ui || exit 1
25+
26+
# Run the full security + integration test suite
27+
echo "🧪 Running test:security..."
28+
if ! npm run test:security 2>&1 | tail -20; then
29+
echo "❌ Security tests failed!"
30+
echo " Run from web-ui directory: npm run test:security"
31+
echo " Or use: git push --no-verify to bypass (not recommended)"
32+
exit 1
33+
fi
34+
echo "✅ Security tests passed"
35+
36+
echo "🧪 Running test:integration..."
37+
if ! npm run test:integration 2>&1 | tail -20; then
38+
echo "❌ Integration tests failed!"
39+
echo " Run from web-ui directory: npm run test:integration"
40+
echo " Or use: git push --no-verify to bypass (not recommended)"
41+
exit 1
42+
fi
43+
echo "✅ Integration tests passed"
44+
45+
cd ../..
46+
else
47+
echo "ℹ️ No BMAD Web UI changes detected, skipping tests"
48+
fi
49+
50+
echo "✅ All pre-push checks passed!"

0 commit comments

Comments
 (0)