How b-onlynify/onlynify-ui-site works
Onlynify UI is a Next.js storefront and server-side source service for a multi-framework UI kit. Visitors browse component and block demos, preview themes and sites, and convert registry markup into framework code; paid capabilities add Pro components, site templates, saved themes, and licence-gated downloads for the CLI. Accounts and checkout issue licences that gate premium source. The graph emphasizes documented workflows and relationships visible in the provided excerpts or SOURCE INDEX; unsampled page implementations and some feature wiring are represented only where the README documents them.
Main entry points: [slug]/route.ts CLI Registry API · [slug]/route.ts Pro Source API · checkout/route.ts Checkout and Webhooks · theme.ts Theme Engine
Components 23
Kit Catalog
- Catalog and Galleries
src/app/blocks/page.tsx - Component Registry
src/lib/registry.ts - Framework Converter
src/lib/convert.ts - Block Source
src/lib/block-source.ts - Live Previews
src/app/preview/[slug]/route.ts - Pro Components
src/lib/pro-components.ts
Themes and Sites
- Theme Builder
src/app/themes/builder.tsx - Theme Engine
src/lib/theme.ts - Saved Theme API
src/app/api/themes/route.ts - Site Gallery and Studio
src/app/sites/[slug]/studio.tsx - Site Assembly
src/lib/sites.ts
Accounts and Licensing
- Account Routes
src/app/api/auth/signup/route.ts - Sessions and Auth
src/lib/auth.ts - JSON Data Store
src/lib/store.ts - Checkout and Webhooks
src/app/api/checkout/route.ts - Licence Fulfilment
src/lib/payments.ts - Gateway Adapter
src/lib/gateway.ts
Source Delivery
- Site Source API
src/app/api/sites/[slug]/route.ts - Pro Source API
src/app/api/pro/[slug]/route.ts - CLI Registry API
src/app/api/registry/[slug]/route.ts
Other components
- Visitor
- Onlynify CLI
- Payment Gateway
Connections 37
- Visitor → Catalog and Galleries: browses
- Catalog and Galleries → Component Registry: shows catalog
- Visitor → Live Previews: opens preview
- Live Previews → Block Source: loads markup
src/app/preview/[slug]/route.ts - Block Source → Component Registry: reads block
src/lib/block-source.ts - Visitor → Theme Builder: customizes theme
- Theme Builder → Theme Engine: validates and encodes
- Visitor → Site Gallery and Studio: browses and configures
- Site Gallery and Studio → Site Assembly: previews variations
- Site Assembly → Theme Engine: applies theme
src/lib/sites.ts - Visitor → Saved Theme API: saves theme
- Saved Theme API → Theme Engine: normalizes theme
src/app/api/themes/route.ts - Saved Theme API → JSON Data Store: reads and writes
src/app/api/themes/route.ts - Visitor → Account Routes: creates account
- Account Routes → Sessions and Auth: creates session
src/app/api/auth/signup/route.ts - Sessions and Auth → JSON Data Store: reads and writes
src/lib/auth.ts - Visitor → Checkout and Webhooks: starts purchase
- Checkout and Webhooks → Licence Fulfilment: creates order
src/app/api/checkout/route.ts - Licence Fulfilment → Gateway Adapter: creates gateway order
src/lib/payments.ts - Gateway Adapter → Payment Gateway: requests payment
- Payment Gateway → Checkout and Webhooks: returns payment result
- Licence Fulfilment → JSON Data Store: fulfils and records
src/lib/payments.ts - Visitor → Pro Source API: requests Pro source
- Pro Source API → Pro Components: gets component files
src/app/api/pro/[slug]/route.ts - Pro Source API → Framework Converter: selects framework
src/app/api/pro/[slug]/route.ts - Pro Source API → Theme Engine: applies theme
src/app/api/pro/[slug]/route.ts - Visitor → Site Source API: requests site source
- Site Source API → Site Assembly: assembles files
src/app/api/sites/[slug]/route.ts - Site Source API → Theme Engine: decodes theme
src/app/api/sites/[slug]/route.ts - Onlynify CLI → CLI Registry API: requests block source
- CLI Registry API → Block Source: gets block files
src/app/api/registry/[slug]/route.ts - CLI Registry API → Site Source API: forwards site request
src/app/api/registry/[slug]/route.ts - CLI Registry API → Pro Source API: forwards Pro request
src/app/api/registry/[slug]/route.ts - CLI Registry API → Framework Converter: validates framework
src/app/api/registry/[slug]/route.ts - CLI Registry API → Licence Fulfilment: checks licence
src/app/api/registry/[slug]/route.ts - Checkout and Webhooks → Gateway Adapter: verifies checkout
- Payment Gateway → Checkout and Webhooks: sends webhook