How ctheface/indic-wisdom works
Project type and purpose
• This is a full-stack web application (“Indic Wisdom”) that delivers Bhagavad Gita verses with AI-powered insights and a “like” system.
• Frontend: React.js with Vite for development and Bootstrap+custom CSS for styling.
• Backend: Node.js + Express, using Supabase for database/storage and Google Gemini API for AI.
File structure
• Top level:
• Procfile (deployment on Heroku‐style PaaS)
• package.json / lock (npm dependencies)
• vite.config.js, eslint.config.js (build + lint config)
• bhagavad_gita_verses.csv (data seed)
• public/index.html + public assets (static hosting by Vercel)
• src/
• main.jsx, App.jsx, components/, pages/ (client-side React code)
• server.js (Express entry point)
• supabase.js (DB client initialization)
Extract architectural insights from the README
• Frontend deployed on Vercel (static hosting + serverless functions?).
• Backend deployed on Render (Express REST API).
• Supabase provides Postgres-based DB and authentication.
• Google Gemini API used for AI interpretation of verses.
Main components & their interactions
a. Client Browser (User)
b. Frontend Application (React/Vite)
c. Backend API (Node.js/Express)
d. Database Service (Supabase)
e. External AI Service (Google Gemini)
Interaction flow:
• User → HTTP(S) → Frontend (Vercel)
• Frontend → REST API calls → Backend (Render)
• Backend → Supabase client → Database (CRUD for verses + likes)
• Backend → HTTPS → Google Gemini API (AI insights)
• Backend aggregates data and returns JSON → Frontend
• Frontend renders WisdomCard components with AI text & like buttons
Architectural patterns & design principles
• Component-based UI (React) with separation of concerns: pages/ vs components/
• RESTful API layer (Express)
• Single-page application with client-side routing (About.jsx, infinite scroll)
• External service integration encapsulated in server.js
Key details to capture
• The React app’s dynamic infinite scroll fetching fresh verses
• LikedWisdom component’s interactions with the Express API for storing favorites
• The dual data sources for verse content (static CSV seed loaded into Supabase) vs AI insights (live Google Gemini calls)
• Supabase handling both data storage and user authentication (if implemented)
Final recommendations
• Clear client↔server↔database↔external API boundaries.