Express API wrapping the Swiss Ephemeris library — planetary body positions, house cusps/chart points, and transit aspects.
Frontend app (React/Vite) consuming this API: https://github.com/petr-kratochvil/astro1.
Endpoints:
POST /position: main celestial body objects position for a given timestampPOST /houses: house cusps and chart points position for a given timestamp and geographical coordinatesPOST /transits: list of transits for a given base (natal) timestamp, base (natal) coordinates and transit timestampPOST /stations: the nearest station before and after a given timestamp for each planet from Mercury to Pluto
Full request/response shapes are in openapi.yaml.
All calculation endpoints use POST methods with JSON payloads instead of standard GET with query parameters.
This is a tradeoff between HTTP caching and security:
- Privacy & Security: Birth dates and geographical coordinates are sensitive personal data. Using GET would expose them in plaintext into browser history, CDN logs, and server access logs. POST bodies are encrypted end-to-end via HTTPS.
- Caching Strategy: While this bypasses default caching mechanisms, the application is designed to scale horizontally by implementing a custom application-level cache (e.g., Redis).
npm install
npm run dev # tsx + nodemon, watches src/Server listens on http://localhost:3601 (override with PORT).
npm run docker:build
npm run docker:runThe API is now available at http://localhost:3601.
Deployed on Vercel via api/index.ts (see vercel.json); the same Express app also runs standalone from src/index.ts for local dev and Docker.
The sweph npm package is compiled using node-gyp during package instalL, so the actual package in node_modules is platform-dependent and not portable.
AGPL-3.0-or-later — see LICENSE.
This project links the Swiss Ephemeris library, which Astrodienst dual-licenses under AGPL or a paid Professional license. Since this project doesn't hold a Professional license, it (and any public deployment of it) must be licensed under AGPL to comply with that requirement.