Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
205 commits
Select commit Hold shift + click to select a range
73dfd18
Merge pull request #1220 from Mimah97/main
aji70 May 26, 2026
f5f967d
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 26, 2026
ef593f2
feat(content-likes): add pagination or cap for likes by user (#849)
favourawaku May 26, 2026
95e59c2
feat(creator-earnings): emit event on withdraw (#850)
favourawaku May 26, 2026
81cfbfc
feat(treasury): add minimum balance or emergency pause protection (#851)
favourawaku May 26, 2026
a06902c
feat(creator-registry): add rate limit or fee for registration (#852)
favourawaku May 26, 2026
8cfcdc6
Merge pull request #1221 from favourawaku/feat/issues-849-852
aji70 May 26, 2026
e4270cc
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 26, 2026
afec2e4
feat(social-links): add URL validation and domain allowlist (#853)
Jambox11 May 27, 2026
e72696f
feat(social-links): add rate limiting on create and update (#854)
Jambox11 May 27, 2026
a35feeb
feat(creators): add search by display name or handle (#856)
Jambox11 May 27, 2026
e65a370
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 27, 2026
b479cab
Merge pull request #1222 from Jambox11/main
aji70 May 27, 2026
52c3fc0
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 27, 2026
ad25d72
feat(api): standardize pagination on subscriptions, creators, and pos…
Saboleee May 27, 2026
7c91a8d
test(wallet): add integration tests for wallet-related endpoints (#862)
Saboleee May 27, 2026
dec6d3a
feat: Request ID and correlation ID in logs
Meshmulla May 27, 2026
580e0aa
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 27, 2026
e62d074
feat(wallet): detect and handle wrong network mismatch (#863)
Saboleee May 27, 2026
72234ea
feat(onboarding): add creator onboarding progress indicator (#864)
Saboleee May 27, 2026
8bd5287
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 27, 2026
ec2a9bf
Merge pull request #1224 from Saboleee/main
aji70 May 27, 2026
c627cc5
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 27, 2026
c62bb64
feat: API versioning
Meshmulla May 27, 2026
36561ec
feat: Posts: soft delete and audit trail
Meshmulla May 27, 2026
ed5c6e4
Merge branch 'main' into audit_trail
Meshmulla May 27, 2026
c9d7bdb
Merge branch 'main' into main
aji70 May 27, 2026
f2c9508
Merge pull request #1223 from Meshmulla/main
aji70 May 27, 2026
9df2acb
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 27, 2026
1f51598
Merge pull request #1225 from Meshmulla/API_versioning
aji70 May 27, 2026
6517fbf
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 27, 2026
3c5ad16
Merge pull request #1226 from Meshmulla/audit_trail
aji70 May 27, 2026
ed7f139
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 27, 2026
5f189be
feat: Health check for Soroban RPC
Meshmulla May 28, 2026
6760cb1
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 28, 2026
5e42b41
feat(contract): improve myfans-token — error codes, gas, integration …
abdegenius May 28, 2026
b1db7c3
Merge pull request #1228 from abdegenius/feature/885-888-myfans-token…
aji70 May 28, 2026
36d73f4
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 28, 2026
b5ee74d
Merge branch 'main' into main
aji70 May 28, 2026
2481aff
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 28, 2026
1468049
Merge pull request #1227 from Meshmulla/main
aji70 May 28, 2026
c2651b3
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 28, 2026
1316e4b
feat(myfans-token): add property tests for allowance, approve, clear_…
had3sgames May 28, 2026
9b3d0b9
feat(subscription): add unit tests for initialize and admin paths (#890)
had3sgames May 28, 2026
7bef01e
feat(subscription): add unauthorized caller revert tests (#891)
had3sgames May 28, 2026
0d68968
Contract subscription: Emit events for primary state changes
had3sgames May 28, 2026
658489d
contract/subscription: document public functions in README and add sn…
Haroldwonder May 28, 2026
541d2e2
lfg
kaynaomi-oss May 28, 2026
69b3495
refactor: simplify function signatures and improve code readability
ABEEGOLD May 28, 2026
14a8fcf
Merge pull request #1230 from had3sgames/issue/889-myfans-token-prope…
aji70 May 28, 2026
aa758b0
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 28, 2026
363f76c
Merge branch 'main' into issue/890-subscription-init-admin-tests
aji70 May 28, 2026
8f4c34d
Merge pull request #1231 from had3sgames/issue/890-subscription-init-…
aji70 May 28, 2026
bc99591
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 28, 2026
cd8fdde
Merge branch 'main' into issue/891-subscription-unauthorized-revert-t…
aji70 May 28, 2026
80894fd
Merge pull request #1232 from had3sgames/issue/891-subscription-unaut…
aji70 May 28, 2026
dd19b0c
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 28, 2026
39f6721
Merge pull request #1233 from had3sgames/892-contract-subscription-em…
aji70 May 28, 2026
a030a0f
Merge pull request #1234 from Haroldwonder/fix/subscription-893-894-r…
aji70 May 28, 2026
f76909b
Merge pull request #1235 from kaynaomi-oss/llins
aji70 May 28, 2026
3d044da
Merge pull request #1236 from ABEEGOLD/contract-myfans-token-snapshot…
aji70 May 28, 2026
0ab1336
fix(subscription): validate error codes, optimize gas, add integratio…
richardiyamura May 28, 2026
273666f
Merge pull request #1237 from richardiyamura/fix/subscription-895-896…
aji70 May 28, 2026
7c8dfc1
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 28, 2026
99e91d9
docs(treasury): document all public functions in README and lib.rs
whisper011 May 28, 2026
9ef40a6
test(treasury): add snapshot/restore consistency test
whisper011 May 28, 2026
e180fbe
test: add unauthorized caller revert tests for content-access contrac…
aji70 May 28, 2026
cb58de2
feat: emit structured events for primary state changes in content-acc…
aji70 May 28, 2026
fc8a06f
feat(contract): treasury events, unit/auth tests, subscription proper…
Realericky May 28, 2026
2722d10
feat: add structured treasury error codes and tests (#905)
aji70 May 28, 2026
eeb0ee5
ci: verify treasury wasm artifact in contract CI (#908)
aji70 May 28, 2026
825e6f0
ci: fail on outdated package-lock
jhayniffy May 29, 2026
09068e1
ci: add contract coverage report
jhayniffy May 29, 2026
c46de68
feat(backend): IPFS metadata upload flow
jhayniffy May 29, 2026
b219941
feat(backend): add renewal_failed to indexer event DTO and stub test
jhayniffy May 29, 2026
30d484b
test(content-likes): add snapshot/restore consistency test
wendypetersondev May 29, 2026
7b40758
docs(content-likes): document public functions in contract README
wendypetersondev May 29, 2026
717b42b
content-likes: add initialize and admin functions with unit tests
chriz-cloud May 29, 2026
4de974f
test-consumer: add integration test for content-access contract
chriz-cloud May 29, 2026
fd3d678
content-access: add property tests for invariants
chriz-cloud May 29, 2026
b1ede50
Document public functions in myfans-token contract README
May 29, 2026
75a4c14
contracts(content-access): document public functions in README and fi…
MusaTheDev001 May 29, 2026
d35ff53
contracts(content-access): add snapshot/restore consistency test and …
MusaTheDev001 May 29, 2026
5188292
contracts(content-access): optimize hot paths and add micro-bench tes…
MusaTheDev001 May 29, 2026
44bb30f
feat: ci run contract tests
henrypeters May 29, 2026
d61d0ba
feat: ci cach cargo and npm dependencies
henrypeters May 29, 2026
55f0a4f
feat: security audit in ci
henrypeters May 29, 2026
5752381
docs(security): expand JWT_SECRET rotation runbook with zero-downtime…
jhayniffy May 29, 2026
d6feee9
fix(security): fix CORS duplicate origin key bug and add per-environm…
jhayniffy May 29, 2026
dfc88ed
docs: update architecture diagram and add security/CORS doc links to …
jhayniffy May 29, 2026
739961b
feat(observability): define and enforce structured log fields standard
jhayniffy May 30, 2026
f27866d
ci: parallelize frontend and backend jobs (batch 2)
jhayniffy May 30, 2026
b0e9f83
test(e2e): mock Stellar RPC in CI
jhayniffy May 30, 2026
adc9795
test(e2e): smoke test on PR for main flows
jhayniffy May 30, 2026
da99f23
fix(creator-deposits): validate error codes and replace unwrap with t…
Tukura11 May 30, 2026
69e8e30
fix(creator-deposits): add gas optimization comments for hot paths (#…
Tukura11 May 30, 2026
9b657c7
fix(creator-deposits): add integration test via test-consumer (#937)
Tukura11 May 30, 2026
c745891
fix(ci): add wasm build verification step for creator-deposits (#938)
Tukura11 May 30, 2026
abfddb9
fix(content-likes): validate and fix error codes and panic messages (…
Almikefred May 30, 2026
d9e286e
fix(content-likes): add integration test via test-consumer (#927)
Almikefred May 30, 2026
936add6
fix(ci): add wasm build verification step for content-likes in CI dep…
Almikefred May 30, 2026
452bb6a
Merge pull request #1256 from Almikefred/main
aji70 May 30, 2026
e322ba8
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 30, 2026
1bd632a
Merge pull request #1238 from whisper011/feat/Document-public-functio…
aji70 May 30, 2026
01cad11
Merge pull request #1239 from whisper011/feat/Add-snapshot/restore-co…
aji70 May 30, 2026
e5de062
Merge pull request #1240 from Realericky/feat/contract-tests-899-900-…
aji70 May 30, 2026
a1e2cab
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 30, 2026
c378e0c
Merge pull request #1241 from dreamgenies/test/911-content-access-una…
aji70 May 30, 2026
0f6e958
Merge pull request #1242 from dreamgenies/feat/912-content-access-events
aji70 May 30, 2026
89d9fe2
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 30, 2026
1b2bee8
Merge pull request #1243 from dreamgenies/feat/908-treasury-wasm-ci-v…
aji70 May 30, 2026
792a5b8
Merge pull request #1244 from dreamgenies/feat/905-treasury-error-codes
aji70 May 30, 2026
8f28939
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 30, 2026
27132cb
Merge pull request #1245 from jhayniffy/feature/ci-ipfs-improvements
aji70 May 30, 2026
4e9d4e9
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 30, 2026
28a90e3
Merge branch 'main' into feat/924-snapshot-restore-consistency-test
aji70 May 30, 2026
ad1537e
Merge pull request #1246 from wendypetersondev/feat/924-snapshot-rest…
aji70 May 30, 2026
8a70fe3
Merge pull request #1247 from wendypetersondev/feat/923-document-publ…
aji70 May 30, 2026
a1c6856
feat(contract): emit events for content-likes state changes
wendypetersondev May 30, 2026
8b975ea
test(contract): add unauthorized caller revert tests for content-likes
wendypetersondev May 30, 2026
f0e7362
Add MyFans token property invariant test for clear_allowance
had3sgames May 30, 2026
d713f25
Add subscription init success and duplicate initialization tests
had3sgames May 30, 2026
fbfe5c3
Add subscription unauthorized pause/unpause revert tests
had3sgames May 30, 2026
a4380c1
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 30, 2026
044e5e2
feat(security): integrate helmet as baseline security headers layer
martinzhames May 30, 2026
5937a28
docs(contract): add contract deploy runbook
martinzhames May 30, 2026
7f2a14d
docs(backend): add API quickstart for new contributors
martinzhames May 30, 2026
ff90d30
ci(contract): cache WASM artifacts to speed up contract CI (batch 2)
martinzhames May 30, 2026
a5b0cca
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 30, 2026
c2ec4a4
Merge branch 'main' into improve-content-access-and-likes-contracts
aji70 May 30, 2026
3150a15
Merge pull request #1248 from chriz-cloud/improve-content-access-and-…
aji70 May 30, 2026
6fe72db
Merge pull request #1249 from AGWAM001/main
aji70 May 30, 2026
c203f6a
feat(devex): add seed script for demo creators
josunday002 May 30, 2026
e836d96
feat(devex): enhance docker-compose for local stack
josunday002 May 30, 2026
5003be2
feat(observability): add health check aggregation endpoint
josunday002 May 30, 2026
42c50d6
feat(integration): sync subscription state from chain
josunday002 May 30, 2026
360052c
Merge branch 'main' into feature/solve-implementation
aji70 May 30, 2026
d7a283e
Merge pull request #1250 from MusaTheDev001/feature/solve-implementation
aji70 May 30, 2026
7864bb1
Merge pull request #1251 from henrypeters/feature/issue-873-ci-run-co…
aji70 May 30, 2026
1012035
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 30, 2026
03e56fa
Merge pull request #1252 from henrypeters/feature/issue-874-ci-cach-c…
aji70 May 30, 2026
eeb2e86
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 30, 2026
9d313f7
Merge pull request #1253 from henrypeters/feature/issue-875-security-…
aji70 May 30, 2026
6a4795e
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 30, 2026
629c595
Merge pull request #1254 from devoclan/fix/docs-indexer-jwt-cors-issues
aji70 May 30, 2026
74e6acb
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 30, 2026
e459bb2
Merge branch 'main' into sundayjob
aji70 May 30, 2026
c29b495
Merge pull request #1255 from sundayjob996/sundayjob
aji70 May 30, 2026
8ecbd2c
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 30, 2026
dcd7e4a
fix(treasury): add gas benchmark tests and hot path optimization note…
May 30, 2026
15cf924
test(treasury): add integration test suite via test-consumer pattern …
May 30, 2026
0dffbd4
test(treasury): add property and fuzz tests for treasury contract inv…
May 30, 2026
99c62c7
test(content-access): add unit tests for initialize and admin paths (…
May 30, 2026
9560e3f
logging redact pii
henrypeters May 30, 2026
83ca4fb
Merge branch 'main' into feature/issue-876-logging-redact-pii
henrypeters May 30, 2026
1fb67aa
Merge pull request #1257 from Tukura11/main
aji70 May 31, 2026
3d9d7e7
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 31, 2026
88a9780
Merge pull request #1258 from wendypetersondev/feat/922-content-likes…
aji70 May 31, 2026
4f1c9e3
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 31, 2026
5d59cae
Merge pull request #1259 from wendypetersondev/feat/921-content-likes…
aji70 May 31, 2026
afa0e11
Merge pull request #1260 from had3sgames/issue-889-add-token-invarian…
aji70 May 31, 2026
a0a5006
Merge pull request #1261 from had3sgames/issue-890-add-subscription-i…
aji70 May 31, 2026
2a18f6d
Merge pull request #1262 from had3sgames/issue-891-add-subscription-u…
aji70 May 31, 2026
97cabc3
Merge branch 'main' into fix/security-headers-helmet-docs-ci-wasm-batch2
aji70 May 31, 2026
1e2b30a
Merge pull request #1263 from martinzhames/fix/security-headers-helme…
aji70 May 31, 2026
e7550d3
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 31, 2026
1fc4c35
Merge branch 'main' into feature/devex-observability-improvements
aji70 May 31, 2026
db0cdca
Merge pull request #1264 from josunday002/feature/devex-observability…
aji70 May 31, 2026
faceb9a
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 31, 2026
881a92e
Merge pull request #1265 from NUMBER72857/fix/906-treasury-gas-review
aji70 May 31, 2026
054aeaa
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 31, 2026
710b1ad
Merge branch 'main' into feat/909-treasury-property-fuzz-tests
aji70 May 31, 2026
1ca39fb
Merge pull request #1267 from NUMBER72857/feat/909-treasury-property-…
aji70 May 31, 2026
006f2dd
Merge pull request #1266 from NUMBER72857/feat/907-treasury-integrati…
aji70 May 31, 2026
a65821a
Merge pull request #1268 from NUMBER72857/feat/910-content-access-ini…
aji70 May 31, 2026
ba22bd7
Merge pull request #1269 from henrypeters/feature/issue-876-logging-r…
aji70 May 31, 2026
5c21688
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 31, 2026
6cea981
test(contract): add unauthorized caller revert tests to creator-earnings
Xaxxoo May 31, 2026
54bb747
test(contract): review gas usage for creator-earnings hot paths
Xaxxoo May 31, 2026
206fd73
feat(contract): emit events for primary state changes
Xaxxoo May 31, 2026
3a6899d
test(contract): add snapshot/restore consistency tests
Xaxxoo May 31, 2026
0bd8aa3
feat: feature flags for new flows
lyon-1050 May 31, 2026
052a2e2
Merge pull request #1274 from Xaxxoo/feat/942-creator-earnings-emit-e…
aji70 May 31, 2026
25ce028
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 31, 2026
9e08926
Merge branch 'main' into fix/941-creator-earnings-unauthorized-revert…
aji70 May 31, 2026
437672d
Merge pull request #1275 from Xaxxoo/fix/941-creator-earnings-unautho…
aji70 May 31, 2026
1f51207
feat: metrics and alerting
lyon-1050 May 31, 2026
7586051
Merge branch 'main' into feat/944-creator-earnings-snapshot-restore-test
aji70 May 31, 2026
957bf6b
Merge pull request #1276 from Xaxxoo/feat/944-creator-earnings-snapsh…
aji70 May 31, 2026
01f9714
Merge branch 'main' into feat/946-creator-earnings-gas-review
aji70 May 31, 2026
d474a33
feat: treasury deposit event
lyon-1050 May 31, 2026
03fce34
Merge pull request #1277 from Xaxxoo/feat/946-creator-earnings-gas-re…
aji70 May 31, 2026
7f652fd
feat: unit tests
lyon-1050 May 31, 2026
ec35f84
feat(content-likes): add invariant property tests
isaacCodes1 May 31, 2026
c86f0ac
Merge pull request #1278 from lyon-1050/feature/issue-877-feature-flags
aji70 May 31, 2026
d132715
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 31, 2026
692f8c8
Merge pull request #1279 from lyon-1050/feature/issue-878-metrics-and…
aji70 May 31, 2026
685233f
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 31, 2026
691e291
Merge pull request #1280 from lyon-1050/feature/issue-879-tresusury-d…
aji70 May 31, 2026
bfbcf34
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 31, 2026
d0c23a4
Merge pull request #1281 from lyon-1050/feature/issue-880-unit-tests
aji70 May 31, 2026
76ea7bb
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 31, 2026
e7ac40c
Merge pull request #1282 from isaacCodes1/fix/content-likes-invariant…
aji70 May 31, 2026
84a9474
docs: update CHANGELOG.md [skip ci]
github-actions[bot] May 31, 2026
83583b2
test(creator-earnings): add integration tests via test-consumer
pharuq411 Jun 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .env.dev.example
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ DB_NAME=myfans
# -----------------------------------------------------------------------------
JWT_SECRET=dev-jwt-secret-change-me-to-a-strong-random-value

# -----------------------------------------------------------------------------
# Redis (optional — used for caching; defaults work with docker-compose.dev.yml)
# -----------------------------------------------------------------------------
REDIS_HOST=redis
REDIS_PORT=6379

# -----------------------------------------------------------------------------
# Stellar / Soroban
# Safe testnet defaults for local development
Expand Down
47 changes: 46 additions & 1 deletion .github/workflows/audit-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:
with:
node-version: "20"

- name: 🦀 Setup Rust
uses: dtolnay/rust-toolchain@stable

- name: 📦 Check backend audits
id: backend-audit
working-directory: ./backend
Expand Down Expand Up @@ -93,6 +96,46 @@ jobs:
exit 1
fi

- name: � Check Cargo audit (contract)
id: contract-audit
run: |
if [ -d "./contract" ] && [ -f "./contract/Cargo.toml" ]; then
echo "Installing cargo-audit..."
cargo install cargo-audit --quiet 2>&1 | grep -v "already installed" || true

cd ./contract
AUDIT_OUTPUT=$(cargo audit --json 2>/dev/null || echo '{"vulnerabilities":[]}')
CRITICAL=$(echo "$AUDIT_OUTPUT" | jq '[.vulnerabilities[] | select(.severity=="critical")] | length' 2>/dev/null || echo "0")
HIGH=$(echo "$AUDIT_OUTPUT" | jq '[.vulnerabilities[] | select(.severity=="high")] | length' 2>/dev/null || echo "0")
TOTAL=$(echo "$AUDIT_OUTPUT" | jq '.vulnerabilities | length' 2>/dev/null || echo "0")

echo "contract_critical=$CRITICAL" >> $GITHUB_OUTPUT
echo "contract_high=$HIGH" >> $GITHUB_OUTPUT
echo "contract_total=$TOTAL" >> $GITHUB_OUTPUT

echo "### 🔐 Contract (Cargo) Audit Results" >> $GITHUB_STEP_SUMMARY
echo "| Severity | Count |" >> $GITHUB_STEP_SUMMARY
echo "|----------|-------|" >> $GITHUB_STEP_SUMMARY
echo "| Critical | $CRITICAL |" >> $GITHUB_STEP_SUMMARY
echo "| High | $HIGH |" >> $GITHUB_STEP_SUMMARY
echo "| Total | $TOTAL |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

if (( CRITICAL > 0 )); then
echo "❌ **CRITICAL vulnerabilities detected**" >> $GITHUB_STEP_SUMMARY
echo "::error::Critical Cargo vulnerabilities: $CRITICAL"
exit 1
fi
if (( HIGH > 0 )); then
echo "❌ **HIGH vulnerabilities detected**" >> $GITHUB_STEP_SUMMARY
echo "::warning::High Cargo vulnerabilities: $HIGH"
fi
else
echo "contract_critical=0" >> $GITHUB_OUTPUT
echo "contract_high=0" >> $GITHUB_OUTPUT
echo "contract_total=0" >> $GITHUB_OUTPUT
fi

- name: 💬 Comment on PR with audit summary
if: github.event_name == 'pull_request' && always()
uses: actions/github-script@v7
Expand All @@ -103,7 +146,9 @@ jobs:
const backendHigh = '${{ steps.backend-audit.outputs.backend_high }}' || '0';
const frontendCritical = '${{ steps.frontend-audit.outputs.frontend_critical }}' || '0';
const frontendHigh = '${{ steps.frontend-audit.outputs.frontend_high }}' || '0';
const comment = '## 🔐 Security Audit Summary\n\n**Backend:**\n- 🔴 Critical: ' + backendCritical + '\n- 🟠 High: ' + backendHigh + '\n\n**Frontend:**\n- 🔴 Critical: ' + frontendCritical + '\n- 🟠 High: ' + frontendHigh + '\n\nRun locally with: `./scripts/check-audits.sh`';
const contractCritical = '${{ steps.contract-audit.outputs.contract_critical }}' || '0';
const contractHigh = '${{ steps.contract-audit.outputs.contract_high }}' || '0';
const comment = '## 🔐 Security Audit Summary\n\n**Backend (npm):**\n- 🔴 Critical: ' + backendCritical + '\n- 🟠 High: ' + backendHigh + '\n\n**Frontend (npm):**\n- 🔴 Critical: ' + frontendCritical + '\n- 🟠 High: ' + frontendHigh + '\n\n**Contract (Cargo):**\n- 🔴 Critical: ' + contractCritical + '\n- 🟠 High: ' + contractHigh + '\n\nRun locally with: `./scripts/check-audits.sh`';
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
Expand Down
121 changes: 105 additions & 16 deletions .github/workflows/backend-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,126 @@ name: Backend CI

on:
pull_request:
paths:
- 'backend/**'
- '.github/workflows/backend-ci.yml'
push:
branches:
- main
- master
branches: [main, master]
paths:
- 'backend/**'
- '.github/workflows/backend-ci.yml'
workflow_dispatch:

jobs:
backend:
name: backend
lint:
name: Backend – Lint
runs-on: ubuntu-latest
timeout-minutes: 20

timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 20
cache: npm
cache-dependency-path: backend/package-lock.json

- name: Check package-lock is up to date
run: |
npm install --package-lock-only --ignore-scripts
git diff --exit-code package-lock.json || {
echo "::error::package-lock.json is out of sync with package.json. Run 'npm install' locally and commit the updated lockfile."
exit 1
}
working-directory: backend

- name: Install dependencies
run: npm ci
working-directory: backend

- name: Build
run: npm run build
test:
name: Backend – Test (Node.js ${{ matrix.node }})
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
node: ['20', '22']
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: myfans_ci
POSTGRES_PASSWORD: myfans_ci
POSTGRES_DB: myfans_test
ports:
- 5432:5432
options: >
--health-cmd pg_isready
--health-interval 5s
--health-timeout 5s
--health-retries 10
env:
DB_HOST: localhost
DB_PORT: 5432
DB_USER: myfans_ci
DB_PASSWORD: myfans_ci
DB_NAME: myfans_test
JWT_SECRET: ci-test-secret-not-for-production
WEBHOOK_SECRET: ci-webhook-secret-not-for-production
NODE_ENV: test
STELLAR_NETWORK: testnet
SOROBAN_RPC_URL: https://soroban-testnet.stellar.org
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: ${{ matrix.node }}
cache: npm
cache-dependency-path: backend/package-lock.json
- run: npm ci
working-directory: backend
- run: npm test
working-directory: backend

build:
name: Backend – Build
runs-on: ubuntu-latest
timeout-minutes: 10
needs: [lint, test]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 20
cache: npm
cache-dependency-path: backend/package-lock.json
- run: npm ci
working-directory: backend
- run: npm run build
working-directory: backend

- name: Test
run: npm test
- name: 🔐 Run npm audit
id: npm-audit
continue-on-error: true
run: |
AUDIT_JSON=$(npm audit --json 2>/dev/null || echo '{"metadata":{"vulnerabilities":{"critical":0,"high":0,"moderate":0}}}')
CRITICAL=$(echo "$AUDIT_JSON" | jq '.metadata.vulnerabilities.critical // 0')
HIGH=$(echo "$AUDIT_JSON" | jq '.metadata.vulnerabilities.high // 0')
MODERATE=$(echo "$AUDIT_JSON" | jq '.metadata.vulnerabilities.moderate // 0')

echo "critical=$CRITICAL" >> $GITHUB_OUTPUT
echo "high=$HIGH" >> $GITHUB_OUTPUT
echo "moderate=$MODERATE" >> $GITHUB_OUTPUT

echo "### 📦 Backend npm Audit" >> $GITHUB_STEP_SUMMARY
echo "| Severity | Count |" >> $GITHUB_STEP_SUMMARY
echo "|----------|-------|" >> $GITHUB_STEP_SUMMARY
echo "| Critical | $CRITICAL |" >> $GITHUB_STEP_SUMMARY
echo "| High | $HIGH |" >> $GITHUB_STEP_SUMMARY
echo "| Moderate | $MODERATE |" >> $GITHUB_STEP_SUMMARY

if (( CRITICAL > 0 || HIGH > 0 )); then
echo "::error::High/Critical vulnerabilities detected - review and fix before merging"
exit 1
fi
working-directory: backend
75 changes: 72 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# Jobs run in parallel by default (no `needs:` between backend/frontend/contract).
# Only db-backup-drill and wasm-size have explicit sequencing requirements.
#
# Parallelism layout:
# backend ──────────────────────────────────────────────────────┐
# backend-migrations ──────────────────────────────────────────┐ │
# frontend ──────────────────────────────────────────────────┐ │ │
# contract ──────────────────────────────────────────────┐ │ │ │
# │ │ │ │
# wasm-size (needs: contract) ──────────────────────────►│ │ │ │
# db-backup-drill (needs: backend-migrations) ──────────►│ │ │ │
# ci-gate (needs: all) ─────────────────────────────────►└───┘─┘─┘
name: CI

on:
Expand Down Expand Up @@ -57,6 +69,15 @@ jobs:
cache: 'npm'
cache-dependency-path: backend/package-lock.json

- name: Check package-lock is up to date
run: |
npm install --package-lock-only --ignore-scripts
git diff --exit-code package-lock.json || {
echo "::error::package-lock.json is out of sync with package.json. Run 'npm install' locally and commit the updated lockfile."
exit 1
}
working-directory: backend

- name: Install dependencies
run: npm ci
working-directory: backend
Expand Down Expand Up @@ -152,6 +173,15 @@ jobs:
cache: 'npm'
cache-dependency-path: frontend/package-lock.json

- name: Check package-lock is up to date
run: |
npm install --package-lock-only --ignore-scripts
git diff --exit-code package-lock.json || {
echo "::error::package-lock.json is out of sync with package.json. Run 'npm install' locally and commit the updated lockfile."
exit 1
}
working-directory: frontend

- name: Install dependencies
run: npm ci
working-directory: frontend
Expand Down Expand Up @@ -252,9 +282,12 @@ jobs:
${{ runner.os }}-contract-target-

- name: Install toolchain
run: rustup component add rustfmt clippy
run: rustup component add rustfmt clippy llvm-tools-preview
working-directory: contract

- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov

- name: Check formatting
run: cargo fmt --check
working-directory: contract
Expand All @@ -263,8 +296,23 @@ jobs:
run: cargo clippy --all-targets --all-features
working-directory: contract

- name: Run tests
run: cargo test --all-features
- name: Run tests with coverage
run: cargo llvm-cov --all-features --lcov --output-path lcov.info
working-directory: contract

- name: Upload coverage report
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: contract-coverage-lcov
path: contract/lcov.info
retention-days: 30
if-no-files-found: error

- name: Write coverage summary
run: |
echo "## Contract Coverage" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
cargo llvm-cov report --summary-only 2>&1 | tail -5 >> $GITHUB_STEP_SUMMARY
working-directory: contract

- name: Build
Expand Down Expand Up @@ -358,3 +406,24 @@ jobs:
done < <(find "$WASM_DIR" -maxdepth 1 -name '*.wasm' -print0 | sort -z)
TOTAL_KIB=$(echo "scale=1; $TOTAL / 1024" | bc)
echo "| **TOTAL** | **$TOTAL** | **$TOTAL_KIB** |" >> $GITHUB_STEP_SUMMARY

# Single required status check for branch protection.
# All parallel jobs must pass before a PR can merge.
ci-gate:
name: CI Gate
runs-on: ubuntu-latest
if: always()
needs:
- backend
- backend-migrations
- frontend
- contract
- wasm-size
- db-backup-drill
steps:
- name: Check all jobs passed
run: |
results='${{ toJSON(needs) }}'
echo "$results" | grep -q '"result": "failure"' && exit 1
echo "$results" | grep -q '"result": "cancelled"' && exit 1
echo "All parallel jobs passed."
Loading