Content
<div align="center">
# 🔮 MingAI - AI Numerology
**Deeply Integrate Traditional Numerology Culture with AI**
[](https://nextjs.org/)
[](https://www.typescriptlang.org/)
[](https://tailwindcss.com/)
[](https://supabase.com/)
[](https://vercel.com/)
[🌐 Online Experience](https://www.mingai.fun) · [📖 Product Documentation](docs/plans/PRD-MingAI.md) · [🐛 Report Issues](https://github.com/hhszzzz/MingAI/issues)
</div>
---
## ✨ Product Highlights
- 🔮 **Multiple Numerology Systems** - Covering Bazi, Ziwei, Tarot, Six Lines, MBTI, Face Reading, Palmistry, Synastry, Zhou Gong's Dream Interpretation
- 🤖 **AI Intelligent Analysis** - Multi-model support (DeepAI/Gemini/Qwen/DeepSeek/GLM/Kimi), deep reasoning, visual recognition
- 🔌 **MCP Server** - Supports Model Context Protocol (MCP), allowing direct invocation of numerology tools in MCP-enabled clients
- 📚 **Knowledge Base and @Mentions** - Personal knowledge base + explicit data source references, AI explainable
- 🎛️ **AI Personalization** - Expression style/user profile/custom instructions + prompt budget visualization
- 💳 **Subscription and Operation** - Key activation, purchase link configuration, payment switch, AI model/source management
- 📱 **Multi-Platform Experience** - Web + iOS/Android clients, mobile-first
- 💬 **Community and Incentives** - Anonymous discussion, check-in levels, achievement system
- 🔐 **Privacy First** - Row Level Security data isolation, user data security controllable
---
## 🖥️ Feature Preview
| Bazi Chart | Ziwei Dou Shu | AI Chat |
| :----------------------------: | :----------------------------: | :----------------------------: |
| Four Pillars · Ten Gods Interpretation · Divine Star Analysis | Twelve Palaces · Star System · Luck Analysis | Deep Reasoning · Chart Analysis · Search Enhancement |
| Fortune Center | Relationship Synastry | Tarot/Six Lines/MBTI |
| :----------------------------: | :----------------------: | :--------------------------: |
| Daily/Monthly Fortune · Almanac · AI Q&A | Couple/Business/Parent-Child · Trend Curve | Multiple Spreads · Traditional Divination · Personality Analysis |
---
## 🚀 Quick Start
### Environment Requirements
- Node.js 18+
- pnpm (Recommended) / npm / yarn
### Installation and Running
```bash
# Clone the project
git clone git@github.com:hhszzzz/MingAI.git
cd MingAI
# Install dependencies
pnpm install
# Configure environment variables
cp .env.example .env.local
# Edit .env.local and fill in the necessary API Keys
# Start the development server
pnpm dev
```
Visit [http://localhost:3000](http://localhost:3000) to view the application.
---
## 🏗️ Technical Architecture
### Technology Stack
| Category | Technology | Description |
| ------------ | ----------------------------------- | ------------------------ |
| **Frontend Framework** | Next.js 16+ (App Router) | Full-stack React framework |
| **Development Language** | TypeScript 5.x | Strict type checking |
| **Styling Solution** | Tailwind CSS 4.x | Atomic CSS |
| **UI Components** | Lucide React | Icon library |
| **Mobile** | Capacitor 8 | iOS/Android clients |
| **Database** | Supabase (PostgreSQL + pgvector/FTS) | BaaS platform + vector search |
| **Authentication** | Supabase Auth | Email verification/password reset |
| **AI Models** | DeepAI/Gemini/Qwen/DeepSeek/GLM/Kimi | Multi-model support |
| **RAG** | FTS + Trigram + Vector + Reranker | Knowledge base search |
| **Bazi Algorithm** | lunar-javascript | Lunar calendar/stem-branch calculation |
| **Ziwei Algorithm** | iztro | Ziwei Dou Shu charting |
| **Email Service** | Resend | Transactional emails |
| **Deployment Platform** | Vercel + Zeabur | Edge deployment |
| **MCP Server** | Model Context Protocol | Integration of 6 numerology functions |
### Project Structure
```
MingAI/
├── src/
│ ├── app/ # Next.js App Router
│ │ ├── api/ # API Routes
│ │ ├── bazi/ # Bazi Numerology
│ │ ├── ziwei/ # Ziwei Dou Shu
│ │ ├── chat/ # AI Chat
│ │ ├── daily/ # Daily Fortune
│ │ ├── monthly/ # Monthly Fortune
│ │ ├── fortune-hub/ # Fortune Center
│ │ ├── hepan/ # Relationship Synastry
│ │ ├── tarot/ # Tarot Divination
│ │ ├── liuyao/ # Six Lines Divination
│ │ ├── mbti/ # MBTI Test
│ │ ├── face/ # Face Analysis
│ │ ├── palm/ # Palmistry Analysis
│ │ ├── community/ # Numerology Community
│ │ ├── records/ # Numerology Accounting
│ │ ├── user/ # User Center
│ │ └── admin/ # Admin Backend
│ ├── components/ # React Components
│ │ ├── ui/ # Basic UI Components
│ │ ├── layout/ # Layout Components
│ │ ├── auth/ # Authentication Components
│ │ ├── bazi/ # Bazi Components
│ │ ├── ziwei/ # Ziwei Components
│ │ ├── chat/ # Chat Components
│ │ └── membership/ # Membership Components
│ ├── lib/ # Utility Functions
│ │ ├── bazi.ts # Bazi Algorithm
│ │ ├── ziwei.ts # Ziwei Algorithm
│ │ ├── tarot.ts # Tarot Logic
│ │ ├── liuyao.ts # Six Lines Algorithm
│ │ ├── hepan.ts # Synastry Algorithm
│ │ ├── mbti.ts # MBTI Logic
│ │ ├── ai.ts # AI Invocation
│ │ ├── prompt-builder.ts # Prompt Builder
│ │ ├── knowledge-base/ # Knowledge Base
│ │ ├── data-sources/ # Unified Data Source
│ │ ├── mentions.ts # @Mention Parsing
│ │ └── credits.ts # Credit Management
│ ├── tests/ # Test Files
│ ├── types/ # TypeScript Types
│ └── workers/ # Web Workers
├── docs/ # Project Documentation
│ ├── plans/ # Product Planning
│ └── deliverables/ # Development Reports
├── packages/ # Independent Packages
│ ├── mcp-core/ # MCP Core Logic
│ │ ├── src/
│ │ │ ├── tools.ts # Tool Definitions
│ │ │ └── handlers/ # Tool Handlers
│ │ └── package.json
│ ├── mcp-local/ # MCP Local Execution
│ │ ├── src/index.ts # stdio Entry
│ │ └── package.json
│ └── mcp-server/ # MCP Remote Service
│ ├── src/index.ts # SSE Service Entry
│ ├── Dockerfile # Container Deployment
│ └── package.json
├── supabase/ # Database Migrations/Tables
├── android/ # Android Client (Capacitor)
├── ios/ # iOS Client (Capacitor)
├── scripts/ # Build Scripts
├── .github/ # GitHub Actions
└── public/ # Static Assets
```
### Database Design
| Table Name | Purpose |
| --- | --- |
| `users` | User profiles, membership levels, admin flags |
| `user_settings` | Preferences (default chart/sidebar/AI preferences/knowledge base search) |
| `app_settings` | Global configurations (payment switch, etc.) |
| `activation_keys` / `purchase_links` | Key activation and purchase links |
| `ai_models` / `ai_model_sources` / `ai_model_stats` | AI model management and statistics |
| `knowledge_bases` / `knowledge_entries` / `archived_sources` | Knowledge base and archives |
| `conversations` | AI conversation history and source tracking |
| `bazi_charts` / `ziwei_charts` / `tarot_readings` / `liuyao_divinations` / `hepan_charts` / `mbti_readings` | Numerology and divination data |
| `face_readings` / `palm_readings` | Visual analysis records |
| `community_posts` / `community_comments` / `community_votes` / `community_reports` | Numerology community |
| `ming_records` / `ming_notes` | Numerology accounting and notes |
| `reminder_subscriptions` / `scheduled_reminders` / `annual_reports` | Reminders and annual reports |
| `credit_transactions` / `user_levels` / `daily_checkins` / `user_achievements` | Credits and growth system |
| `orders` / `notifications` / `rate_limits` / `login_attempts` | Orders/notifications/rate limits/security |
---
## 📋 Feature Checklist
### ✅ Completed Features
#### Phase 1-3: Core Features
- [x] User Authentication System (Email Registration/Login/Password Reset/Security Restrictions)
- [x] Dark/Light Theme Switching
- [x] Bazi Charting (True Solar Time, Four Pillars, Five Elements, Ten Gods, Divine Stars, Earthly Branch Relationships)
- [x] Ziwei Dou Shu (Twelve Palaces, Stars, Four Transformations, Luck Cycles, Three Directions and Four Cardinal Points)
- [x] AI Chat (Streaming Output, Message Editing, Regeneration, Chart Selector)
- [x] Daily/Monthly Fortune (Calendar View, Almanac, AI Q&A)
- [x] Membership System (Free/Plus/Pro + Pay-as-you-go)
- [x] Push Notification System
#### Phase 4: Feature Expansion
- [x] Relationship Synastry (Couple/Business/Parent-Child, Trend Curves, Communication Suggestions)
- [x] Tarot Divination (Multiple Spreads, 78 Full Interpretations, Reversed Card Determination, Ritual Animation)
- [x] Six Lines Divination (Traditional Coin Toss, Changing Lines, Detailed Explanation of Worldly Branch and Useful God)
- [x] MBTI Personality Test (16 Personalities, AI Intelligent Analysis)
- [x] Fortune Center (Aggregated Entry Point for All Numerology Features)
#### Phase 5: Experience Optimization
- [x] Unified AI History (All AI Analysis Records Integrated into Chat History)
- [x] Ziwei/Bazi Display Optimization (Direct Display of Luck Cycles, Earthly Branch Relationships, Auspicious/Inauspicious Divine Stars)
- [x] Membership Model Tiering (Different Model Permissions for Free/Plus/Pro)
- [x] Default Chart Settings
- [x] Mobile Optimization
#### Phase 6: Community and AI Enhancement
- [x] Blind Bazi Analysis (Sixty Jiazi Startling Guest Formulas)
- [x] Numerology Community (Anonymous Posting, Comments, Voting, Reporting)
- [x] Numerology Accounting (Event Recording, Note-Taking Function)
- [x] Six Lines Feature Upgrade (Strength, Hidden Gods, Changing Lines, Punishment, Clash, Combination, and Harm)
- [x] AI Model Selection Optimization
#### Phase 7: Advanced Features
- [x] Face Analysis (Visual AI, Facial Feature Fortune, Annual Luck)
- [x] Palmistry Analysis (Three Major Lines, Hand Shape Analysis, Mount Interpretation)
- [x] Gamified Incentives (Levels, Experience, Check-in, Achievements)
- [x] Push Notifications and Annual Reports (Solar Term Reminders, Fortune Reminders, PDF Export)
#### Phase 8: Mobile and AI Experience Optimization
- [x] iOS/Android Clients (Capacitor)
- [x] Subscription System Upgrade (Key Activation, Purchase Links, Payment Switch)
- [x] Knowledge Base (Create/Archive/Upload/Search)
- [x] @Mentions + Unified Data Source API
- [x] AI Personalization (Style/Profile/Instructions) + Prompt Budget/Source Display
- [x] Admin AI Service Management (Model/Source/Statistics)
- [x] Zhou Gong's Dream Interpretation Mode
#### Phase 8.5: Refactoring and Experience Optimization
- [x] Instant Bazi Charting, Four Pillars Charting
- [x] Six Lines Divination Selection, Hexagram Information Copying
- [x] Mobile Custom Bottom Bar and Menu
- [x] Dark Mode Support for System Switching
- [x] AI Streaming Output and Response Speed Optimization
- [x] Birth Location Coverage for All Districts/Counties
- [x] History Record UI Optimization
- [x] Project Performance and Loading Speed Optimization
#### Phase 8.6: MCP Support
### 🔜 Development Plan
#### Phase 9: Future Features
- [ ] I Ching Divination
- [ ] Name Analysis
- [ ] Auspicious Date Selection
- [ ] WeChat Ecosystem Integration (Login, Payment, Sharing)
---
## 💰 Membership System
| Level | Price | Limit | Recovery Rule | Model Permissions |
| -------- | -------- | -------- | ------------------- | ----------------------------------------- |
| **Free** | ¥0 | 3 | +1 daily, up to 3 | Basic Models (DeepSeek/GLM-4.6/Kimi) |
| **Plus** | ¥29.9/month | 50 | +5 daily, up to 50 | Reasoning Models (DeepSeek Pro/GLM-4.7/Gemini) |
| **Pro** | ¥99/month | 200 | +1 hourly, up to 200 | All Models Available (including DeepAI) |
**Limit Description**: 1 limit = 1 conversation
**Pay-as-you-go**: ¥9.9 = 1 limit
**Subscription Method**: Key Activation (`sk-xxxx`), Purchase Links Configured by Admin
---
## 🔌 MCP Server
MingAI provides an MCP (Model Context Protocol) Server, allowing direct invocation of numerology tools in MCP-enabled clients.
### Supported Tools
| Tool | Function |
| --- | --- |
| `bazi_calculate` | Bazi Calculation |
| `ziwei_calculate` | Ziwei Calculation |
| `daily_fortune` | Daily Fortune |
| `monthly_fortune` | Monthly Fortune |
| `tarot_draw` | Tarot Draw |
| `liuyao_divine` | Liuyao Divination |
| `hepan_analyze` | Relationship Compatibility Analysis |
### MCP Configuration
Detailed [Manual](/docs/plans/MCP-Server-Manual.md)
#### Method 1: Local
```json
{
"mcpServers": {
"mingai": {
"command": "npx",
"args": ["tsx", "/path/to/MingAI/packages/mcp-local/src/index.ts"],
}
}
}
```
#### Method 2: Remote Server
```json
{
"mcpServers": {
"mingai": {
"url": "https://localhost:3000/sse",
"headers": {
"x-api-key": "your API key"
}
}
}
}
```
---
## 📚 Documents
| Document | Description |
| ----------------------------------------------------------------- | ------------ |
| [PRD](docs/plans/PRD-MingAI.md) | Product Requirements Document |
| [Phase 1 Report](docs/deliverables/Phase1-MVP-Completion-Report.md) | MVP Completion Report |
| [Phase 2 Report](docs/deliverables/Phase2-Completion-Report.md) | Experience Enhancement Report |
| [Phase 3 Report](docs/deliverables/Phase3-Completion-Report.md) | Feature Improvement Report |
| [Phase 4 Report](docs/deliverables/Phase4-Completion-Report.md) | Feature Expansion Report |
| [Phase 5 Report](docs/deliverables/Phase5-Completion-Report.md) | Experience Optimization Report |
| [Phase 6 Report](docs/deliverables/Phase6-Completion-Report.md) | Community & AI Enhancement |
| [Phase 7 Report](docs/deliverables/Phase7-Completion-Report.md) | Advanced Features Report |
| [Phase 8 Report](docs/deliverables/Phase8-Completion-Report.md) | Mobile & AI Experience |
---
## 🛠️ Development Commands
```bash
# Development
pnpm dev # Start development server
# Build
pnpm build # Production build
pnpm start # Start production server
# Code Quality
pnpm lint # ESLint check
pnpm test # Run tests
```
---
## 🤝 Contributing
Welcome to submit Issues and Pull Requests!
---
## 📄 License
This project is for learning and communication purposes only.
---
<div align="center">
**MingAI** - Interpret destiny with AI, inherit culture with technology
Made with ❤️ by [hhszzzz](https://github.com/hhszzzz)
</div>
MCP Config
Below is the configuration for this MCP Server. You can copy it directly to Cursor or other MCP clients.
mcp.json
Connection Info
You Might Also Like
markitdown
Python tool for converting files and office documents to Markdown.
Fetch
Retrieve and process content from web pages by converting HTML into markdown format.
oh-my-opencode
Background agents · Curated agents like oracle, librarians, frontend...
chatbox
User-friendly Desktop Client App for AI Models/LLMs (GPT, Claude, Gemini, Ollama...)
continue
Continue is an open-source project for seamless server management.
semantic-kernel
Build and deploy intelligent AI agents with Semantic Kernel's orchestration...