# prokerala/astrology-api-demo architecture

> Architecture diagram of the GitHub repository prokerala/astrology-api-demo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/prokerala/astrology-api-demo
- Repository: https://github.com/prokerala/astrology-api-demo

## Overview

This is a PHP demo application for Prokerala’s astrology API. A user selects a calculator, submits date, time, location, or chart inputs, and views an astrology result or report; the README says an API account is required. The repository exposes Vedic calendar and horoscope tools, compatibility and dosha checks, Western charts, numerology, and PDF reporting. Sample pages share bootstrap configuration and a calculator catalog, while templates render forms and results. Many feature handlers were not sampled, so their API-call wiring is not asserted; dashed links mark the documented but unsampled API integration.

Main entry points: [`client.php`](https://github.com/prokerala/astrology-api-demo/blob/master/client.php) (API client), [`public/hindu-panchang.php`](https://github.com/prokerala/astrology-api-demo/blob/master/public/hindu-panchang.php) (Panchang and calendars), [`public/progression-chart.php`](https://github.com/prokerala/astrology-api-demo/blob/master/public/progression-chart.php) (Western chart tools), [`public/bootstrap.php`](https://github.com/prokerala/astrology-api-demo/blob/master/public/bootstrap.php) (Shared bootstrap)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and setup"]
  node_home["Demo home<br/>[index.php]"]
  node_setup["Shared bootstrap<br/>[bootstrap.php]"]
  node_catalog["Calculator catalog"]
  node_api_client["API client<br/>[client.php]"]
end

subgraph group_vedic["Vedic calculators"]
  node_panchang["Panchang and calendars<br/>[hindu-panchang.php]"]
  node_horoscope["Horoscopes and periods"]
  node_charts["Kundli and charts<br/>[kundli.php]"]
  node_matching["Matching and doshas"]
  node_vedic_more["Other Vedic tools"]
end

subgraph group_western["Charts and reports"]
  node_western_charts["Western chart tools"]
  node_numerology["Numerology<br/>[numerology.php]"]
  node_pdf["PDF reporting<br/>[pdf-report.php]"]
end

subgraph group_ui["Forms and presentation"]
  node_vedic_forms["Vedic input forms"]
  node_western_forms["Western input forms"]
  node_result_views["Calculator result views"]
  node_shared_ui["Shared navigation and errors<br/>[header.tpl.php]"]
end

node_user(("Calculator user"))
node_api{{"Prokerala API"}}
node_location_service{{"Location search service"}}

node_user -.->|"opens demo"| node_home
node_home -->|"loads bootstrap"| node_setup
node_setup -->|"includes catalog"| node_catalog
node_setup -->|"loads client"| node_api_client
node_user -.->|"selects calculator"| node_panchang
node_user -.->|"selects calculator"| node_western_charts
node_user -.->|"selects calculator"| node_numerology
node_user -.->|"requests report"| node_pdf
node_panchang -.->|"renders form"| node_vedic_forms
node_western_charts -.->|"renders form"| node_western_forms
node_panchang -.->|"renders results"| node_result_views
node_panchang -->|"uses lookup"| node_location_service
node_western_charts -->|"uses lookup"| node_location_service
node_panchang -.->|"requests API data"| node_api_client
node_horoscope -.->|"requests API data"| node_api_client
node_charts -.->|"requests API data"| node_api_client
node_matching -.->|"requests API data"| node_api_client
node_vedic_more -.->|"requests API data"| node_api_client
node_western_charts -.->|"requests API data"| node_api_client
node_numerology -.->|"requests API data"| node_api_client
node_pdf -.->|"requests API data"| node_api_client
node_api_client -.->|"calls service"| node_api

click node_home "https://github.com/prokerala/astrology-api-demo/blob/master/public/index.php"
click node_setup "https://github.com/prokerala/astrology-api-demo/blob/master/public/bootstrap.php"
click node_catalog "https://github.com/prokerala/astrology-api-demo/blob/master/public/calculators-list.php"
click node_api_client "https://github.com/prokerala/astrology-api-demo/blob/master/client.php"
click node_panchang "https://github.com/prokerala/astrology-api-demo/blob/master/public/hindu-panchang.php"
click node_horoscope "https://github.com/prokerala/astrology-api-demo/blob/master/public/daily-horoscope.php"
click node_charts "https://github.com/prokerala/astrology-api-demo/blob/master/public/kundli.php"
click node_matching "https://github.com/prokerala/astrology-api-demo/blob/master/public/kundli-matching.php"
click node_vedic_more "https://github.com/prokerala/astrology-api-demo/tree/master/public"
click node_western_charts "https://github.com/prokerala/astrology-api-demo/blob/master/public/progression-chart.php"
click node_numerology "https://github.com/prokerala/astrology-api-demo/blob/master/public/numerology.php"
click node_pdf "https://github.com/prokerala/astrology-api-demo/blob/master/public/pdf-report.php"
click node_vedic_forms "https://github.com/prokerala/astrology-api-demo/blob/master/templates/common/panchang-form.tpl.php"
click node_western_forms "https://github.com/prokerala/astrology-api-demo/blob/master/templates/common/western-horoscope-form.tpl.php"
click node_result_views "https://github.com/prokerala/astrology-api-demo/blob/master/templates/hindu-panchang.tpl.php"
click node_shared_ui "https://github.com/prokerala/astrology-api-demo/blob/master/templates/common/header.tpl.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_home,node_setup,node_catalog,node_api_client,node_user toneBlue
class node_panchang,node_horoscope,node_charts,node_matching,node_vedic_more toneAmber
class node_western_charts,node_numerology,node_pdf,node_api toneMint
class node_vedic_forms,node_western_forms,node_result_views,node_shared_ui toneRose
class node_location_service toneIndigo
```

## Components

### Entry and setup

- [Demo home](https://github.com/prokerala/astrology-api-demo/blob/master/public/index.php): `public/index.php`
- [Shared bootstrap](https://github.com/prokerala/astrology-api-demo/blob/master/public/bootstrap.php): `public/bootstrap.php`
- [Calculator catalog](https://github.com/prokerala/astrology-api-demo/blob/master/public/calculators-list.php): `public/calculators-list.php`
- [API client](https://github.com/prokerala/astrology-api-demo/blob/master/client.php): `client.php`

### Vedic calculators

- [Panchang and calendars](https://github.com/prokerala/astrology-api-demo/blob/master/public/hindu-panchang.php): `public/hindu-panchang.php`
- [Horoscopes and periods](https://github.com/prokerala/astrology-api-demo/blob/master/public/daily-horoscope.php): `public/daily-horoscope.php`
- [Kundli and charts](https://github.com/prokerala/astrology-api-demo/blob/master/public/kundli.php): `public/kundli.php`
- [Matching and doshas](https://github.com/prokerala/astrology-api-demo/blob/master/public/kundli-matching.php): `public/kundli-matching.php`
- [Other Vedic tools](https://github.com/prokerala/astrology-api-demo/tree/master/public): `public`

### Charts and reports

- [Western chart tools](https://github.com/prokerala/astrology-api-demo/blob/master/public/progression-chart.php): `public/progression-chart.php`
- [Numerology](https://github.com/prokerala/astrology-api-demo/blob/master/public/numerology.php): `public/numerology.php`
- [PDF reporting](https://github.com/prokerala/astrology-api-demo/blob/master/public/pdf-report.php): `public/pdf-report.php`

### Forms and presentation

- [Vedic input forms](https://github.com/prokerala/astrology-api-demo/blob/master/templates/common/panchang-form.tpl.php): `templates/common/panchang-form.tpl.php`
- [Western input forms](https://github.com/prokerala/astrology-api-demo/blob/master/templates/common/western-horoscope-form.tpl.php): `templates/common/western-horoscope-form.tpl.php`
- [Calculator result views](https://github.com/prokerala/astrology-api-demo/blob/master/templates/hindu-panchang.tpl.php): `templates/hindu-panchang.tpl.php`
- [Shared navigation and errors](https://github.com/prokerala/astrology-api-demo/blob/master/templates/common/header.tpl.php): `templates/common/header.tpl.php`

### Other components

- **Calculator user**
- **Prokerala API**
- **Location search service**

## Connections

- Calculator user → Demo home: opens demo (evidence: `README.md`)
- Demo home → Shared bootstrap: loads bootstrap (evidence: `public/index.php`)
- Shared bootstrap → Calculator catalog: includes catalog (evidence: `public/bootstrap.php`)
- Shared bootstrap → API client: loads client (evidence: `public/bootstrap.php`)
- Calculator user → Panchang and calendars: selects calculator
- Calculator user → Western chart tools: selects calculator
- Calculator user → Numerology: selects calculator
- Calculator user → PDF reporting: requests report
- Panchang and calendars → Vedic input forms: renders form
- Western chart tools → Western input forms: renders form
- Panchang and calendars → Calculator result views: renders results (evidence: `templates/hindu-panchang.tpl.php`)
- Panchang and calendars → Location search service: uses lookup
- Western chart tools → Location search service: uses lookup
- Panchang and calendars → API client: requests API data
- Horoscopes and periods → API client: requests API data
- Kundli and charts → API client: requests API data
- Matching and doshas → API client: requests API data
- Other Vedic tools → API client: requests API data
- Western chart tools → API client: requests API data
- Numerology → API client: requests API data
- PDF reporting → API client: requests API data
- API client → Prokerala API: calls service (evidence: `README.md`)
