Back to project docs
Prediction market platformDocumentation archive

Freedom Market

Freedom Market is documented here as an architecture and delivery record instead of a full live deployment. The page gives prospects enough context to understand the product surface, technical choices, and completed work without requiring the full monorepo, database, chain services, and worker stack to be running publicly.

Repository shape

Monorepo with fm-frontend, backend, ws-gateway, blockchain-listener, and shared packages

Portfolio deploy policy

Do not deploy the heavy application stack for portfolio proof. Publish the architecture, screenshots, work log, and selected implementation notes as static SFreedom documentation.

Highlights

Prediction-market frontend with market discovery, detail pages, activity charts, live bets, and portfolio-oriented UI.
NestJS backend surface for markets, orders, auth, portfolio data, and integration boundaries.
Blockchain listener and worker processes isolated from frontend presentation.
Shared package model for entities, common types, migrations, and cross-app contracts.
Documented roadmap for CLOB-style order matching, orderbook pricing, and market-maker automation.

Separated app and worker architecture

The project is best explained as cooperating services rather than a single website. The frontend can be shown statically, while the backend, listener, realtime gateway, and chain integrations remain documented as architectural units.

fm-frontend

Next.js user interface for market browsing, order interaction, portfolio views, onboarding, charts, and wallet-auth flows.

  • Uses React 19, Next.js 15, Tailwind, Recharts, Privy, Wagmi, Viem, and React Query.
  • Can be represented in SFreedom as screens, flows, and annotated UI states instead of a live trading app.
  • Owns browser-facing API calls and portfolio/market presentation.

backend

NestJS API layer for application state, market endpoints, authentication, persistence, and business rules.

  • Keeps DTOs, controllers, services, migrations, seeds, and OpenAPI-style API boundaries in one backend app.
  • Connects to shared packages for entities, enums, and common contracts.
  • Can be documented through endpoint maps, request examples, and behavior notes.

blockchain-listener

Worker-style NestJS app for chain-aware automation, settlement-related jobs, and async market operations.

  • Runs separately from the user-facing API.
  • Contains worker modules that should be documented as process flows and job responsibilities.
  • Keeps heavy chain/runtime behavior out of the public SFreedom deployment.

ws-gateway

Realtime gateway boundary for live market events and user-facing updates.

  • Presented as a realtime architecture component, not a static route.
  • Can be documented with event names, producer/consumer flows, and retry expectations.

packages/common

Shared contracts, database entities, enums, and reusable infrastructure code across apps.

  • Documents how backend apps stay consistent without copy-pasted types.
  • Useful as the source of truth for diagrams and implementation notes.

Delivered work

Frontend work record

  • Market listing, detail, portfolio, profile, and onboarding surfaces.
  • Reusable market widgets: activity chart, live-bets feed, trade panels, price bars, and layout shell.
  • Wallet/auth UI integration patterns for Privy, Wagmi, and Viem.
  • Static documentation-ready screenshots and page descriptions can replace the need for public app hosting.

Backend and platform work record

  • NestJS API app with modular prediction-market, authentication, seed, and data-service boundaries.
  • Shared database/entity package for cross-service contracts.
  • Worker/listener app split from request/response backend paths.
  • Production-oriented deploy artifacts and Caddy/Docker notes can be summarized rather than deployed.

Market engine roadmap

  • CLOB-style design notes for order statuses, denormalized orderbook columns, and partial fills.
  • Plan for bid/ask spread, midpoint pricing, VWAP-style execution estimates, and market-maker services.
  • Clear separation between current app state and planned matching-engine improvements.

Modules and demo strategy

Market discovery

Shows available prediction markets and the core product proposition.

  • Best represented by static screenshots and annotated UI flows.
  • Does not need live chain services to explain the work.

Order and portfolio flows

Explains how users move from wallet/session context into market actions and position views.

  • Document request/response shapes, UI states, loading states, and fallback states.
  • Keep financial execution details separate from frontend display notes.

Worker automation

Captures background processing, listeners, and market automation as diagrams.

  • Document as process flow and responsibility boundaries.
  • Avoid deploying private worker infrastructure just for portfolio review.

Frontend documentation format

Recommended portfolio format

Static overview page with architecture diagram and app boundaries.
Screen gallery for frontend work with captions and implementation notes.
Backend section listing core endpoints, worker jobs, and data contracts.
Roadmap section for planned engine upgrades, separated from shipped work.