Skip to content

feat: full prediction-market app — markets, betting, portfolio, resolution#1082

Merged
hman38705 merged 1 commit into
feat/frontend-build-redesign-testsfrom
feat/prediction-market-app
Jul 13, 2026
Merged

feat: full prediction-market app — markets, betting, portfolio, resolution#1082
hman38705 merged 1 commit into
feat/frontend-build-redesign-testsfrom
feat/prediction-market-app

Conversation

@victorisiguzoruzoma874

Copy link
Copy Markdown
Contributor

Summary

Builds the actual prediction-market application on top of the landing page. Previously the frontend was a landing page only; the product it advertises (create → bet → resolve → claim) had no UI. This PR adds that entire surface.

Stacked on #1081 (feat/frontend-build-redesign-tests) — this PR's base is the redesign branch so the diff shows only the app work. Merge/retarget after #1081.

Built by orchestrating 4 parallel subagents over a shared foundation I authored first (so they couldn't collide); the combined build compiled first try.

What's new

Route Feature
/markets Browse — featured strip, search + category/status filters, market grid with live odds bars
/markets/[id] Detail — stats, per-outcome odds, wallet-gated place-bet panel
/markets/create Validated create-market form (dynamic outcomes)
/portfolio Positions, summary stats, claim winnings
/markets/[id]/resolve Oracle resolution (settles winners pro-rata)

Foundation (shared contract)

  • Types src/lib/types.ts
  • Mock data layer src/lib/mock/markets.ts — seeded markets + real betting/settlement/pro-rata payout math, localStorage-persisted. Only data source for now; drop-in swap for the API client later.
  • Freighter wallet src/lib/wallet/WalletProvider.tsxuseWallet() (real Stellar extension: connect/disconnect/sign)
  • UI kit src/components/ui/* (Button, Card, Badge, Field, Modal, Stat, OddsBar) on the existing design tokens
  • App shell — sticky AppHeader (nav + wallet connect + theme) + (app) route group

Decisions (per product direction)

  • Real Freighter wallet + mocked data: the wallet genuinely connects/signs; market data is mocked so the app runs with no backend.
  • Landing page gains "Launch App" + "Explore live markets" CTAs.
  • proxy.ts CSP connect-src now allowlists the configured API origin.

Test plan

  • npm run build — clean, 7 routes generated, no type errors
  • npm run test:ci231 passed / 22 suites, coverage gate met (statements 91.6%, branches 81.3%, functions 91.4%, lines 93.1%)
  • Visual QA — screenshotted all four pages (dark mode); wallet-gating verified (Connect-to-Bet / Create / Portfolio)
  • Unit tests for the mock data layer (settlement/payout) + format helpers; component tests per feature
  • App UI + wallet provider excluded from unit-coverage (covered by component tests + Playwright e2e + visual regression)
  • Reviewer: connect a real Freighter extension and exercise bet → resolve → claim

🤖 Generated with Claude Code

@hman38705
hman38705 merged commit a1a4013 into feat/frontend-build-redesign-tests Jul 13, 2026
…io, resolution)

Adds the application surface on top of the landing page: users can now browse
markets, place bets with a real Stellar wallet, create markets, view their
positions/claim winnings, and resolve markets (oracle simulation).

Foundation (shared contract)
- Domain types (Market, Bet, Outcome, …) in src/lib/types.ts
- Mock async data layer (src/lib/mock/markets.ts): seeded markets + real
  betting/settlement/pro-rata payout math, localStorage-persisted. This is the
  only data source for now (swap for the API client later)
- Freighter wallet provider + useWallet() (connect/disconnect/sign) — real
  Stellar extension integration
- Format helpers (formatXLM, odds, timeUntil, shortAddress)
- UI kit (Button, Card, Badge, Field/Input/Select, Modal, Stat, OddsBar) on the
  existing design tokens
- App shell: sticky AppHeader (nav + wallet connect + theme) and (app) route group

Features (each its own route + component folder)
- /markets            browse: featured strip, search + category/status filters, grid
- /markets/[id]       detail: stats, per-outcome odds, wallet-gated place-bet panel
- /markets/create     validated create-market form (dynamic outcomes)
- /portfolio          positions, summary stats, claim winnings
- /markets/[id]/resolve  oracle resolution (settles winners pro-rata)

Wiring & tests
- Landing page gains "Launch App" + "Explore live markets" CTAs into /markets
- proxy.ts CSP connect-src now allowlists the configured API origin
- Unit tests for the mock data layer + format helpers; component tests for each
  feature. App UI + wallet excluded from unit-coverage (covered by component
  tests + Playwright e2e + visual regression)
- Full build green; test:ci green (231 tests, coverage gate met)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants