Temple of the Moon - Development Log
Chronological log of development work on templeofthemoonbooks.com.
2026-01-31 - Category System & Shipping
Category Pages (PHYSICAL Tags)
Added master product category system for page population:
| Category | Emoji | Route |
|---|---|---|
| Candle | ๐ฏ๏ธ | /category/candle |
| Incense | ๐ฟ | /category/incense |
| Oil | ๐ซ | /category/oil |
| Herb | ๐ฑ | /category/herb |
| Crystal | ๐ | /category/crystal |
| Stone | ๐ชจ | /category/stone |
| Amulet | ๐งฟ | /category/amulet |
| Book | ๐ | /category/book |
| Tarot | ๐ด | /category/tarot |
| Tool | โ๏ธ | /category/tool |
| Jewelry | ๐ | /category/jewelry |
| Statue | ๐ฟ | /category/statue |
| Clothing | ๐ | /category/clothing |
Features:
/categoryindex page with all categories and counts/category/[slug]dynamic route- Sidebar navigation between categories
- Product cards with correspondence tags
Redirects Added:
/candlesโ/category/candle/booksโ/category/book/amuletsโ/category/amulet- (And 17 more common variants)
Shipping Estimation
Added weight-based shipping calculator to cart:
Schema Change:
weight Decimal? @db.Decimal(6, 3) // Weight in lbsShipping Options:
| Method | Carrier | Days | Notes |
|---|---|---|---|
| Local Delivery | TOTM | 1-3 | FREE for KC Metro |
| First Class | USPS | 3-5 | Packages under 13oz |
| Priority Mail | USPS | 2-3 | Flat rate options |
| Ground Advantage | USPS | 5-7 | Economy option |
KC Metro Coverage: ~100 ZIP codes covering:
- KCMO (64xxx)
- Independence, Blue Springs, Leeโs Summit
- Overland Park, Olathe, Shawnee, Lenexa (66xxx)
Cart Features:
- ZIP code input with real-time rate calculation
- Package weight display
- Multiple shipping options with radio selection
- Auto-selects cheapest option
Product Page Updates
- New
AddToCartButtoncomponent with quantity selector - Weight passed to cart context
- โBrowse all [Category]โ link on product pages
- PHYSICAL tags separated from magical correspondences
Commits
| Hash | Message |
|---|---|
acefa23 | Add PHYSICAL category tags and category pages |
240959b | Add shipping estimation to cart with weight tracking |
6c089aa | Add collapsible filter sections on shop page |
2026-01-31 (Later) - Filters & More Products
Collapsible Shop Filters
- Created
FilterSectionclient component - Category filter defaults to open
- Planet, Element, Intent filters collapsed
- Chevron animation on toggle
Product Expansion
Scraped and imported additional products:
- 20 Athames & Swords
- 20 Statues (deities, gargoyles)
- Total: 77 products now in DB
Auto-tagged:
- 61 products tagged
- 16 skipped (deity names not in correspondences)
2026-01-31 (Morning) - Order System & Admin Dashboard
PayPal Integration โ
Full PayPal REST API v2 integration:
Library: src/lib/paypal.ts
createPayPalOrder()- initiate checkoutcapturePayPalOrder()- capture after approvalgetPayPalOrder()- fetch order detailsrefundPayPalCapture()- process refunds
Env Vars Needed:
PAYPAL_CLIENT_ID=your_client_id
PAYPAL_CLIENT_SECRET=your_client_secret
PAYPAL_MODE=sandbox # or live
NEXT_PUBLIC_BASE_URL=http://localhost:3000Internal PO System โ
Auto-generated PO numbers for all orders:
| Order Type | Format | Example |
|---|---|---|
| Customer Order | TOTM-YYYY-NNNNN | TOTM-2026-00001 |
| Supplier PO | AG-YYYY-NNNNN | AG-2026-00001 |
Counter Tables:
POCounter- customer order sequenceSupplierPOCounter- supplier order sequence
Order Status Flow
PENDING โ PAID โ PROCESSING โ SHIPPED โ DELIVERED
โ
BACKORDERED (local delivery + AG items)
โ
PROCESSING (when AG order received)
Fulfillment Logic:
- In-House items: Ship immediately
- Azure Green + Shipping: Drop-ship to customer
- Azure Green + Local Delivery: BACKORDERED until AG shipment arrives
Supplier Order System โ
Batch Azure Green orders into daily POs:
Flow:
- Customer orders come in (paid)
- AG items sit as
PENDINGfulfillment - Run daily PO generation โ batch into one supplier PO
- Supplier PO tracks:
DRAFTโPENDINGโORDEREDโSHIPPEDโRECEIVED - Customer order items auto-update as supplier PO progresses
API Endpoints:
| Endpoint | Method | Purpose |
|---|---|---|
/api/orders | GET | List customer orders |
/api/orders | POST | Create order + PayPal checkout |
/api/orders/[id] | GET | Single order details |
/api/orders/[id] | PATCH | Update status/tracking |
/api/paypal/capture | POST | Capture payment |
/api/supplier-orders | GET | List supplier POs |
/api/supplier-orders/generate | GET | Preview unfulfilled items |
/api/supplier-orders/generate | POST | Create batch PO |
/api/supplier-orders/[id] | GET | Supplier PO details |
/api/supplier-orders/[id] | PATCH | Update supplier PO |
CLI Script:
npx ts-node scripts/generate-daily-po.ts # Create order
npx ts-node scripts/generate-daily-po.ts --dry-run # PreviewAdmin Dashboard โ
New admin area at /admin:
| Page | Route | Features |
|---|---|---|
| Dashboard | /admin/dashboard | Stats, quick actions |
| Orders | /admin/orders | List, filter by status |
| Supplier POs | /admin/supplier-orders | List, status tracking |
| Generate PO | /admin/supplier-orders/generate | Batch AG order creation |
| Inventory | /admin/inventory | Products, stock levels |
Order List Features:
- Filter by status (PENDING, PAID, BACKORDERED, etc.)
- Shows source mix (In-House vs Azure Green)
- Local delivery vs shipping indicator
- Pagination
Inventory Features:
- Filter by source (In-House, Azure Green)
- Filter by stock level (Low, Out)
- Stock counts for in-house items
- Correspondence tag preview
Schema Updates
Order Model Additions:
poNumber String @unique
paymentMethod PaymentMethod?
paypalOrderId String?
paypalCaptureId String?
paypalPayerId String?
trackingNumber String?
trackingCarrier String?
shippedAt DateTime?
deliveredAt DateTime?
internalNotes String?New Models:
OrderStatusHistory- audit trailSupplierOrder- batch POs to Azure GreenSupplierOrderItem- line itemsCustomerOrderItemLink- links customer items to supplier itemsSupplierOrderHistory- supplier PO audit trailPOCounter/SupplierPOCounter- sequence generators
New Enums:
PaymentMethod- PAYPAL, STRIPE, CASH, CHECKFulfillmentStatus- PENDING, ALLOCATED, BACKORDERED, SHIPPED, RECEIVED, FULFILLEDSupplierOrderStatus- DRAFT โ RECEIVED flow
Product Count
Current: 132 products in database
- Voodoo: 20
- Scrying: 16
- Salts: 20
- Athames: 20
- Statues: 20
- Amulets: ~20
- Others: ~16
2026-01-31 (Afternoon) - Community Page & Blog System
Community Page โ
Rebranded โJournalโ to โCommunityโ โ a blog/content hub for guerrilla marketing.
URL: https://templeofthemoonbooks.com/community
Features:
- Hero section with search bar
- Pinned posts displayed prominently at top
- Regular posts in responsive grid
- Full-text search across title, content, excerpt
- Social sharing (X/Twitter, Facebook)
- Related posts on individual post pages
- SEO metadata per post
Post Schema
model Post {
id String @id @default(cuid())
title String
slug String @unique
content String @db.Text
excerpt String? @db.Text
featuredImage String?
published Boolean @default(false)
pinned Boolean @default(false) // NEW
publishedAt DateTime?
metaTitle String? // NEW - SEO
metaDescription String? // NEW - SEO
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}Admin Posts Management โ
Routes:
| Route | Purpose |
|---|---|
/admin/posts | List all posts with actions |
/admin/posts/new | Create new post |
/admin/posts/[id] | Edit existing post |
Actions (one-click):
- ๐ Pin/Unpin post
- ๐๏ธ Publish/Unpublish
- โ๏ธ Edit
- ๐๏ธ Delete
Post Editor:
- Title with auto-slug generation
- Excerpt for previews/SEO
- Featured image URL
- HTML content area
- Pin to top checkbox
- Collapsible SEO settings (meta title, description)
- Save Draft / Publish buttons
API Endpoints
| Endpoint | Methods |
|---|---|
/api/admin/posts | GET (list), POST (create) |
/api/admin/posts/[id] | GET, PATCH, DELETE |
Welcome Post โ
Created and pinned inaugural community post:
- Title: โWelcome to Temple of the Moon Booksโ
- Slug:
welcome-to-temple-of-the-moon - Content: Who we are, what we offer, philosophy, community vision
- Pinned: Yes
- Published: Yes
Navigation Updates
- Header: โJournalโ โ โCommunityโ (
/community) - Footer: Updated link and label
- Admin sidebar: Added โCommunity Postsโ link
Purpose
Community page serves as content marketing engine for first 90 days:
- Build brand story and trust
- SEO content for organic traffic
- Announcements and promotions
- Educational content (correspondences, rituals, etc.)
- Customer engagement
Next Steps
- PayPal credentials configuration (sandbox โ live)
- Customer checkout UI flow
- Order confirmation emails
- Supplier order printable summary (for AG phone orders)
- Inventory adjustment UI (stock in/out)
- More product scraping (books especially)
- Community content calendar (first 90 days)
- Category hero images
- Featured product carousel on homepage