Skip to content

Admin Panel

The admin panel is an English-only back-office accessible at /admin/. Only users with the ADMIN role can access it.

Accessing Admin

  1. Seed an admin account by setting ADMIN_EMAIL and ADMIN_PASSWORD in .env
  2. Run npx prisma db seed (or pnpm seed:one for individual seeds)
  3. Sign in with the admin credentials
  4. Navigate to /admin

Sections

Dashboard (/admin)

Overview page with key metrics and quick links.

App Management (/admin/app/)

Readings

  • View all readings with filters (status, guest/user, spread type)
  • Inspect individual readings: question, cards, AI output, chat messages
  • View AI API call metrics (tokens, duration, model used)
  • Guest readings filter showing token/IP information
  • "Reset Daily Limit" action for testing

Users

  • User listing with search and filters
  • View user details: profile, subscription, credit balance, reading history
  • Credit history and transaction log
  • System-level user management (ban, impersonate)

Feedback

  • Review user feedback submissions
  • Filter by status: Pending, Reviewed, Resolved, and by mood
  • View attached screenshots
  • Add admin notes
  • Update feedback status

Insights

AI-powered analysis of user question patterns (admin-triggered):

  • Run a new analysis to sample recent user questions
  • View category distribution (Love, Career, Healing, Decision, etc.)
  • Explore top keywords per category
  • Word cloud visualization
  • Monthly trend data
  • AI-generated summary and recommended action items

AI Performance

  • Monitor AI API call latency, token usage, and error rates per call type
  • Useful for detecting model degradation or cost spikes

Leaderboard

Top users ranked by reading count.

Card Skins

Manage the card skin catalog: add, edit, or deactivate skins.

Tarot Content

Manage the core tarot content:

  • Readers — AI reader personas (name, bio, system prompt, pricing)
  • Spreads — Spread definitions and position metadata
  • Cards — 78-card deck content
  • Question Categories — Categories with icons and sort order
  • Questions — Individual questions per category

Guests

View guest (anonymous) reading activity.

Credit Reconciliation

Tools for auditing and correcting credit balance discrepancies.

Blog CMS (/admin/blog/)

Posts

  • Create, edit, and manage blog posts
  • Rich text editor for localized content
  • Draft/published/scheduled/archived states
  • Featured post toggle
  • Category and tag assignment
  • SEO metadata (title, description, keywords) per locale

Categories

  • Create and manage blog categories
  • Localized category names
  • Sort order control

Tags

  • Create and manage blog tags
  • Localized tag names

Authors

  • Create and manage author profiles
  • Localized bios
  • Avatar uploads

System (/admin/system/)

System configuration and management tools.

Key Design Decisions

  • English-only — No useTrans in admin pages; all UI text is hardcoded in English
  • Sonner for toasts — Admin uses sonner directly (not @/lib/toast)
  • Server actions for mutations — Admin CRUD operations use Next.js server actions
  • Admin auth check — Route middleware verifies role === 'ADMIN' before rendering

Internal documentation for MysticX team