How variablevic/zion works
Project type and purpose
• This is a full-stack e-commerce storefront called “Zion” that layers AI-powered interactions onto a traditional shopping flow.
• The frontend is a Next.js App-Router application (“storefront” folder), and the backend is a Medusa commerce server (“medusa” folder).
• It uses AI (OpenAI via Vercel AI SDK), vector search (Upstash Vector), Redis state (Upstash Redis), and Supabase for storage.
File structure
• Top-level folders:
• medusa – the commerce engine, with core API routes, custom extensions, jobs, subscribers, modules, scripts, workflows, and integration tests.
• storefront – Next.js App Router layout, pages, serverless API routes, React components, hooks, context, and utility libraries.
• Key patterns:
• Medusa’s “src/api” and “src/modules” implement custom endpoints (generate-products, upsert-to-vector).
• Subscribers (event listeners) push data into the vector store or cleanup.
• Scripts and workflows in Medusa seed data and orchestrate vector upserts.
• Next.js “app/api/*” implements serverless routes for AI chat, canvas streaming, and product retrieval.
• The storefront uses a worker-based agent model under “lib/agent” for orchestrating AI tasks.
README for additional insights
• Confirms tech stack: Next.js App Router, Medusa, Vercel AI SDK, OpenAI, Upstash (Redis + Vector), Supabase.
• Describes core value: AI assistant drives UI generation, personalized recommendations, story-driven product displays, full cart & checkout via chat.