Skip to content

Commit 76fa2d4

Browse files
authored
Merge branch 'main' into main
2 parents 2cfb3ed + ecd69fb commit 76fa2d4

41 files changed

Lines changed: 5366 additions & 2734 deletions

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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ STELLAR_NETWORK=testnet
22
CONTRACT_ADDRESS=
33
BACKEND_URL=http://localhost:3001
44
JWT_SECRET=your_jwt_secret_key
5+
NEXT_PUBLIC_IMAGE_REMOTE_PATTERNS=https://cdn.myfans.app,https://media.myfans.app
56

67
# -----------------------------------------------------------------------------
78
# CORS Configuration (for frontend reference)

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
## Summary
2+
3+
<!-- One or two sentences describing what this PR does and why. -->
4+
5+
## Changes
6+
7+
<!-- Bullet list of the key changes made. -->
8+
9+
-
10+
11+
## Test Plan
12+
13+
### Automated tests added or updated
14+
15+
<!-- Check all that apply and briefly describe what each covers. -->
16+
17+
- [ ] **Unit tests** (`backend/src/**/*.spec.ts`) — service/guard/decorator logic in isolation
18+
- [ ] **Integration / e2e tests** (`backend/test/**/*.e2e-spec.ts`) — HTTP round-trips with mocked infrastructure
19+
- [ ] **Frontend component tests** (`frontend/src/**/*.test.{ts,tsx}`) — React component behaviour
20+
- [ ] **Frontend e2e tests** (`frontend/e2e/**/*.spec.ts`) — Playwright browser flows
21+
- [ ] **Contract tests** (`contract/`) — Soroban/Rust unit tests via `cargo test`
22+
- [ ] No new tests required — explain why: ___
23+
24+
### How to run the tests locally
25+
26+
```bash
27+
# Backend unit tests
28+
cd backend && npm test
29+
30+
# Backend e2e tests (requires no live DB — uses in-memory mocks)
31+
cd backend && npm run test:e2e
32+
33+
# Frontend component tests
34+
cd frontend && npx vitest run
35+
36+
# Frontend e2e tests (requires dev server on :3000 and API on :3001)
37+
cd frontend && npx playwright test
38+
39+
# Contract tests
40+
cd contract && cargo test
41+
```
42+
43+
### Manual verification checklist
44+
45+
<!-- Tick each item you verified by hand before requesting review. -->
46+
47+
- [ ] Happy path works end-to-end in a local environment
48+
- [ ] Error / edge cases handled gracefully (stale state, invalid input, disconnected wallet)
49+
- [ ] No regressions in closely related API or UI flows
50+
- [ ] Rate-limiting, auth guards, and feature flags behave as expected where touched
51+
- [ ] Linting passes: `cd backend && npm run lint` / `cd frontend && npm run lint`
52+
53+
## Related issues
54+
55+
<!-- Closes #NNN -->
56+
57+
## Notes for reviewers
58+
59+
<!-- Anything that needs extra attention, known limitations, or follow-up work. -->

.github/workflows/abi-snapshot.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: ABI Snapshot
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "contract/**"
7+
- ".github/workflows/abi-snapshot.yml"
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
contracts-abi:
15+
name: ABI Snapshot Check (optional)
16+
runs-on: ubuntu-latest
17+
continue-on-error: true
18+
defaults:
19+
run:
20+
working-directory: contract
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Set up Rust
26+
uses: dtolnay/rust-toolchain@stable
27+
with:
28+
targets: wasm32-unknown-unknown
29+
30+
- name: Cache Rust dependencies
31+
uses: Swatinem/rust-cache@v2
32+
with:
33+
workspaces: contract
34+
35+
- name: Install Stellar CLI
36+
run: cargo install --locked stellar-cli
37+
38+
- name: Check ABI snapshots
39+
run: ./scripts/snapshot-abi.sh --check

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
DB_PASSWORD: myfans_ci
4444
DB_NAME: myfans_test
4545
JWT_SECRET: ci-test-secret-not-for-production
46+
WEBHOOK_SECRET: ci-webhook-secret-not-for-production
4647
NODE_ENV: test
4748
STELLAR_NETWORK: testnet
4849
SOROBAN_RPC_URL: https://soroban-testnet.stellar.org
@@ -266,4 +267,4 @@ jobs:
266267

