# A kundli matching starter for matrimony sites

> A small Node server and one page for matrimony and matchmaking products: two people's birth details in, the Ashtakoot score out of 36 with all eight kootas, the match verdict, and each person's manglik status with its cancellations.

Source: https://astronode.dev/templates/matrimony-starter · Updated: 2026-12-05

## What it does

- One page with two birth-detail forms; the browser posts to the template's own `/api/match`, never to AstroNode.
- Shows the total out of 36, the verdict, and each koota's score against its maximum - including kootas raised by a cancellation, such as a Bhakoot cancelled to full marks.
- Shows each person's Mangal dosha result next to the pair's manglik compatibility, because the two answer different questions (see the FAQ).
- Three API calls per match. Rejects bad input with a 400 and refuses to start without a key.

## Endpoints and plan

*API calls the template makes*

| Endpoint | Used for | Plan |
| --- | --- | --- |
| `POST /v1/compatibility` | Ashtakoot: eight kootas, total out of 36, verdict, manglik match | Hobby |
| `POST /v1/dosha/mangal` | Each person's own Mangal dosha and its cancellations (called twice) | Free |

It needs a Hobby key or above: at least one endpoint it calls is not on the Free plan. See [pricing](https://astronode.dev/pricing).

## Where things live

| File | What it holds |
| --- | --- |
| `lib.js` | Input checks, request bodies, the three API calls, response mapping |
| `server.js` | `node:http` server: static files and `POST /api/match` |
| `public/index.html, public/app.js` | The page and its script |
| `test/match.test.js` | Tests, including the real server against a stub replaying recorded responses |

## Keys and deployment

- The API key is read from the server's environment and sent as `Authorization: Bearer <key>`; it never reaches a browser or an app bundle.
- `npm run check` runs the tests against API responses recorded in `test/fixtures/` - no key and no network, so it can run in your CI.
- Runs anywhere Node 20 runs, with no `npm install`: a VM, a container, or a platform such as Render or Fly.
- Matching is usually behind sign-in on a matrimony site; if this page is public, rate-limit `/api/match`.

## Questions

**Why does the match say a person is not manglik when their own report says they are?**

In the compatibility response, `boy_present` and `girl_present` mean manglik after cancellations, while `POST /v1/dosha/mangal` reports the dosha as present and cancelled. The template shows both so the difference is visible.

**Which plan does the matrimony starter need?**

Hobby or above, for `POST /v1/compatibility`. The Mangal dosha calls are on the Free plan.

**Can it match one profile against many?**

This starter matches one pair. For one profile against a list, use `POST /v1/compatibility/batch`, covered in the matrimony use case.

## Related pages

- [Use case: matrimony and matchmaking](https://astronode.dev/use-cases/matrimony)
- [Recipe: a Gun Milan score widget](https://astronode.dev/recipes/gun-milan-score-widget)
- [All templates](https://astronode.dev/templates)
