How oris7767/chiem-tinh-ve-dic works
1. Overall shape
- This is a Vite + React + TypeScript single-page application with a largely client-rendered architecture.
- The repo is split into feature pages, reusable UI components, domain-specific calculation logic, and a small Supabase backend layer.
2. App shell and routing
- src/main.tsx, src/App.tsx, and src/pages/* form the top-level navigation structure.
- Pages cover the main product areas: home/landing, Vedic chart, Panchang, numerology, Luc Nham, trading view, blog, login/admin, and a not-found route.
- src/components/NavBar.tsx, MobileMenu.tsx, Footer.tsx, Breadcrumbs.tsx, and SEO.tsx provide the global page chrome and metadata.
3. Feature boundaries
- The app is organized by domain rather than by technical layer.
- Major feature groups are:
- Vedic astrology: src/components/VedicAstrology/*, src/services/vedicAstroService.ts, src/services/birthChartService.ts
- Panchang: src/components/panchang/*, src/hooks/usePanchang.ts, src/services/panchangService.ts
- Numerology: src/pages/NumerologyPage.tsx, src/pages/NumerologyAdminPage.tsx, and multiple calculation/meaning utilities under src/utils/*
- Luc Nham: src/pages/LucNhamPage.tsx, src/utils/lucNhamEngine.ts, src/utils/lucNhamPersonalLogic.ts, and src/data/lucNham/*
- Blog/admin: src/pages/Blog*, src/components/blog/*, src/context/BlogContext.tsx
4. Data flow in the astrology features
- User input starts in form components such as BirthChartForm.tsx, LocationSelector.tsx, and AuthForms.tsx.
- Calculation logic is then handled in service/util layers, especially birthChartService.ts, vedicAstroService.ts, and src/utils/vedicAstrology/*.
- Results are rendered as charts and tables (VedicChart.tsx, SouthIndianChart.tsx, PlanetDetailsTable.tsx, HouseDetailsTable.tsx, DashaCalculator.tsx, etc.).
- This keeps input collection, computation, and presentation separated.
5. Panchang and transit pipeline
- Panchang-related pages use hooks and services to fetch or derive calendar/astronomical data.
- usePanchang.ts, useTransits.ts, and panchangService.ts feed components like SolarEvents.tsx, LunarInfo.tsx, PlanetaryTransits.tsx, and AstrologicalInfo.tsx.
- src/mocks/panchangMock.ts suggests a local fallback/mock path for development or offline use.
6. Numerology and Luc Nham are mostly local computation
- Numerology logic lives in utility modules such as numerologyCalculator.ts, numberDetailedMeanings/*, careerMeanings.ts, relationshipMeanings.ts, and strengthsAndChallenges.ts.
- Luc Nham is similarly self-contained, with rule/interpretation data in src/data/lucNham/* and engine logic in src/utils/lucNhamEngine.ts.
- These features appear to be computed on the client from local rule sets rather than relying on a backend API.
7. Blog and admin subsystem
- Blog UI is split between public display pages (BlogPage.tsx, BlogPostPage.tsx) and admin/auth flows (BlogLoginPage.tsx, NumerologyAdminPage.tsx, SubscribersAdminPage.tsx).
- Context providers (BlogContext.tsx, SubscriberContext.tsx) likely manage shared state and persistence for posts/subscribers.
- The blog feature uses its own component set (PostForm.tsx, PostsList.tsx, PostHeader.tsx, etc.), indicating a separate content-management boundary inside the app.
8. Backend and serverless functions
- The only clear backend integration is Supabase: src/integrations/supabase/* plus supabase/.
- Supabase edge functions support:
- calculate-vedic-chart
- send-email-verification
- auth-email-handler
- This means the app is not purely static; some operations, especially chart calculation or email/auth workflows, are delegated to server-side functions.
9. Shared UI and design system
- src/components/ui/* is a shadcn-style component library used across all feature areas.
- These primitives provide the consistent interaction layer for forms, dialogs, tables, tabs, dropdowns, toasts, and navigation.
- src/lib/utils.ts, src/lib/schemas.ts, and src/hooks/use-toast.ts support common UI behavior and validation.
10. Internationalization and content data
- The app has bilingual content support through src/locales/en.json, src/locales/vi.json, and src/context/LanguageContext.tsx.
- Shared i18n helpers live in src/utils/i18n.ts.
- Static/content-heavy assets are stored in public/ and src/data/*, including images, videos, PDFs, localized meanings, and exportable resources.
11. Charts, exports, and media
- Charting is a first-class presentation layer: TradingViewChart.tsx, AdvancedTradingViewChart.tsx, and src/components/ui/chart.tsx.
- There are helper utilities for exporting images/SVGs: imageExportUtils.ts and svgExportUtils.ts.
- The presence of public/videos/diya-flame.mp4, public/images, and lovable-uploads indicates heavy use of static media in the UI.
12. SEO, sitemap, and deployment
- SEO is treated explicitly via SEO.tsx, src/utils/seo.tsx, src/api/sitemap.ts, and src/utils/sitemap.ts, with public/robots.txt and public/sitemap.xml.
- Deployment is configured for static hosting with Netlify (netlify.toml and public/_redirects), while vite.config.ts and Tailwind config files define the build/tooling layer.
- The architecture is therefore: mostly static client app, with Supabase for backend capabilities and Netlify for hosting/routing.
Main entry points: pages Pages · App.tsx App · services Astro Services · panchangService.ts Panchang Service
Components 21
App Shell
Client entry, routing, chrome, and global page composition.
Vedic Astrology
Birth chart flow, calculations, and chart presentation.
- Input Forms · Birth chart and auth/location input capture.
src/components/VedicAstrology - Astro Services · Birth chart and Vedic astrology computation services.
src/services - Chart Views · Charts, tables, and result presentation for Vedic astrology.
src/components/VedicAstrology
Panchang & Transits
Calendar, lunar, and transit data pipeline.
- Panchang Hooks · Hooks that fetch and derive Panchang and transit data.
src/hooks - Panchang Service · Calendar and astronomical data source/derivation layer.
src/services/panchangService.ts - Panchang Views · Solar, lunar, transit, and astrological Panchang displays.
src/components/panchang
Numerology & Luc Nham
Local calculation engines and domain data for divination features.
- Numerology Pages · Public and admin numerology entry points.
src/pages/NumerologyPage.tsx - Numerology Logic · Number calculations and meaning lookup utilities.
src/utils - Luc Nham · Luc Nham user-facing interpretation page.
src/pages/LucNhamPage.tsx - Luc Nham Engine · Rule-based Luc Nham calculation and personal logic.
src/utils - Luc Nham Data · Rule and interpretation datasets for Luc Nham.
src/data/lucNham
Content & Admin
Blog, subscribers, login, and admin-oriented content flows.
- Blog Pages · Public blog and post routes plus login/admin entry points.
src/pages/BlogPage.tsx - Blog UI · Blog forms, lists, headers, and login UI.
src/components/blog - Blog State · Shared blog and subscriber state management.
src/context
Platform
Shared UI system, localization, SEO, and backend integration.
- UI System · Reusable design-system primitives used across the app.
src/components/ui - Platform Services · Localization, schemas, SEO, exports, and common helpers.
src/utils - Supabase · Client integration and edge functions for auth and chart calculation.
src/integrations/supabase
Connections 23
- main.tsx → App: renders · App entry mounts the router shell.
- App → Pages: routes to · Top-level routing selects feature pages.
- App → Chrome: wraps with · Global layout and metadata are applied around pages.
- Pages → Input Forms: uses · Astrology pages collect chart input and auth details.
- Input Forms → Astro Services: submits input to · User input drives chart calculation services.
- Astro Services → Chart Views: feeds · Computed chart data is rendered in charts and tables.
- Pages → Panchang Hooks: loads · Panchang pages hydrate from hooks and derived data.
- Panchang Hooks → Panchang Service: calls · Hooks source calendar and astronomical data.
- Panchang Service → Panchang Views: drives · Service output is shown in Panchang components.
- Pages → Numerology Pages: contains · Numerology routes expose public and admin views.
- Numerology Pages → Numerology Logic: calculates with · Client-side numerology calculations power the pages.
- Pages → Luc Nham: contains · Luc Nham page is a dedicated route.
- Luc Nham → Luc Nham Engine: evaluates · Page uses the rule engine for interpretations.
- Luc Nham Engine → Luc Nham Data: reads · Engine is backed by local rules and interpretations.
- Pages → Blog Pages: contains · Blog and admin routes live in the page layer.
- Blog Pages → Blog UI: composes · Blog pages reuse dedicated content-management UI.
- Blog UI → Blog State: shares state with · Blog UI relies on context for content and subscribers.
- Chrome → UI System: built from · Layout and navigation use shared UI primitives.
- Pages → UI System: uses · Feature pages build on the common component library.
- Pages → Platform Services: depends on · Pages use shared localization, SEO, and helper utilities.
- Astro Services → Supabase: integrates with · Backend functions support chart and auth workflows.
- Blog State → Supabase: persists via · Content/admin state is likely backed by Supabase.
- Panchang Service → Supabase: may fetch from · Calendar data can be backed by remote services.