Prerequisites
Before you begin, ensure you have:- Node.js 18+ or Bun installed
- A Google AI API key from Google AI Studio
Installation
Install dependencies
Install the required packages using Bun or npm:The project uses these core dependencies:
astro(v5.17.1) — Framework with SSR support@astrojs/vercel(v9.0.4) — Vercel adapter for deployment@google/genai(v1.42.0) — Google Gemini AI SDK
Configure environment variables
Create a
.env file in the root directory and add your Google Gemini API key:.env
Get your free API key from Google AI Studio. The application will not function without this key.
Start the development server
Run the development server:The application will start at
http://localhost:4321 by default.Make your first consultation
Open your browser and navigate to
http://localhost:4321. You’ll see:- A form requesting your name and question
- After submitting, three cards will flip to reveal your reading
- The AI will generate a personalized interpretation
You’re limited to 5 consultations per day. This limit is stored in
localStorage and resets after 24 hours.Available scripts
Thepackage.json includes these scripts:
package.json
dev— Start the development server with hot reloadbuild— Build the application for productionpreview— Preview the production build locally
Troubleshooting
API key not configured
If you see an error aboutGEMINI_API_KEY, ensure:
- Your
.envfile exists in the root directory - The variable is named exactly
GEMINI_API_KEY - You’ve restarted the development server after creating the
.envfile
Rate limit errors (429)
The application automatically falls back between these Gemini models:gemini-2.5-flash(primary)gemini-2.0-flash(fallback)gemini-2.0-flash-lite(final fallback)
Client-side consultation limit
If you’ve reached the 5-consultation daily limit:- Wait 24 hours for the limit to reset
- Or clear your browser’s
localStoragefor the site - The limit is tracked using the key
tarot_usage
Next steps
How it works
Understand the application flow and card drawing mechanism
View live demo
See the production version in action