Files
sorsfonalak/services/frontend/src/app/kartyajoslas/[id]/page.tsx
T
fecoandClaude Opus 5.5 b0fc547b73
CI / test (push) Successful in 1m29s
CI / build (push) Successful in 5m52s
CI / deploy (push) Skipped
Tarot readings: AI-written, drawn on the server, sold as units
A new Kártyajóslás page: choose a spread (1, 3 or 5 cards), ask a
question, pick the cards from the fanned deck and watch them turn over;
the reading is written by the detailed-analysis model from the cards,
their positions and base meanings, the question and the reader's Sun,
Moon and Ascendant. The server shuffles and draws, so nobody can draw
again for free. A reading is a 'tarot' analysis (worker, retries,
fallback, refunds and admin regeneration as for analyses), uses one
'tarot' unit, and survives recalculations; deleting the account
deletes it.

Packages carry 2/5/10 readings, the new +5 kártyajóslás addon costs
1 000 Ft. The card artwork comes from the tarot design studio
(celestial astrolabe style); the deck JSON is shared by the frontend
and the prompt. A public example is at /kartyajoslas/pelda.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
2026-11-20 14:35:50 +00:00

36 lines
1.3 KiB
TypeScript

import type { Metadata } from "next";
import Link from "next/link";
import { notFound } from "next/navigation";
import { TarotLive } from "@/components/tarot/TarotLive";
import { backendGet, requireMe } from "@/lib/server";
import type { TarotReading } from "@/lib/tarot";
export const metadata: Metadata = { title: "Kártyajóslás" };
const day = (iso: string) =>
new Date(iso).toLocaleDateString("hu-HU", { timeZone: "Europe/Budapest", year: "numeric", month: "long", day: "numeric" });
/** One of the user's readings. */
export default async function TarotReadingPage({ params }: { params: Promise<{ id: string }> }) {
const { id } = await params;
const me = await requireMe(`/kartyajoslas/${id}`);
const reading = await backendGet<TarotReading>(`/v1/tarot/readings/${encodeURIComponent(id)}`);
if (!reading) notFound();
return (
<main className="page" style={{ maxWidth: 1040 }}>
<div className="page-head">
<Link href="/kartyajoslas" className="hint">
← Kártyajóslás
</Link>
<span className="eyebrow">
{reading.spread_name} · {day(reading.created_at)}
</span>
</div>
<section className="card">
<TarotLive key={reading.id} initial={reading} isAdmin={me.user.roles.includes("admin")} />
</section>
</main>
);
}