Skip to content

Commit ad3e333

Browse files
Merge branch 'main' into feature/issue-31-trade-detail-view
2 parents a80b0ea + 0be98c8 commit ad3e333

535 files changed

Lines changed: 87478 additions & 2477 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.

.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
target/
2+
node_modules/
3+
.git/
4+
*.md
5+
*.log
6+
.env*
7+
docker-compose*.yml

.env.development

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
STELLAR_NETWORK=TESTNET
2+
HORIZON_URL=https://horizon-testnet.stellar.org
3+
CONTRACT_ID=CA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ
4+
DATABASE_URL=postgres://user:password@localhost:5432/stellar_escrow_dev
5+
NODE_ENV=development
6+
PORT=3000
7+
API_KEYS=demo-key-123,client-key-456
8+
ADMIN_KEYS=admin-key-123
9+
REDIS_URL=
10+
LOG_LEVEL=debug

.env.example

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# StellarEscrow — Environment Variables
2+
# Copy this file to .env and fill in real values. Never commit .env files.
3+
4+
# ── Stellar Network ──────────────────────────────────────────────────────────
5+
STELLAR_NETWORK=TESTNET
6+
HORIZON_URL=https://horizon-testnet.stellar.org
7+
CONTRACT_ID=
8+
9+
# ── Database ─────────────────────────────────────────────────────────────────
10+
DATABASE_URL=postgres://user:password@localhost:5432/stellar_escrow
11+
12+
# ── API Server ───────────────────────────────────────────────────────────────
13+
NODE_ENV=development
14+
PORT=3000
15+
16+
# ── Auth ─────────────────────────────────────────────────────────────────────
17+
API_KEYS=demo-key-123,client-key-456
18+
ADMIN_KEYS=admin-key-123
19+
20+
# ── Optional ─────────────────────────────────────────────────────────────────
21+
REDIS_URL=
22+
LOG_LEVEL=debug

.env.production

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
STELLAR_NETWORK=PUBLIC
2+
HORIZON_URL=https://horizon.stellar.org
3+
CONTRACT_ID=REPLACE_WITH_PRODUCTION_CONTRACT_ID
4+
DATABASE_URL=postgres://user:password@prod-db:5432/stellar_escrow_prod
5+
NODE_ENV=production
6+
PORT=3000
7+
API_KEYS=REPLACE_WITH_PRODUCTION_API_KEYS
8+
ADMIN_KEYS=REPLACE_WITH_PRODUCTION_ADMIN_KEY
9+
REDIS_URL=redis://prod-redis:6379
10+
LOG_LEVEL=warn

.env.staging

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
STELLAR_NETWORK=TESTNET
2+
HORIZON_URL=https://horizon-testnet.stellar.org
3+
CONTRACT_ID=REPLACE_WITH_STAGING_CONTRACT_ID
4+
DATABASE_URL=postgres://user:password@staging-db:5432/stellar_escrow_staging
5+
NODE_ENV=staging
6+
PORT=3000
7+
API_KEYS=REPLACE_WITH_STAGING_API_KEYS
8+
ADMIN_KEYS=REPLACE_WITH_STAGING_ADMIN_KEY
9+
REDIS_URL=redis://staging-redis:6379
10+
LOG_LEVEL=info

