# Open source ziwei doushu astrology engine

Renhuai123/ziwei-doushu is an open-source TypeScript engine that calculates Ziwei Doushu astrological charts based on Ni Haixia's Tianji system. The project provides a large 13-dimensional astrological interpretation dataset (v4.0) covering dates between 1950 and 2026.

- ★ 8,056
- TypeScript
- GitHub Trending · 2026-10-24

## Updates

- **October 26, 2026:** Stars 6,993 → 8,056, latest release v4.0-13d (October 15, 2026).
- **October 24, 2026:** Stars 6,990 → 6,993, latest release v4.0-13d (October 15, 2026).

## What you get

- Provides six hundred seventy-five thousand 命盘 (horoscope charts) and a thirteen-dimensional large astrological interpretation dataset.
- Performs real-time chart calculation and solar time correction.
- Contains a complete astrology engine based on Ni Haixia's Tianji system.

## Installation

**Cloning and preparing the project**

```
git clone https://github.com/Renhuai123/ziwei-doushu.git
cd ziwei-doushu

# 安装依赖
npm install

# 配置环境变量（只看排盘可以跳过；AI 配置仅在你自己实现了 /api/* 接口时才用得上）
cp .env.example .env.local

# 启动开发服务器
npm run dev
```

## Running it

**Running tests**

```
npm test            # 排盘引擎回归（768 盘 × 紫微铁律、夏令时、立春边界、红鸾天喜、样本时辰一致性、时辰序号边界、日期合法性、同宫双四化）
```

## If you don't write code

Paste this into your AI agent (Claude Code · Codex · Antigravity)

I want to install and run the Ziwei Doushu project on my computer. Please start the development server by running the terminal commands in order.

Repository: https://github.com/Renhuai123/ziwei-doushu. Follow the official instructions in the README of this repository for setup and execution.

Before starting, check which OS we are on and if the necessary tools (e.g., Python, Node.js, Git, Docker) are installed. Install any missing ones step-by-step according to this system.

Create a new, empty folder to work in. Do not touch any files outside this folder and do not delete anything. Tell me what you are going to do in one sentence before running each command.

Tell me what I should see on the screen at the end of each step. If an error occurs, I will paste the error message to you exactly as it is, and we will fix it together.

## Related dictionary terms

- [v4.0](https://trescout.com/en/dictionary/v4-0/)
- [Terminal](https://trescout.com/en/dictionary/terminal/)
- [Artificial Intelligence](https://trescout.com/en/dictionary/artificial-intelligence/)

- **Who it is for:** It is for developers who want to examine Chinese traditional astrology systems and chart calculation engines.
- **License:** MIT

## Links

- [GitHub repository →](https://github.com/Renhuai123/ziwei-doushu)
- [Read in Turkish →](https://trescout.com/discover/ziwei-doushu/)

TreScout did not build this tool · we found it in GitHub trends and wrote it up. This page describes the repository as of 2026-10-24: The star count and our text belong to that day, the repository may have changed since. Check the repository link for the current state. The introductory text was prepared with AI from the repository's own documentation, and this page was **machine-translated** from the Turkish original · the Turkish version prevails.

---
Source: TreScout Discover · https://trescout.com/en/discover/ziwei-doushu/
