Skip to content

feat: backend health/IPFS/v1 routes, escrow funding UI, CI caching (issues #24 #25 #34 #41)#47

Merged
soomtochukwu merged 5 commits into
DXmakers:mainfrom
boys-cyberhub:feat/issues-24-25-34-41
Mar 28, 2026
Merged

feat: backend health/IPFS/v1 routes, escrow funding UI, CI caching (issues #24 #25 #34 #41)#47
soomtochukwu merged 5 commits into
DXmakers:mainfrom
boys-cyberhub:feat/issues-24-25-34-41

Conversation

@boys-cyberhub
Copy link
Copy Markdown
Contributor

Summary

Closes #24 · Closes #25 · Closes #34 · Closes #41

Issue #24 — Backend: Setup Rust Axum Project & DB Pooling

  • GET /api/health — pings the Postgres pool and returns { status, db } (acceptance criteria: healthy status with active DB connectivity)
  • All API routes restructured under /api/v1 prefix (/api/v1/jobs, /api/v1/disputes, /api/v1/appeals, /api/v1/users)
  • GET /api/v1/users stub route added (foundational; full auth profile system tracked separately)
  • Logging middleware already in place via TraceLayer

Issue #25 — Backend: Off-chain Storage & IPFS Integration

  • New backend/src/services/ipfs.rs — wraps Pinata's pinFileToIPFS REST API via reqwest, returns the CID
  • New POST /api/v1/uploads — accepts multipart/form-data, enforces 10 MiB cap and MIME-type allowlist (PDF, ZIP, JSON, plain text, PNG/JPEG/GIF/WebP)
  • PINATA_JWT env var required at runtime; unit tests stub it with a placeholder
  • Workspace Cargo.toml: enabled axum/multipart + reqwest/multipart features

Issue #34 — Frontend: Client Escrow Funding Interface

  • New page: apps/web/app/jobs/[id]/fund/page.tsx
  • Escrow Funding Summary card — line-item breakdown: contract value, 2% platform fee, total to deposit
  • Caution alert banner + mandatory confirmation checkbox before the CTA is enabled
  • Double-confirmation modal forces a final review before calling depositEscrow
  • Signing/polling overlay with spinner while the transaction is broadcast and confirmed on-chain (polls GET /api/v1/jobs/:id every 2 s, up to 60 s)
  • Post-success receipt view showing the tx hash and "Actively Funded" state
  • lib/api.ts: bumped all routes to /v1, added uploads.pin() helper

Issue #41 — CI/CD GitHub Actions Architecture

  • Separated into 7 discrete jobs: contracts-clippy, contracts-test, backend-clippy, backend-test, frontend-lint, frontend-build, e2e
  • Swatinem/rust-cache@v2 on every Rust job — preserves target/ across runs, keeps CI well under 5 min
  • actions/cache@v4 for Playwright browser binaries — avoids repeated playwright install
  • npm ci (deterministic lockfile install) replaces npm install in all frontend jobs
  • TypeScript tsc --noEmit step added to frontend-lint for type-level safety
  • E2E job needs: frontend-build so it only runs after the build passes

Test plan

  • cargo check -p backend — passes locally ✅
  • Visit /jobs/<id>/fund with a funded job — verify summary, modal, and signed tx flow
  • POST /api/v1/uploads with a valid PDF — confirm CID is returned
  • POST /api/v1/uploads with an .exe — confirm 400 rejection
  • GET /api/health — confirm { "status": "ok", "db": "connected" } with a live DB
  • Push a PR to verify all 7 CI jobs run in parallel and complete in < 5 min

🤖 Generated with Claude Code

Issue 24 — Backend Axum setup & DB pooling:
- Add /api/health endpoint that pings the Postgres pool
- Add /api/v1/users stub route
- Restructure all routes under /api/v1 prefix

Issue 25 — IPFS off-chain storage:
- Add services/ipfs.rs with Pinata API integration
- Add POST /api/v1/uploads multipart endpoint (10 MiB cap, MIME allowlist)
- Enable axum multipart + reqwest multipart features

Issue 34 — Client Escrow Funding Interface:
- Add apps/web/app/jobs/[id]/fund/page.tsx
- Funding summary modal with fee breakdown (2% platform fee)
- Double-confirmation modal + caution alert before wallet sign
- On-chain polling loop until job transitions to funded/in_progress
- Frontend api.ts: updated to v1 routes + uploads.pin helper

Issue 41 — CI/CD GitHub Actions:
- Separate jobs for contracts-clippy, contracts-test, backend-clippy,
  backend-test, frontend-lint, frontend-build, e2e
- Swatinem/rust-cache on every Rust job to preserve target/
- actions/cache for Playwright browsers
- npm ci (deterministic) instead of npm install
- TypeScript type-check step in frontend-lint job

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Mar 27, 2026

@boys-cyberhub Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Uchechukwu-Ekezie and others added 4 commits March 27, 2026 23:44
- backend/src/routes/uploads.rs: replace `while let` with `if let` to fix
  clippy::never_loop (the loop always returned on first iteration)
- apps/web/package-lock.json: regenerate to sync with package.json
  (was missing typescript and utf-8-validate entries)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
package-lock.json was generated with npm 11 (Node 24). CI was using
Node 20/npm 10 which rejected the lock file as out-of-sync.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…sion

root tsconfig.json has types:[node] but @types/node is only installed
in apps/web — tsc was picking up the wrong config from the repo root
@soomtochukwu soomtochukwu merged commit 3be0df6 into DXmakers:main Mar 28, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants