A production-style astrology web application that combines KP astrology workflows, transit intelligence, prediction rendering, and Vastu tooling in a single full-stack system.
The app includes:
- A browser-based user workspace for generating charts and navigating multiple astrology analysis modules.
- A protected admin portal for maintaining rule data, mappings, engine settings, backups, and operational controls.
- A Node.js API layer with SQLite persistence, backup/restore routines, and Swiss Ephemeris based calculations.
This project is designed as an end-to-end astrology platform rather than a single calculator page. A user can enter birth details, generate kundli data, navigate to KP analysis and prediction pages, view varshphal and hora contexts, run transit-specific lookups, and store/reuse records. Administrators can update interpretation datasets and system behavior without code changes.
Core capability areas:
- Kundli generation and chart-related planetary computation.
- KP-oriented analysis support data and rendering.
- Prediction pipelines with configurable rules and mapped remedies.
- Vastu layout capture with dedupe hashing and linked record storage.
- Prasna workflow page for current-moment query handling.
- Admin-managed content model for combos, states, houses, rashis, remedies, and transit effects.
- Main user app: frontend/index.html
- Admin panel: frontend/admin.html
- Frontend modules are organized by domain under:
- frontend/js/frontend
- frontend/js/admin
Key frontend domain modules:
- Kundli generation and chart orchestration: KundliGeneration.js
- KP and prediction rendering: kp-analysis.js, kp-predictions.js, predictions-renderer.js
- BTR and interactive chart helpers: BTR.js, interactive-charts.js
- Transit/muhurta and additional engines: hora-renderer.js, nadi-engine.js
- Navigation and app state wiring: navigation.js, api-state.js
- Vastu modules: VastuPadas.js, VastuDevatasInfo.js
- Prasna-specific workflow: prasna-kundli.js
Admin modules:
- Authentication/session handling: frontend/js/admin/auth.js
- Database and data operations UI glue: frontend/js/admin/database.js
- Rule editing utilities: frontend/js/admin/rule-definer.js
- Record/table presentation logic: frontend/js/admin/ui-tables.js
- Runtime entry: backend/server.js
- Web stack: Express + CORS + Helmet
- Database: better-sqlite3 (file-backed SQLite)
- Astrology engine integrations:
- sweph for planetary calculations
- tz-lookup and luxon for timezone-aware date-time operations
- axios + Nominatim for geocoding
- Primary DB file: backend/data/astrology.db
- Backup JSON flow:
- Persistent backup file in backend/data/backup_file.json
- Seed copy from backend/backup_file.json when missing
- Docker volume persistence:
- backend_data mapped to /app/data in container
- Generate: captures personal birth/transit inputs and triggers complete calculation.
- Kundli: chart/result context after generation.
- KP Analysis: planet/house attribute rendering and KP interpretation support.
- BTR: birth-time rectification related workflow.
- Predictions: dasha/transit style interpretation outputs.
- Varshphal: annual chart interpretation layer.
- Muhurta (Hora): timing-oriented view.
- Vastu Padas: vastu-oriented mapping/presentation.
- Prasna Kundli: current-moment based chart generation path.
- Secure login + reset + change password flows.
- User records management (list, update, delete).
- Rule and content data editors for:
- Planet combos
- Planet states
- Planets in rashi
- Planets in house
- KP attributes
- House attributes
- Transit effects
- Varshphal effects
- Remedy and zodiac mappings
- Advanced rules
- Engine settings and autosave style controls.
- Backup download and restore upload controls.
Authentication/admin:
- POST /api/login
- POST /api/admin/reset
- POST /api/admin/change-password
Engine/backup:
- GET /api/engine_settings
- POST /api/admin/engine_settings
- POST /api/admin/backup
- POST /api/admin/restore
Dictionary/content datasets (read + admin write):
- GET/POST /api/combinations
- GET/POST /api/planet_states
- GET/POST /api/planet_rashi
- GET/POST /api/planet_house
- GET/POST /api/transit_effects
- GET/POST /api/varshphal_effects
- GET/POST /api/monthly_progression
- GET/POST /api/advanced_rules
- GET/POST /api/remedy_mappings
- GET/POST /api/zodiac_mappings
- GET/POST /api/kp_analysis
- GET/POST /api/house_attributes
- GET /api/kp_data
- GET /api/elements
- POST /api/elements/:id
Records and layout operations:
- POST /api/vastu/layouts
- GET /api/admin/records
- PUT /api/admin/records/:id
- DELETE /api/admin/records/:id
Astrology computation endpoints:
- POST /api/transit_only
- POST /api/calculate
- JWT-based protected admin endpoints.
- Password hashing through bcrypt.
- Request throttling/rate limiting on sensitive endpoints.
- Input sanitization via trimmed and bounded text parsing.
- Secure headers through Helmet and explicit policy headers.
- CORS allowlist support through ALLOWED_ORIGINS.
Important production reminders:
- Configure JWT_SECRET and MASTER_RESET_KEY via environment variables.
- Replace default admin credentials immediately.
- Restrict CORS origins in deployment.
Main tables include:
- users
- kundli_records
- vastu_layouts
- engine_settings
- combinations
- planet_states
- planet_in_rashi
- planet_in_house
- transit_effects
- varshphal_effects
- monthly_progression_effects
- remedy_mappings
- zodiac_mappings
- advanced_rules
- kp_attributes
- house_attributes
- elements
Notable behavior:
- On startup, schema creation and safe migrations are applied.
- Initial reference data can be loaded from backup JSON.
- Kundli append logic can write newly generated records into backup JSON.
- backend
- server.js
- package.json
- Dockerfile
- data
- frontend
- index.html
- admin.html
- css
- assets
- js/frontend
- js/admin
- Dockerfile
- nginx.conf
- docker-compose.yml
- README.md
- LICENSE
cd c:\Users\sagar\Downloads\WebApps\astrology_webapp
docker-compose up --buildDefault service ports:
- Frontend: 8080
- Backend API: 3000
- Install backend dependencies:
cd backend
npm install- Start backend:
npm start- Serve frontend folder with any static host (or open frontend/index.html for local testing where applicable).
- This repository intentionally excludes legacy folders like 1backup files and 1data.
- Kundli entries in backup data are sanitized in the current branch state.
- If historical commits previously contained sensitive records, rewrite history before sharing strict-clean archives.
MIT License. See LICENSE.