Skip to Content
🚀 Fund the work, merge the proof, release the reward. Learn more →
Product architecture

Product architecture

This page turns the frontend and backend project guides into one system-level map. Use it when you need to understand which part owns an action, where state lives, or why a payout is waiting.

Media placeholder · imageAdd screenshot or diagramarchitecture-system-map
Capture: A five-lane architecture diagram: browser, Axum API, PostgreSQL and Redis, GitHub, and Trustless Work/Stellar. Include Resend and object storage as side services. — Replace this placeholder with the final system architecture diagram.

System at a glance

LayerOwns
Next.js frontendSupabase session, dashboard views, wallet selection/signing, forms, and status feedback
Rust/Axum backendAuthorization, repository and bounty rules, OpenAPI routes, orchestration, and durable business decisions
GitHub AppRepository installation, labels, assignments, issues, comments, pull-request events, and merge evidence
PostgreSQLDurable profiles, repositories, rewards, bounties, notifications, and escrow metadata
Redis + BullMQCaching, rate limits, deduplication, coalescing, and retryable background work
Trustless Work + StellarEscrow deployment, funding, milestones, disputes, refunds, and final USDC settlement

The guarded payout path

1
Reserve
A rewarded issue plus a configured tier reserves the amount from the repository’s available escrow pool.
2
Assign
GitHub assignment identifies the only contributor eligible for this bounty.
3
Prepare
A valid payout wallet lets the worker push or refresh the on-chain milestone. Missing wallet data parks the bounty safely.
4
Prove
A merged PR must contain a closing reference and be authored by the assigned contributor.
5
Re-check
Before releasing funds, the worker reloads database, GitHub, wallet, and on-chain state. A webhook alone never authorizes payment.
6
Settle
If receiver, amount, merge, issue, and milestone state all agree, the escrow releases USDC and the local record is updated.

Frontend responsibility boundaries

The browser never handles a private key. For deploy and fund operations, it requests an unsigned Stellar XDR from the backend, asks the selected wallet to sign it, and submits only the signed XDR. Supported wallet modules include Freighter, xBull, Albedo, LOBSTR, and Rabet. Cross-chain destinations shown in product presentation are coming soon, not currently implemented settlement paths.

Failure is a state, not a guess

  • A missing wallet parks work and resumes it after connection.
  • Temporary integration failures retry with exponential backoff.
  • Stable queue identifiers and locks prevent duplicate concurrent actions.
  • If the chain already shows a release, the worker repairs stale local state instead of paying again.
  • Unsafe receiver, amount, author, or issue state blocks payout without moving funds.

The source guides remain in docs/PROJECT_GUIDE_Frontend.md and docs/PROJECT_GUIDE_Backend.md. This page is the reader-friendly system overview; the source files remain the detailed code-derived reference.

Next: API & operations

Last updated on