Temple of the Moon Books - Technical Specification

Stack Recommendation

Frontend

ComponentTechnologyRationale
FrameworkNext.js 14+React + SSR, great for SEO, Node.js based
StylingTailwind CSSRapid styling, easy theming (grey/purple palette)
AnimationsFramer MotionSmooth moon phase entrance animation
StateZustand or JotaiLightweight cart state management

Backend

ComponentTechnologyRationale
APINext.js API RoutesKeep it simple, same codebase
DatabasePostgreSQLRelational for complex tag queries
ORMPrismaType-safe, great DX
AuthNextAuth.jsIf user accounts needed

E-commerce

ComponentTechnologyRationale
PaymentsStripeIndustry standard, easy setup
CartCustom + ZustandCorrespondence-aware cart logic
InventoryCustom DBSync with Azure Green catalog

Infrastructure

ComponentTechnologyRationale
HostingVercel or RailwayEasy Next.js deployment
ImagesCloudflare Images or S3Product photography CDN
DomainAlready ownedtempleofthemoonbooks.com

Database Schema (Draft)

-- Products
CREATE TABLE products (
  id UUID PRIMARY KEY,
  name VARCHAR(255) NOT NULL,
  slug VARCHAR(255) UNIQUE NOT NULL,
  description TEXT,
  price DECIMAL(10,2) NOT NULL,
  sale_price DECIMAL(10,2),
  sku VARCHAR(100),
  source ENUM('inhouse', 'azuregreen') NOT NULL,
  azure_green_id VARCHAR(100),
  stock_quantity INT DEFAULT 0,
  featured BOOLEAN DEFAULT FALSE,
  created_at TIMESTAMP DEFAULT NOW(),
  updated_at TIMESTAMP DEFAULT NOW()
);
 
-- Correspondence Tags
CREATE TABLE tags (
  id UUID PRIMARY KEY,
  name VARCHAR(100) NOT NULL,
  slug VARCHAR(100) UNIQUE NOT NULL,
  category ENUM(
    'physical',      -- candle, book, incense, oil
    'color',         -- red, black, white
    'planet',        -- Mars, Venus, Saturn
    'element',       -- Fire, Water, Air, Earth
    'sephira',       -- Geburah, Netzach, etc
    'day',           -- Tuesday, Friday
    'metal',         -- Iron, Copper
    'number',        -- 5, 7, 3
    'intent',        -- protection, love, banishing
    'zodiac',        -- Aries, Scorpio
    'decan',         -- specific decans
    'herb',          -- associated herbs
    'stone'          -- associated stones
  ) NOT NULL,
  description TEXT,
  source VARCHAR(100)  -- "777:col6", "CMT:p42"
);
 
-- Product-Tag Junction
CREATE TABLE product_tags (
  product_id UUID REFERENCES products(id),
  tag_id UUID REFERENCES tags(id),
  PRIMARY KEY (product_id, tag_id)
);
 
-- Images
CREATE TABLE product_images (
  id UUID PRIMARY KEY,
  product_id UUID REFERENCES products(id),
  url VARCHAR(500) NOT NULL,
  alt_text VARCHAR(255),
  position INT DEFAULT 0
);
 
-- Blog Posts
CREATE TABLE posts (
  id UUID PRIMARY KEY,
  title VARCHAR(255) NOT NULL,
  slug VARCHAR(255) UNIQUE NOT NULL,
  content TEXT NOT NULL,
  excerpt TEXT,
  featured_image VARCHAR(500),
  published BOOLEAN DEFAULT FALSE,
  published_at TIMESTAMP,
  created_at TIMESTAMP DEFAULT NOW()
);
 
-- Orders (simplified)
CREATE TABLE orders (
  id UUID PRIMARY KEY,
  customer_email VARCHAR(255) NOT NULL,
  customer_name VARCHAR(255),
  shipping_address JSONB,
  is_local_delivery BOOLEAN DEFAULT FALSE,
  subtotal DECIMAL(10,2),
  shipping DECIMAL(10,2),
  total DECIMAL(10,2),
  status ENUM('pending', 'paid', 'shipped', 'delivered') DEFAULT 'pending',
  stripe_payment_id VARCHAR(255),
  created_at TIMESTAMP DEFAULT NOW()
);
 
