Weekly meditation platform with AI-generated content and professional audio production.
- Frontend: Server-rendered EJS templates with responsive design
- Backend: Node.js/TypeScript with Express
- Database: PostgreSQL (Cloud SQL)
- Authentication: Google OAuth 2.0
- Infrastructure: Google Cloud Platform (Cloud Run, Cloud SQL, GCS, Pub/Sub)
- AI: Vertex AI for content generation, ElevenLabs for TTS
src/
├── controllers/ # Request handlers
├── db/ # Database migrations and seeds
├── middleware/ # Express middleware
├── models/ # Data models
├── routes/ # Route definitions
├── services/ # Business logic
├── utils/ # Utility functions
└── views/ # EJS templates
├── admin/ # Admin interface
└── public/ # Public site
- ✅ Phase 0: Infrastructure bootstrap
- ✅ Phase 1: Core scaffold with auth and database
- ⏳ Phase 2: AI generation and audio pipeline
- ⏳ Phase 3: Playback and scheduling
- ⏳ Phase 4: QA and launch
-
Prerequisites:
- Node.js 20+
- PostgreSQL 15+
- Google Cloud SDK
-
Setup:
# Install dependencies npm install # Copy environment variables cp .env.example .env # Edit .env with your configuration # Run database migrations npm run migrate # Start development server npm run dev
-
Environment Variables:
DATABASE_URL: PostgreSQL connection stringGOOGLE_CLIENT_ID: OAuth client IDGOOGLE_CLIENT_SECRET: OAuth client secretSESSION_SECRET: Express session secretADMIN_EMAILS: Comma-separated admin emails
# Build and deploy to Cloud Run
./deploy.shPush to main branch triggers automatic deployment via Cloud Build.
-
Update OAuth Configuration:
- Add redirect URI:
https://YOUR-SERVICE-URL/auth/google/callback - Configure authorized domains
- Add redirect URI:
-
Set Admin Users:
- Update
ADMIN_EMAILSenvironment variable - First admin user auto-assigned on login
- Update
-
Configure Secrets:
oauth-client-id: Google OAuth client IDoauth-client-secret: Google OAuth secretelevenlabs-api-key: ElevenLabs API keyjwt-secret: Session secret
Key tables:
users: User accounts with rolesthemes: Weekly meditation themesmeditations: Individual meditation sessionsplayback_events: Analytics and trackingllm_jobs: AI generation queuepublish_jobs: Audio processing queue
GET /: Current week viewGET /theme/:id: Theme detailsGET /meditation/:id: Meditation playerGET /archive: Past themes
GET /admin: DashboardGET /admin/themes: Manage themesPOST /admin/themes/:id/generate: Trigger AI generationPOST /admin/themes/:id/approve: Approve for publishing
GET /api/health: Health checkPOST /api/playback/event: Track playbackGET /api/meditations/current-week: Current content
npm run dev: Start development servernpm run build: Build TypeScriptnpm run start: Start production servernpm run migrate: Run database migrationsnpm run test: Run testsnpm run lint: Lint codenpm run typecheck: Type checking
- Health endpoint:
/health - Structured logging with Winston
- Cloud Monitoring integration
- Playback analytics tracking
- HTTPS-only cookies
- CSRF protection
- Rate limiting
- Content Security Policy
- SQL injection prevention
- XSS protection
- Implement Vertex AI integration for content generation
- Add ElevenLabs TTS pipeline
- Build audio mixing service
- Create HLS streaming setup
- Add comprehensive testing
- Performance optimization
Proprietary - All rights reserved