How xstarust/xstars works
xstars is a Rust Zi Wei Dou Shu charting engine, with a CLI as an additional user interface. The principal workflow takes birth date, time, and gender; calculates calendar and pillar data; applies configurable star-placement rules; and produces a twelve-palace chart. Users can then query the chart, cast the three-sided/four-cardinal palaces, calculate fortune layers, and detect patterns. The graph preserves the README’s other major capabilities, including localization and school configuration. Relationships for unsampled implementations are included only where the README or source index supports them.
Main entry points: astro.rs Astrolabe builder · main.rs CLI · mod.rs Calendar and pillars · yunxian.rs Fortune layers
Components 21
Chart construction
- Astrolabe builder
src/astro/astro.rs - Calendar and pillars
src/calendar/mod.rs - School configuration
src/config/mod.rs - Palace model
src/astro/palace.rs - Palace positions
src/astro/palace_pos.rs
Astrology features
- Three-sided cast
src/astro/cast_palaces.rs - Fortune layers
src/astro/yunxian.rs - Pattern detection
src/astro/pattern/patterns.rs
Rules and star data
- Major stars
src/star/major.rs - Star placement
src/star/location.rs - Minor stars
src/star/minor.rs - Miscellaneous stars
src/star/misc.rs - Shensha stars
src/star/shensha.rs - Star brightness
src/star/brightness.rs - Four transformations
src/star/hua.rs - Star names
src/star/starname.rs
User interfaces
- CLI
cli/src/main.rs
Shared services
- Calendar rule types
src/system/dizhi.rs - Localization
src/i18n/mod.rs
Other components
- Chart user
- xcal calendar library
Connections 22
- Chart user → CLI: enters details
- Chart user → Astrolabe builder: builds chart
- CLI → Astrolabe builder: requests chart
- Astrolabe builder → Calendar and pillars: calculates pillars
src/astro/astro.rs - Calendar and pillars → xcal calendar library: uses calendar data
- Astrolabe builder → School configuration: applies settings
src/astro/astro.rs - Astrolabe builder → Major stars: places major stars
src/astro/astro.rs - Astrolabe builder → Minor stars: places minor stars
src/astro/astro.rs - Astrolabe builder → Miscellaneous stars: places misc stars
src/astro/astro.rs - Astrolabe builder → Shensha stars: places shensha
src/astro/astro.rs - Astrolabe builder → Palace model: produces palaces
- Astrolabe builder → Star placement: uses placement rules
src/astro/astro.rs - Astrolabe builder → Calendar rule types: uses rule types
src/astro/astro.rs - Astrolabe builder → Fortune layers: calculates fortune
src/astro/astro.rs - Astrolabe builder → Three-sided cast: casts palaces
- Astrolabe builder → Pattern detection: detects patterns
- Fortune layers → Pattern detection: checks fortune patterns
- Astrolabe builder → Star brightness: exposes brightness
- Astrolabe builder → Four transformations: exposes transformations
- Astrolabe builder → Star names: exposes star names
- Star names → Localization: formats names
- CLI → Localization: selects language