CREATE TABLE order_items (
  id UUID PRIMARY KEY,
  order_id UUID REFERENCES orders(id),
  product_id UUID REFERENCES products(id),
  quantity INT NOT NULL,
  price_at_purchase DECIMAL(10,2) NOT NULL
);

Correspondence Tag Categories

From Liber 777 and Complete Magician’s Tables:

CategoryExamplesUse Case
PlanetSun, Moon, Mars, Mercury, Jupiter, Venus, SaturnCore filter
ElementFire, Water, Air, Earth, SpiritElemental workings
SephiraKether→MalkuthQabalistic practice
DaySunday→SaturdayTiming rituals
ColorRed, Blue, Black, White, PurpleVisual browsing
MetalGold, Silver, Iron, Copper, Tin, Lead, MercuryTool shopping
Number1-10, significant numbersNumerology
IntentLove, Protection, Banishing, Prosperity, HealingBeginner-friendly
Zodiac12 signsAstrological timing
PhysicalCandle, Incense, Oil, Book, Tool, Herb, StoneBasic categories

Moon Phase Animation Concept

Page Load:
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     β”‚
β”‚        πŸŒ‘          β”‚  ← Dark moon, centered
β”‚                     β”‚
β”‚  "Enter the Temple" β”‚  ← Subtle text prompt
β”‚                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

On click/tap (or auto after 2s):
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ β•±                 β•² β”‚
β”‚β•±   πŸŒ• (waxing)     β•²β”‚  ← Moon phases through
β”‚                     β”‚     new β†’ full
β”‚β•²   reveals page   β•± β”‚  ← Content fades in
β”‚ β•²               β•±   β”‚     as moon "opens"
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Result: Homepage revealed
- Moon settles into header as current phase indicator
- Smooth 1.5-2s animation
- Skip option for returning visitors (localStorage)

API Routes (Draft)

GET  /api/products              - List products (paginated, filtered)
GET  /api/products/:slug        - Single product
GET  /api/products/featured     - Featured items for carousel

GET  /api/tags                  - All tags (grouped by category)
GET  /api/tags/:category        - Tags in category
GET  /api/tags/:slug/products   - Products with tag

GET  /api/cart                  - Get cart (session-based)
POST /api/cart/add              - Add to cart
POST /api/cart/remove           - Remove from cart
POST /api/cart/build-ritual     - Auto-build from tag selection

POST /api/checkout              - Create Stripe session
POST /api/webhooks/stripe       - Handle payment confirmation

GET  /api/posts                 - Blog posts
GET  /api/posts/:slug           - Single post

GET  /api/moon                  - Current moon phase (for header)

Local Delivery Logic

// KC Metro ZIP codes for free local delivery
const KC_METRO_ZIPS = [
  // Missouri
  '64101', '64102', /* ... Kansas City MO core */
  '64110', '64111', '64112', '64113', /* ... Midtown/Plaza */
  '64114', '64145', '64146', /* ... South KC */
  // Kansas
  '66101', '66102', '66103', /* ... KCK */
  '66208', '66209', '66210', /* ... Overland Park */
  // ... expand as needed
];
 
function getShippingCost(zip, subtotal) {
  if (KC_METRO_ZIPS.includes(zip)) {
    return 0; // Free local delivery
  }
  // Standard shipping tiers
  if (subtotal >= 75) return 0;  // Free shipping over $75
  if (subtotal >= 35) return 5.99;
  return 8.99;
}

MVP Checklist

Phase 1: Foundation

  • Next.js project setup
  • PostgreSQL + Prisma schema
  • Tailwind theme (grey/purple palette)
  • Basic product model + admin seeding

Phase 2: Core Features

  • Product listing with tag filters
  • Product detail pages
  • Tag-based browsing
  • Shopping cart (Zustand)
  • Stripe checkout integration

Phase 3: Polish

  • Moon phase entrance animation
  • Featured carousel
  • Blog system
  • Local delivery ZIP detection
  • Mobile responsive pass

Phase 4: Content

  • Photograph book inventory
  • Import Azure Green catalog
  • Tag all products with correspondences
  • Write initial blog posts
  • SEO optimization