267268
- name: Build
268269
run: cargo build --release
269-
working-directory: contract
270+
working-directory: contract
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: Contract MSRV
2+
3+
# Optional second job: verify the workspace compiles and all tests pass on the
4+
# declared Minimum Supported Rust Version (MSRV) without requiring the Stellar
5+
# CLI or any network access. Runs on every PR that touches contract code and
6+
# on pushes to main/develop.
7+
8+
on:
9+
push:
10+
branches: [main, develop]
11+
paths:
12+
- 'contract/**'
13+
- '.github/workflows/contract-msrv.yml'
14+
pull_request:
15+
branches: [main, develop]
16+
paths:
17+
- 'contract/**'
18+
- '.github/workflows/contract-msrv.yml'
19+
20+
env:
21+
CARGO_TERM_COLOR: always
22+
RUST_BACKTRACE: 1
23+
# Keep incremental compilation off so the MSRV build is hermetic.
24+
CARGO_INCREMENTAL: 0
25+
26+
jobs:
27+
msrv:
28+
name: Contract MSRV (Rust ${{ matrix.rust }})
29+
runs-on: ubuntu-latest
30+
timeout-minutes: 30
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
# Primary MSRV declared in contract/Cargo.toml [workspace.package].
36+
# Add additional entries here when you want to test a range, e.g.:
37+
# rust: ['1.74', '1.75', 'stable']
38+
rust: ['1.74']
39+
40+
steps:
41+
- name: Checkout
42+
uses: actions/checkout@v4
43+
44+
# ── Cargo cache ────────────────────────────────────────────────────────
45+
- name: Cache Cargo registry
46+
uses: actions/cache@v4
47+
with:
48+
path: |
49+
~/.cargo/registry/index
50+
~/.cargo/registry/cache
51+
~/.cargo/git/db
52+
~/.cargo/git/checkouts
53+
key: ${{ runner.os }}-cargo-registry-msrv-${{ matrix.rust }}-${{ hashFiles('contract/Cargo.lock') }}
54+
restore-keys: |
55+
${{ runner.os }}-cargo-registry-msrv-${{ matrix.rust }}-
56+
${{ runner.os }}-cargo-registry-msrv-
57+
58+
- name: Cache Cargo target (MSRV)
59+
uses: actions/cache@v4
60+
with:
61+
path: contract/target
62+
key: ${{ runner.os }}-contract-target-msrv-${{ matrix.rust }}-${{ hashFiles('contract/Cargo.lock') }}
63+
restore-keys: |
64+
${{ runner.os }}-contract-target-msrv-${{ matrix.rust }}-
65+
66+
# ── Toolchain ──────────────────────────────────────────────────────────
67+
# Install the exact MSRV toolchain. No Stellar CLI is installed here;
68+
# the test suite uses soroban-sdk testutils (pure Rust, no CLI needed).
69+
- name: Install Rust ${{ matrix.rust }}
70+
uses: dtolnay/rust-toolchain@master
71+
with:
72+
toolchain: ${{ matrix.rust }}
73+
74+
# Confirm the active toolchain matches what we requested.
75+
- name: Show toolchain info
76+
run: |
77+
rustc --version
78+
cargo --version
79+
working-directory: contract
80+
81+
# ── Verify declared MSRV matches installed toolchain ──────────────────
82+
# `cargo check` with --locked ensures the Cargo.lock is respected and
83+
# that the rust-version field in Cargo.toml is honoured.
84+
- name: Verify MSRV field is respected (cargo check)
85+
run: cargo check --locked --all-targets
86+
working-directory: contract
87+
88+
# ── Tests (no Stellar CLI, no network) ────────────────────────────────
89+
# Run the full test suite. soroban-sdk testutils are pure-Rust and do
90+
# not require the Stellar CLI or any external service.
91+
- name: Run contract tests on MSRV
92+
run: cargo test --locked --all-features 2>&1 | tee /tmp/msrv-test-output.txt
93+
working-directory: contract
94+
95+
# ── Step summary ──────────────────────────────────────────────────────
96+
- name: Write step summary
97+
if: always()
98+
run: |
99+
echo "## Contract MSRV – Rust ${{ matrix.rust }}" >> $GITHUB_STEP_SUMMARY
100+
echo "" >> $GITHUB_STEP_SUMMARY
101+
echo "| Check | Result |" >> $GITHUB_STEP_SUMMARY
102+
echo "|-------|--------|" >> $GITHUB_STEP_SUMMARY
103+
if cargo check --locked --all-targets 2>/dev/null; then
104+
echo "| \`cargo check\` | ✅ |" >> $GITHUB_STEP_SUMMARY
105+
else
106+
echo "| \`cargo check\` | ❌ |" >> $GITHUB_STEP_SUMMARY
107+
fi
108+
echo "" >> $GITHUB_STEP_SUMMARY
109+
echo "### Test output (last 30 lines)" >> $GITHUB_STEP_SUMMARY
110+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
111+
tail -30 /tmp/msrv-test-output.txt 2>/dev/null || echo "(no output captured)" >> $GITHUB_STEP_SUMMARY
112+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
113+
working-directory: contract

0 commit comments

Comments
 (0)