An AI-powered contemplative dialogue application where users engage with a Zen master powered by Google Gemini. The master presents authentic teachings from classical Zen collections, then responds to user reflections with wisdom drawn from the tradition.
- 275 Authentic Teachings: From Mumonkan, Blue Cliff Record, Book of Equanimity, and Extended Zen Teachings
- Multi-Phase AI Reasoning: 6-phase prompting architecture for nuanced student response analysis
- Personalized Progress: Hidden level system (1-100) based on the Five Ranks of Tozan
- Premium Subscriptions: Stripe-powered subscriptions for Pro model access
- Daily Meditation Emails: Optional Zen teaching emails via Resend
- Dark/Light Theme: Full theme support with Zen-inspired design
- Frontend: React, TypeScript, Tailwind CSS, Wouter, TanStack Query
- Backend: Express.js, Node.js
- Database: PostgreSQL with Drizzle ORM
- AI: Google Gemini (gemini-3-flash-preview / gemini-3-pro-preview)
- Auth: Replit Auth (Google sign-in)
- Payments: Stripe
- Email: Resend
To run this application, you need to set the following environment variables:
| Variable | Description |
|---|---|
DATABASE_URL |
PostgreSQL connection string |
GEMINI_API_KEY |
Google Gemini API key from Google AI Studio |
SESSION_SECRET |
Secret key for session encryption (any random string) |
| Variable | Description |
|---|---|
STRIPE_SECRET_KEY |
Stripe secret key for payment processing |
RESEND_API_KEY |
Resend API key for daily meditation emails |
CRON_API_KEY |
API key for admin cron job endpoints |
- Clone the repository
- Install dependencies:
npm install
- Set up environment variables (copy from above)
- Push database schema:
npm run db:push
- Start the development server:
npm run dev
The application runs on port 5000.
The Zen master uses a sophisticated 6-phase reasoning system:
- Classification (temp 0.2, 800 tokens): Analyzes response_mode, experiential_grounding_score, attachment, avoidance
- Student State Update: Tracks five_ranks_orientation, primary_obstacle, confidence
- Safety/Boundary Check (temp 0.1): Redirects therapy/diagnosis requests appropriately
- Response Mode Decision: Determines whether to withhold, teach, trigger meta-reflection, or redirect
- Generation (temp 0.85): Creates expressive Zen master responses
- Dialog Summary: Periodic rolling summaries for long-context memory
MIT