.eslintrc.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"plugins": ["@typescript-eslint"],
5+
"extends": [
6+
"eslint:recommended",
7+
"plugin:@typescript-eslint/recommended"
8+
],
9+
"rules": {
10+
"@typescript-eslint/no-explicit-any": "warn",
11+
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
12+
"no-console": ["warn", { "allow": ["warn", "error"] }]
13+
},
14+
"ignorePatterns": ["dist/", "node_modules/", "*.config.*"]
15+
}
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
name: Accessibility Tests
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
paths: ['components/**', 'frontend/**', 'testing/accessibility/**']
7+
pull_request:
8+
branches: [main, develop]
9+
schedule:
10+
- cron: '0 3 * * 1' # Weekly Monday 03:00 UTC
11+
12+
concurrency:
13+
group: a11y-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
automated-a11y:
18+
name: Automated A11y (axe-core)
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- uses: actions/setup-node@v4
25+
with:
26+
node-version: '20'
27+
cache: 'npm'
28+
29+
- name: Install root dependencies
30+
run: npm ci
31+
32+
- name: Install a11y test dependencies
33+
run: npm ci
34+
working-directory: testing/accessibility
35+
36+
- name: Run automated accessibility tests
37+
run: npm run test:ci
38+
working-directory: testing/accessibility
39+
env:
40+
GITHUB_SHA: ${{ github.sha }}
41+
42+
- name: Generate accessibility report
43+
run: node scripts/generate-a11y-report.js
44+
working-directory: testing/accessibility
45+
if: always()
46+
47+
- name: Upload accessibility reports
48+
uses: actions/upload-artifact@v4
49+
if: always()
50+
with:
51+
name: a11y-reports-${{ github.run_number }}
52+
path: testing/accessibility/reports/
53+
retention-days: 60
54+
55+
frontend-a11y:
56+
name: Frontend A11y Tests
57+
runs-on: ubuntu-latest
58+
59+
steps:
60+
- uses: actions/checkout@v4
61+
62+
- uses: actions/setup-node@v4
63+
with:
64+
node-version: '20'
65+
cache: 'npm'
66+
67+
- name: Install frontend dependencies
68+
run: npm ci
69+
working-directory: frontend
70+
71+
- name: Run existing frontend a11y tests
72+
run: node tests/a11y.test.js
73+
working-directory: frontend
74+
continue-on-error: true
75+
76+
- name: Upload frontend a11y report
77+
uses: actions/upload-artifact@v4
78+
if: always()
79+
with:
80+
name: frontend-a11y-report-${{ github.run_number }}
81+
path: frontend/ACCESSIBILITY_REPORT.txt
82+
retention-days: 60
83+
84+
comment-a11y:
85+
name: Comment A11y Results
86+
runs-on: ubuntu-latest
87+
needs: [automated-a11y, frontend-a11y]
88+
if: github.event_name == 'pull_request' && always()
89+
permissions:
90+
pull-requests: write
91+
92+
steps:
93+
- uses: actions/download-artifact@v4
94+
with:
95+
pattern: a11y-reports-*
96+
merge-multiple: true
97+
path: reports/
98+
99+
- name: Post a11y summary
100+
uses: actions/github-script@v7
101+
with:
102+
script: |
103+
const fs = require('fs');
104+
const p = 'reports/a11y-results.json';
105+
if (!fs.existsSync(p)) return;
106+
const { summary, meta } = JSON.parse(fs.readFileSync(p, 'utf-8'));
107+
const icon = summary.failed === 0 ? '✅' : '❌';
108+
const body = [
109+
`### ${icon} Accessibility Tests (WCAG 2.1 AA)`,
110+
'',
111+
`| Metric | Value |`,
112+
`|--------|-------|`,
113+
`| Total | ${summary.total} |`,
114+
`| Passed | ${summary.passed} |`,
115+
`| Failed | ${summary.failed} |`,
116+
`| Pass Rate | ${summary.pass_rate}% |`,
117+
'',
118+
summary.failed > 0
119+
? '⚠ Accessibility violations detected. Review the uploaded report artifact.'
120+
: '_All automated accessibility checks passed._',
121+
].join('\n');
122+
github.rest.issues.createComment({
123+
issue_number: context.issue.number,
124+
owner: context.repo.owner,
125+
repo: context.repo.repo,
126+
body,
127+
});
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
name: Cross-Browser Tests
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
9+
concurrency:
10+
group: browser-tests-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
# ── Unit / compat tests (Jest) ─────────────────────────────────────────────
15+
unit-compat:
16+
name: Unit & Compat Tests
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '20'
26+
cache: 'npm'
27+
cache-dependency-path: |
28+
frontend/package.json
29+
components/package.json
30+
31+
- name: Install frontend deps
32+
run: npm install
33+
working-directory: frontend
34+
35+
- name: Run frontend compat tests
36+
run: npm test -- --ci --forceExit
37+
working-directory: frontend
38+
39+
- name: Install components deps
40+
run: npm install
41+
working-directory: components
42+
43+
- name: Run components unit tests
44+
run: npm test -- --ci --forceExit
45+
working-directory: components
46+
47+
# ── Playwright cross-browser E2E ──────────────────────────────────────────
48+
playwright:
49+
name: Playwright (${{ matrix.project }})
50+
runs-on: ubuntu-latest
51+
needs: unit-compat
52+
53+
strategy:
54+
fail-fast: false
55+
matrix:
56+
project:
57+
- chromium
58+
- firefox
59+
- webkit
60+
- mobile-chrome
61+
- mobile-safari
62+
63+
steps:
64+
- uses: actions/checkout@v4
65+
66+
- name: Setup Node.js
67+
uses: actions/setup-node@v4
68+
with:
69+
node-version: '20'
70+
cache: 'npm'
71+
cache-dependency-path: package.json
72+
73+
- name: Install root deps
74+
run: npm install
75+
76+
- name: Install Playwright browsers
77+
run: npx playwright install --with-deps ${{ matrix.project == 'mobile-chrome' && 'chromium' || matrix.project == 'mobile-safari' && 'webkit' || matrix.project }}
78+
79+
- name: Run Playwright tests (${{ matrix.project }})
80+
run: npx playwright test --project=${{ matrix.project }}
81+
env:
82+
CI: true
83+
84+
- name: Upload Playwright report
85+
if: always()
86+
uses: actions/upload-artifact@v4
87+
with:
88+
name: playwright-report-${{ matrix.project }}
89+
path: playwright-report/
90+
retention-days: 14
91+
92+
# ── Edge desktop (separate runner — requires msedge channel) ──────────────
93+
playwright-edge:
94+
name: Playwright (edge)
95+
runs-on: windows-latest
96+
needs: unit-compat
97+
98+
steps:
99+
- uses: actions/checkout@v4
100+
101+
- name: Setup Node.js
102+
uses: actions/setup-node@v4
103+
with:
104+
node-version: '20'
105+
cache: 'npm'
106+
cache-dependency-path: package.json
107+
108+
- name: Install root deps
109+
run: npm install
110+
111+
- name: Install Playwright with Edge
112+
run: npx playwright install --with-deps msedge
113+
114+
- name: Run Playwright tests (edge)
115+
run: npx playwright test --project=edge
116+
env:
117+
CI: true
118+
119+
- name: Upload Playwright report
120+
if: always()
121+
uses: actions/upload-artifact@v4
122+
with:
123+
name: playwright-report-edge
124+
path: playwright-report/
125+
retention-days: 14
126+
127+
# ── Summary gate ──────────────────────────────────────────────────────────
128+
browser-tests-pass:
129+
name: All Browser Tests Pass
130+
runs-on: ubuntu-latest
131+
needs: [unit-compat, playwright, playwright-edge]
132+
if: always()
133+
134+
steps:
135+
- name: Check all jobs succeeded
136+
run: |
137+
if [[ "${{ needs.unit-compat.result }}" != "success" ]]; then
138+
echo "unit-compat failed" && exit 1
139+
fi
140+
if [[ "${{ needs.playwright.result }}" != "success" ]]; then
141+
echo "playwright matrix failed" && exit 1
142+
fi
143+
if [[ "${{ needs.playwright-edge.result }}" != "success" ]]; then
144+
echo "playwright-edge failed" && exit 1
145+
fi
146+
echo "All browser tests passed."

0 commit comments

Comments
 (0)