A tarot reading application that combines interactive tarot card selection with AI-generated readings using Meta's Llama-3.3-70B-Instruct-Turbo model via Together.ai.
- Interactive chat interface to ask questions
- AI automatically determines the appropriate spread (1, 2, or 3 cards)
- Interactive card shuffling and selection animation
- AI-powered tarot readings generated using Together.ai and Llama-3.3-70B-Instruct-Turbo
- Secure server-side API key handling for Vercel deployment
- Post-reading experience with options to download or generate a new reading
- Internationalization support (English and Polish)
- Shareable reading results
- Reading history and retrieval
- The user enters a question or topic they want insight on
- Based on the query, the app determines the most appropriate spread (single card, two-card, or three-card)
- The user selects cards from the deck
- The app sends the query and selected cards to the server-side API endpoint
- The server securely calls the Llama-3.3-70B-Instruct-Turbo model via Together.ai using the stored API key
- The AI generates a personalized, detailed tarot reading based on the selected cards and the original query
- Users can share their reading results via a unique URL
src/components/- React componentsTarotChat.js- Main chat interfaceTarotDeck.js- Card deck and selection animationTarotSummary.js- Summary of readings
src/data/- Data filescards.js- Tarot card definitions and spread logicicebreakers.js- Suggested questions for users
src/services/- API and external service integrationapi.js- Client-side API service that calls the server endpoint
src/app/- Next.js app structure[locale]/- Internationalization routingapi/tarotReading/- Server-side endpoint that securely calls Together.ai APIapi/fetchReading/- Endpoint for retrieving saved readingsapi/tarotShare/- Endpoint for sharing readingsapi/tarotSummary/- Endpoint for generating reading summaries
src/i18n/- Internationalization configurationsrc/locales/- Translation files for different languages
-
Get a Together.ai API key:
- Sign up at Together.ai
- Create an API key in your account dashboard
-
Clone the repository and install dependencies:
git clone <repository-url> cd mystic-ai npm install -
For local development, you can use a
.env.localfile:BLOB_READ_WRITE_TOKEN=<your vercel blob write token here> NEXT_PUBLIC_POSTHOG_HOST=<your posthog host here> NEXT_PUBLIC_POSTHOG_KEY=<your posthog key here> TOGETHER_AI_API_KEY=<your together ai api key here> -
Start the development server:
npm run dev -
Open http://localhost:3000 to view it in your browser.
- Type your question in the chat input
- Select cards from the deck when prompted
- Receive your AI-generated tarot reading!
- Download your reading, share it, or generate a new one
- Model Used: Meta's Llama-3.3-70B-Instruct-Turbo
- API Provider: Together.ai
- Framework: Next.js 15
- API Integration: AI SDK for stream handling
- Streaming: Real-time response streaming with word-level chunking
- Internationalization: next-intl with support for English and Polish
- Analytics: PostHog integration for usage tracking
- Add more tarot card deck options and spreads
- Improve animations and user experience
- Implement user accounts to save reading history
- Add more AI model options
- Expand language support
This app is designed to be deployed on Vercel with server-side API handling.
When deploying to Vercel, add the following environment variable:
TOGETHER_AI_API_KEY: Your Together.ai API keyBLOB_READ_WRITE_TOKEN: Your Vercel Blob Storage Write TokenNEXT_PUBLIC_POSTHOG_HOST: Your PostHog HostNEXT_PUBLIC_POSTHOG_KEY=: Your PostHog Public Key
The API key is securely stored on the server side and never exposed to the client browser. The API requests are proxied through a Next.js API route in the /app/api directory.