selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

Life K-Line logo

Self-host Life K-Line

v1.0.2

AI-powered Chinese astrology with K-line charts

ReleaseOpen SourceApache-2.0
Updated10 months ago
LanguageTypescript
Setup difficultyModerate
Stars
434
Ports
3000 (Backend API server), 5173 (Frontend development server (Vite))
Requires
Node.js
Install with Node.js
Homepage - BaZi chart calculationLife K-line chart visualizationAI deep analysis reportPersonal dashboard - daily fortuneCelebrity case library - famous people's chartsKnowledge hub - astrology learning

What is Life K-Line?

Life K-Line (人生K线) is a self-hosted web application that visualizes personal destiny using traditional Chinese BaZi (Eight Characters) astrology combined with AI large language models. It renders life fortune trajectories as interactive K-line charts similar to stock market visualizations, covering ages 1-100 with major and annual luck cycles. The application provides intelligent BaZi chart calculation with true solar time correction, AI-powered deep analysis covering personality, career, wealth, relationships, health, and even Web3/crypto trading fortune. It includes a celebrity case library for comparison learning and a knowledge hub for astrology education. The stack uses React 19, Vite, Express.js, SQLite (better-sqlite3), Recharts for charts, and lunar-javascript for precise calendar calculations. It supports any OpenAI-compatible API including local models via Ollama or LM Studio. Self-hosting requires Node.js 18+ and an AI API key; the backend runs on port 3000 and frontend on 5173. Licensed under Apache 2.0.

Should you self-host Life K-Line?

Life K-Line scores 49/100 on selfhost.directory (how scoring works) and ranks #5 of 7 in Data Visualization. It has 434 GitHub stars.

It shipped 1 stable release in the past year. The latest, v1.0.2, came out on 22 December 2025.

Setup is moderate: expect some configuration beyond a single command. It is Apache-2.0-licensed and written mostly in Typescript.

Its closest alternative on selfhost.directory is JSON Crack (79/100, 44 561 stars). It scores higher overall, so compare the two before you pick. See Life K-Line vs JSON Crack side by side.

Features

  • AI Deep Analysis
  • BaZi Chart Calculation
  • Calendar Export
  • Celebrity Case Library
  • Customizable Points/Pricing System
  • Daily Fortune & Almanac
  • Feng Shui & Space Analysis
  • K-Line Life Fortune Visualization
  • Knowledge Hub
  • Marriage Compatibility Analysis
  • Multi-Model AI Support
  • Privacy-First Local Deployment
  • Shareable Poster Generation
  • Web3/Crypto Fortune Analysis

Life K-Line README

How to install Life K-Line

Install Life K-Line with Node.js

Environment variables
API_MODE, API_BASE_URL, API_KEY, DEFAULT_MODEL, CLOUD_API_KEY, CLOUD_API_ENDPOINT, PORT, JWT_SECRET, FREE_INIT_POINTS, COST_PER_ANALYSIS, ADMIN_VOUCHER_PASSWORD, SITE_NAME, SITE_DOMAIN, SITE_URL, MAIL_SMTP_HOST, MAIL_SMTP_PORT, MAIL_SMTP_SECURE, MAIL_FROM, MAIL_PASSWORD, EMAIL_BINDING_REWARD, EMAIL_SUBSCRIPTION_REWARD

1. 克隆项目

git clone https://github.com/miounet11/life-kline.git cd life-kline

2. 安装依赖

npm install

3. 配置环境变量

cp .env.example .env

编辑 .env 文件,配置你的 API

API_BASE_URL=https://api.openai.com/v1

API_KEY=sk-your-api-key-here

DEFAULT_MODEL=gpt-4

4. 启动服务(前后端同时启动)

npm run dev

访问 http://localhost:5173 开始使用。

Requires Node.js 18+ and an OpenAI-compatible API key

How to configure Life K-Line

  • ADMIN_VOUCHER_PASSWORDchange-this-to-secure-passwordAdmin password for voucher management

    Admin password for voucher management

  • API_BASE_URLhttps://api.openai.com/v1API service address for self-hosted mode

    API service address for self-hosted mode

  • API_KEYyour-api-key-hereYour API key for the AI service

    Your API key for the AI service

  • API_MODEselfAPI mode selection: self (own AI API) or cloud (official life-kline.com cloud service)

    API mode selection: self (own AI API) or cloud (official life-kline.com cloud service)

    values: self, cloud

  • CLOUD_API_ENDPOINThttps://api.life-kline.com/v1Cloud API endpoint for official service

    Cloud API endpoint for official service

  • CLOUD_API_KEYyour-cloud-api-keyCloud API key for official life-kline.com service

    Cloud API key for official life-kline.com service

  • COST_PER_ANALYSIS50Points consumed per analysis

    Points consumed per analysis

  • DEFAULT_MODELgpt-4Default AI model to use

    Default AI model to use

  • EMAIL_BINDING_REWARD1000Reward points for email binding

    Reward points for email binding

  • EMAIL_SUBSCRIPTION_REWARD1000Reward points for email subscription

    Reward points for email subscription

  • FREE_INIT_POINTS1000Initial points for new users

    Initial points for new users

  • JWT_SECRETplease-change-to-a-random-string-at-least-32-charsJWT secret key (at least 32 characters)

    JWT secret key (at least 32 characters)

  • MAIL_FROMFrom email address (optional)

    From email address (optional)

  • MAIL_PASSWORDSMTP password (optional)

    SMTP password (optional)

  • MAIL_SMTP_HOSTSMTP host for email (optional)

    SMTP host for email (optional)

  • MAIL_SMTP_PORT587SMTP port for email (optional)

    SMTP port for email (optional)

  • MAIL_SMTP_SECUREtrueSMTP secure connection (optional)

    SMTP secure connection (optional)

  • PORT3000Backend server port

    Backend server port

  • SITE_DOMAINlocalhost:5173Your domain name

    Your domain name

  • SITE_NAME人生K线Custom site name

    Custom site name

  • SITE_URLhttp://localhost:5173Full site URL

    Full site URL

Life K-Line releases & version history

FAQ

人生K线测算页是什么?

Life K-Line outputs structured BaZi charts and phase rhythms based on birth time and location: first determines day master and favorable elements, then major/annual luck windows, finally actionable steps for career, wealth, relationships. Suitable for 'judge first then act' decisions, not daily fortune fear-mongering.

如何使用

Fill in birth date, time and location; read the structural axis of day master and favorable elements with current major luck; then choose tools or ask follow-up questions for career/wealth/relationship intent with verifiable checkpoints.

报告是否公开?

Reports can share summary pages; high-quality anonymous cases may enter public content stream after desensitization, private reports can disable public access.

需要准确到时辰吗?

More accurate birth time gives more stable day pillar and favorable elements. Uncertain times can start with rough calculation and note the time precision in the report.

人生K线和普通算命有什么区别?

Life K-Line emphasizes structure, phases, and actionable boundaries, outputting verifiable rhythm judgments rather than replacing real choices or using fear-based fortune-telling.

More in Data Visualization

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…