How nexez-ai/nexez works
Purpose and entry points
Nexez is a multi-surface commerce platform that turns seller offers into public pages, agent-readable artifacts, and approval-gated transaction workflows. The primary runtime is a Next.js App Router application: public listings at app/[slug]/page.tsx, seller operations under app/dashboard/page.tsx, and HTTP/protocol endpoints under app/api. A separate Expo seller app begins at apps/seller-mobile/app/_layout.tsx.
Public publishing and discovery
Published listings are rendered for people and projected into scoped machine artifacts: app/[slug]/agent.json/route.ts, app/[slug]/mcp/route.ts, and app/[slug]/openapi.json/route.ts. Platform-wide discovery is exposed through app/.well-known/agent.json/route.ts, app/agent-pages.json/route.ts, and app/api/agent-search/route.ts. This is a deliberate public boundary: only publishable projections should cross it; drafts, credentials, and private seller state remain server/data-layer concerns.
Seller authoring and operational control
The dashboard manages pages, offers, templates, integrations, analytics, billing, negotiations, and orders, centered on app/dashboard/[id]/page.tsx, app/dashboard/[id]/EditorClient.tsx, and components/editor/usePageEditor.ts. Domain logic separates offer configuration and business rules from UI in lib/configured-offer.ts, lib/offer-configuration.ts, and lib/offer-rules.ts. Admin-only operations are isolated under app/admin/layout.tsx and app/api/admin.
Agent protocols and Nexxi execution
Agent-facing access includes REST, MCP, A2A, ACP, and UCP. Core protocol implementations are lib/mcp-server.ts, lib/a2a/v1/runtime.ts, and lib/acp/wire.ts; routes include app/api/v1/a2a/route.ts, app/mcp/route.ts, and app/api/acp/checkout_sessions/route.ts. Nexxi is the stateful buyer-agent surface, with streaming, task, memory, preferences, and approval recovery logic in lib/agents/nexxi.ts, lib/agents/nexxi-stream.ts, and lib/agents/nexxi-commerce.ts. A2A has a durable task/event ledger rather than relying on request-local execution.
Commerce lifecycle and safety boundary
Checkout, negotiation, orders, reservations, agreements, and staged settlement are distinct consequential-action flows. Route entry points include app/api/checkout/route.ts, app/api/negotiations/route.ts, and app/api/orders/[id]/fulfillment/route.ts; core services include lib/checkout.ts, lib/negotiation.service.ts, and lib/settlement.ts. Approval binding, idempotency, request hashing, money constraints, and dry-run validation form the mutation boundary. Stripe webhooks and reconciliation close the loop through app/api/webhooks/stripe/route.ts, app/api/cron/reconcile-billing/route.ts, and lib/server/checkout-session-store.ts.
Data, identity, integrations, and async work
Supabase provides Auth, PostgreSQL, Storage, RLS, private secrets, and durable operational ledgers; schema and security contracts live in supabase/migrations, notably supabase/migrations/20260901030000_a2a_v1_durable_ledger.sql. Server access and authorization are concentrated in utils/supabase/server.ts, lib/server/request-auth.ts, and lib/server/require-page-access.ts. Stripe Connect/Billing, Shopify, Calendly, Acuity, Square, Google Calendar, Twilio, Vercel domains, and LLM providers are external boundaries. OAuth/import/sync routes are under app/api/integrations, webhooks under app/api/webhooks, and Inngest-backed async functions under lib/inngest/functions.
Secondary distribution surfaces and delivery
The Expo mobile seller client uses shared backend contracts via apps/seller-mobile/src/lib/api.ts and apps/seller-mobile/src/lib/supabase.ts. Buyer integrations are distributed as TypeScript/Python SDKs in sdk/typescript/src/index.ts and sdk/python/src/nexez_agent_sdk/__init__.py, plus OpenClaw, Shopify, and WordPress plugins in plugins. Deployment targets Vercel with cron endpoints; GitHub Actions includes CI, protocol interoperability, migration, canary, and release-certification workflows under .github/workflows.
Main entry points: migrations Supabase · configured-offer.ts Offer Domain Rules · mcp-server.ts Protocol Runtime · checkout.ts Mutation Safety Boundary
Components 21
User & Public Surfaces
- Public Listings · Human-facing published seller offers.
app/[slug]/page.tsx - Published Agent Artifacts · Scoped machine-readable projections of publishable listings.
app/[slug]/agent.json/route.ts - Platform Discovery · Platform-wide agent discovery and search boundary.
app/.well-known/agent.json/route.ts - Seller Dashboard · Seller operations for pages, offers, orders, and integrations.
app/dashboard/[id]/page.tsx - Page Editor
app/dashboard/[id]/EditorClient.tsx - Admin Operations · Isolated administrative surface.
app/admin/layout.tsx
Agent Protocols
- Protocol Runtime · Shared implementation of agent-facing protocols.
lib/mcp-server.ts - A2A Durable Ledger · Durable A2A task and event execution state.
supabase/migrations/20260901030000_a2a_v1_durable_ledger.sql - Nexxi Buyer Agent · Streaming buyer-agent execution with memory and approval recovery.
lib/agents/nexxi.ts
Commerce Control Plane
- Offer Domain Rules · Offer configuration and business-rule boundary.
lib/configured-offer.ts - Commerce APIs · Checkout, negotiation, and fulfillment entry points.
app/api/checkout/route.ts - Mutation Safety Boundary · Binds approvals and enforces idempotency, hashes, money constraints, and dry runs.
lib/checkout.ts - Settlement Service · Staged settlement and reconciliation lifecycle.
lib/settlement.ts
Data & Operations
- Server Auth & Access · Server identity and page-access enforcement.
lib/server/request-auth.ts - Supabase · RLS-protected system of record, secrets, and operational ledgers.
supabase/migrations - Integration Sync · Third-party commerce and calendar integration boundary.
app/api/integrations - Stripe Reconciliation · Closes billing state through webhooks and reconciliation.
app/api/webhooks/stripe/route.ts - Async Workflows · Background processing for durable operations and sync.
lib/inngest/functions
Distribution
- Seller Mobile App · Mobile seller surface using shared backend contracts.
apps/seller-mobile/app/_layout.tsx - SDKs & Plugins · Buyer integrations distributed to external ecosystems.
sdk/typescript/src/index.ts - Deployment & Certification · Deployment, cron, interoperability, migration, and release workflows.
.github/workflows
Connections 22
- Seller Dashboard → Page Editor: edits
- Page Editor → Offer Domain Rules: configures
- Seller Dashboard → Server Auth & Access: authorizes through
- Server Auth & Access → Supabase: uses
- Offer Domain Rules → Supabase: persists offers
- Offer Domain Rules → Public Listings: publishes
- Offer Domain Rules → Published Agent Artifacts: projects
- Published Agent Artifacts → Platform Discovery: listed by
- Protocol Runtime → Published Agent Artifacts: serves protocol views
- Protocol Runtime → A2A Durable Ledger: records A2A tasks
- A2A Durable Ledger → Supabase: stored in
- Nexxi Buyer Agent → Protocol Runtime: executes via
- Nexxi Buyer Agent → Commerce APIs: initiates actions
- Commerce APIs → Mutation Safety Boundary: guards mutations
- Mutation Safety Boundary → Settlement Service: authorizes settlement
- Mutation Safety Boundary → Supabase: records lifecycle
- Stripe Reconciliation → Settlement Service: reconciles
- Integration Sync → Async Workflows: schedules sync
- Async Workflows → Supabase: updates
- Seller Mobile App → Server Auth & Access: uses backend contracts
- SDKs & Plugins → Protocol Runtime: consume
- Deployment & Certification → Async Workflows: runs scheduled work