Skip to content

Commit a22af16

Browse files
authored
Merge branch 'main' into main
2 parents c9d8c67 + 0f413f2 commit a22af16

222 files changed

Lines changed: 22277 additions & 5288 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.

.env.example

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# =============================================================================
2+
# TalentTrust Backend — Environment Variables
3+
# =============================================================================
4+
# Copy this file to .env and fill in the values for your environment.
5+
# See docs/backend/config.md for detailed documentation.
6+
# =============================================================================
7+
8+
# Server
9+
PORT=3001
10+
NODE_ENV=development
11+
12+
# Stellar Network
13+
STELLAR_HORIZON_URL=https://horizon-testnet.stellar.org
14+
STELLAR_NETWORK_PASSPHRASE=Test SDF Network ; September 2015
15+
16+
# Soroban Smart Contracts
17+
SOROBAN_RPC_URL=https://soroban-testnet.stellar.org
18+
SOROBAN_CONTRACT_ID=

.eslintrc.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser',
3+
extends: ['plugin:@typescript-eslint/recommended'],
4+
env: {
5+
node: true,
6+
jest: true,
7+
},
8+
ignorePatterns: ['dist', 'node_modules'],
9+
rules: {
10+
'@typescript-eslint/no-explicit-any': 'off',
11+
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }]
12+
},
13+
};

.eslintrc.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"parserOptions": {
5+
"project": "./tsconfig.json",
6+
"ecmaVersion": 2022,
7+
"sourceType": "module"
8+
},
9+
"plugins": ["@typescript-eslint"],
10+
"extends": [
11+
"eslint:recommended",
12+
"plugin:@typescript-eslint/recommended",
13+
"plugin:@typescript-eslint/recommended-requiring-type-checking"
14+
],
15+
"rules": {
16+
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
17+
"@typescript-eslint/explicit-function-return-type": "off",
18+
"@typescript-eslint/no-explicit-any": "warn",
19+
"no-console": "off"
20+
},
21+
"ignorePatterns": ["dist/", "node_modules/", "jest.config.js", "coverage/"]
22+
}

.github/workflows/ci.yml

Lines changed: 93 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
##
2+
# CI Pipeline — TalentTrust Backend
3+
#
4+
# Gates (all must pass before merge):
5+
# 1. lint — ESLint with TypeScript rules
6+
# 2. test — Jest with ≥95% line/function/statement coverage
7+
# 3. build — TypeScript compilation (strict)
8+
# 4. security — npm audit (fails on HIGH or CRITICAL vulnerabilities)
9+
#
10+
# Branch protection: configure GitHub to require all four status checks
11+
# before merging into `main`. See docs/backend/branch-protection.md.
12+
##
13+
114
name: CI
215

316
on:
@@ -6,9 +19,63 @@ on:
619
pull_request:
720
branches: [main]
821

22+
# Cancel in-progress runs for the same branch to save CI minutes.
23+
concurrency:
24+
group: ci-${{ github.ref }}
25+
cancel-in-progress: true
26+
927
jobs:
28+
# ── 1. Lint ────────────────────────────────────────────────────────────────
29+
lint:
30+
name: Lint
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- name: Setup Node.js
36+
uses: actions/setup-node@v4
37+
with:
38+
node-version: '20'
39+
cache: 'npm'
40+
41+
- name: Install dependencies
42+
run: npm ci
43+
44+
- name: Run ESLint
45+
run: npm run lint
46+
47+
# ── 2. Test (with coverage) ────────────────────────────────────────────────
48+
test:
49+
name: Test
50+
runs-on: ubuntu-latest
51+
steps:
52+
- uses: actions/checkout@v4
53+
54+
- name: Setup Node.js
55+
uses: actions/setup-node@v4
56+
with:
57+
node-version: '20'
58+
cache: 'npm'
59+
60+
- name: Install dependencies
61+
run: npm ci
62+
63+
- name: Run tests with coverage
64+
run: npm run test:ci
65+
66+
- name: Upload coverage report
67+
uses: actions/upload-artifact@v4
68+
if: always()
69+
with:
70+
name: coverage-report
71+
path: coverage/
72+
retention-days: 14
73+
74+
# ── 3. Build ───────────────────────────────────────────────────────────────
1075
build:
76+
name: Build
1177
runs-on: ubuntu-latest
78+
needs: [lint, test]
1279
steps:
1380
- uses: actions/checkout@v4
1481

@@ -21,8 +88,31 @@ jobs:
2188
- name: Install dependencies
2289
run: npm ci
2390

24-
- name: Build
91+
- name: Compile TypeScript
2592
run: npm run build
2693

27-
- name: Run tests
28-
run: npm test
94+
- name: Upload build artifact
95+
uses: actions/upload-artifact@v4
96+
with:
97+
name: dist
98+
path: dist/
99+
retention-days: 7
100+
101+
# ── 4. Security audit ─────────────────────────────────────────────────────
102+
security:
103+
name: Security Audit
104+
runs-on: ubuntu-latest
105+
steps:
106+
- uses: actions/checkout@v4
107+
108+
- name: Setup Node.js
109+
uses: actions/setup-node@v4
110+
with:
111+
node-version: '20'
112+
cache: 'npm'
113+
114+
- name: Install dependencies
115+
run: npm ci
116+
117+
- name: npm audit (HIGH + CRITICAL)
118+
run: npm run audit:ci
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Dependency Scan
2+
3+
on:
4+
schedule:
5+
- cron: '0 3 * * 1'
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
dependency-scan:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '20'
22+
cache: 'npm'
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Policy gate (production dependencies)
28+
run: npm run security:audit
29+
30+
- name: Generate JSON report artifact
31+
run: npm run security:audit:json > audit-report.json
32+
33+
- name: Dry-run remediation
34+
run: npm run security:remediate:dry
35+
36+
- name: Upload audit report
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: dependency-audit-report
40+
path: audit-report.json
41+

0 commit comments

Comments
 (0)