# A React Native app that draws a kundli

> An Expo app for iOS and Android: enter birth details and get a North Indian chart drawn with `react-native-svg` and the planets' signs, houses and degrees - fetched through a tiny Node proxy, because an API key shipped inside an app can be read out of it.

Source: https://astronode.dev/templates/react-native-chart-app · Updated: 2026-12-05

## What it does

- A form for date, time, UTC offset (`+05:30` style) and coordinates; the app calls the proxy at `EXPO_PUBLIC_PROXY_URL`, never AstroNode directly.
- The proxy (`server/proxy.mjs`, no dependencies) validates input including real calendar dates, forwards only the five fields the API takes, adds the key, and applies a timeout and a per-IP rate limit.
- Draws the North Indian chart with `react-native-svg` from a pure geometry module, so the layout is tested in Node without a device.
- API errors come back unchanged with their status, and the app shows their message.

## Endpoints and plan

*API calls the template makes*

| Endpoint | Used for | Plan |
| --- | --- | --- |
| `POST /v1/charts/birth` | Ascendant and the nine planets: sign, house, degree, retrograde | Free |

Everything it calls is on the Free plan, so a Free test key runs the whole template.

## Where things live

| File | What it holds |
| --- | --- |
| `server/proxy.mjs` | The key-holding proxy: `POST /chart`, `GET /health` |
| `src/chart-layout.ts` | House polygons, label points, planets grouped per house |
| `src/NorthIndianChart.tsx` | The chart, drawn with react-native-svg |
| `src/birth-input.ts` | Form parsing and validation |
| `src/api.ts` | The app's call to the proxy |
| `App.tsx` | The screen |

## 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` type-checks the app and runs 23 tests offline - chart geometry, form parsing and the proxy against recorded responses - with no key and no network.
- Deploy the proxy anywhere Node runs and point `EXPO_PUBLIC_PROXY_URL` at it; Expo inlines that value at build time, so rebuild after changing it.
- Only the proxy URL is in the app bundle - `ASTRONODE_API_KEY` is never prefixed `EXPO_PUBLIC_`.
- Build store binaries with EAS Build or `expo prebuild` as for any Expo app.

## Questions

**Why does the React Native app need a proxy?**

Anything inside an app bundle can be extracted, including an API key. The proxy keeps the key on a server and lets you rate-limit what the app can spend.

**Does it need a paid plan?**

No. It calls only `POST /v1/charts/birth`, which is on the Free plan.

**Can I use the chart in a bare React Native app without Expo?**

Yes. `src/NorthIndianChart.tsx` and `src/chart-layout.ts` need only React Native and `react-native-svg`.

## Related pages

- [Integration: React Native](https://astronode.dev/integrations/react-native)
- [Recipe: North and South Indian charts](https://astronode.dev/recipes/north-south-indian-chart)
- [Next.js kundli app](https://astronode.dev/templates/nextjs-kundli-app)
- [All templates](https://astronode.dev/templates)
