# Finqu Marketplace

> A marketplace for discovering, purchasing, and accessing applications, built as a headless storefront on top of the commerce platform.

## A headless storefront with its own application behind it

Marketplace is a Finqu headless storefront. Product, category, and digital-asset data come from the platform through Storefront GraphQL, so the catalogue remains a commerce concern rather than something the marketplace re-implements.

The customer-facing marketplace is a separate React and Next.js application with its own PostgreSQL database and purchase records. It also shows what a polished product built on the headless storefront capabilities can look like.

Payment is a separate boundary. Stripe processes it on the seller’s connected account; it does not run through the platform’s hosted checkout.

## Purchase and entitlement flow

1. **Discover**: Browse catalog data read through Storefront GraphQL.
2. **Purchase**: Complete payment through Stripe on the seller’s account.
3. **Record**: Persist the purchase and a transactional outbox event.
4. **Grant**: Propagate the entitlement to the connected platform.

## Keeping the purchase flow trustworthy

- Server-side price integrity rather than trusting browser values
- OAuth 2.0 with PKCE for user-facing authorization
- HMAC-protected service contracts
- Transactional outbox processing for reliable cross-system changes
- Layered unit, integration, and browser testing

## Technologies

- TypeScript
- React
- Next.js
- Storefront GraphQL
- Node.js
- PostgreSQL
- Stripe Connect
- OAuth 2.0
- Vitest
- Playwright
