# CodeHub — AI-Readable Instructions

> Generated: 2026-07-08 07:31 UTC
> Total projects: 2
> Total versions: 5

---

## สำหรับ AI ตัวอ่าน

ไฟล์นี้คือ aggregated AI instructions ของทุกโปรเจกต์ทุกเวอร์ชั่นใน CodeHub
อ่านไฟล์นี้แล้วคุณจะเข้าใจว่า:
1. ผู้ใช้สั่งอะไร (`user_cmd`)
2. AI ตอบว่าอะไร (`ai_response`)
3. มีอะไรเปลี่ยน (`what_changed`)
4. ใช้ tech อะไร
5. deploy ที่ไหน

จากนั้นคุณสามารถ:
- เพิ่มเวอร์ชั่นใหม่: ดู schema ใน CodeHub v1.0 project
- แก้ไข: ดู version ที่เกี่ยวข้อง แล้ว patch `meta.json`
- deploy ใหม่: `ssh root@5.231.28.248 'python3 /mnt/16tb/codehub/builder/generate.py'`

---

# 📦 AI Data Analyzer (ai-data-analyzer) {#ai_data_analyzer}

**Category**: Other  
**Tags**: csv, xlsx, charts, auto-ai, heatmap, filters, insights, regression  
**Tech**: Papa Parse, SheetJS, Chart.js v4, chartjs-chart-matrix v2, Google Fonts  
**Created**: 2026-07-08  
**Live**: http://178.83.121.75:50900/  

**Description**: โยนไฟล์อะไรมา คอลั่มแบบไหนก็คิดและเอามาทำกราฟ — รองรับ CSV/TSV/JSON/XLSX auto-detect type + heatmap + filters + insights

**Versions**: 4

## v1.3 — Test upload — verify SQL sync

**Date**: 2026-07-08  
**Status**: released  
**Files changed**: 1  
**Lines added**: +0  

### 🗣️ User Command

```
Test SQL sync
```

### 🤖 AI Response

```
Phase 11+ catches the change
```

### ✅ What Changed


---

## v1.2 — AI Data Analyzer v1.2 — Heatmap + Filters + Insights + Pagination

**Date**: 2026-07-08  
**Status**: released  
**Files changed**: 1  
**Lines added**: +920  
**Deployed**: http://178.83.121.75:50900/  

### 🗣️ User Command

```
อยากได้ heatmap + กรองข้อมูลตาม category + insights panel + pagination
```

### 🤖 AI Response

```
เพิ่ม heatmap matrix (chartjs-chart-matrix) + filter chips per categorical column + insights panel (totals/avg/range/diversity/missing) + 50-row pagination with prev/next/jump
```

### ✅ What Changed

- Heatmap chart — cat1 × cat2 matrix with numeric z-value (avg), color intensity scale
- Filter chips — click categorical values to filter (multi-select), live re-render of all charts with filtered data
- Insights panel — 5 insight cards: total/avg of numeric col, range, date range, most diverse categorical, missing cell %
- Missing data warning (>30% = ⚠️ high missing rate)
- Pagination — 50 rows/page with « ‹ 1/3 › » buttons
- Sidebar layout — column types + filters + file meta in sticky sidebar, charts+preview in main column
- KPI shows 'After filter' count vs 'Total rows' so you see filter impact at a glance

---

## v1.1 — AI Data Analyzer v1.1 — XLSX + scatter + regression + e-commerce sample

**Date**: 2026-07-08  
**Status**: released  
**Files changed**: 1  
**Lines added**: +600  
**Deployed**: http://178.83.121.75:50900/  

### 🗣️ User Command

```
เพิ่ม .xlsx .tsv และ chart แบบ scatter พร้อม linear regression
```

### 🤖 AI Response

```
เพิ่ม SheetJS (XLSX/XLS) + scatter chart with linear regression line + r-value display + line chart for date-time series + 3rd sample dataset (e-commerce 600 rows with order_id/category/channel/month/quantity/price/rating/returned)
```

### ✅ What Changed

- XLSX support via SheetJS (reads .xlsx and .xls, converts numeric cells to strings for consistent type detection)
- Scatter chart with linear regression — slope + intercept + r-value displayed inline in legend
- Time-series line chart — date × numeric aggregated by month with filled area
- 3rd sample dataset — e-commerce 600 orders across 12 months × 6 products × 2 channels
- Each KPI card has color-coded accent bar (green/orange/blue/purple)

---

## v1.0 — AI Data Analyzer v1.0 — Any file → Auto charts

**Date**: 2026-07-08  
**Status**: released  
**Files changed**: 1  
**Lines added**: +460  
**Deployed**: http://178.83.121.75:50900/  

### 🗣️ User Command

```
โยนไฟล์อะไรมา คอลั่มแบบไหนก็คิดและเอามาทำกราฟ
```

### 🤖 AI Response

```
vanilla HTML + Papa Parse (CSV/TSV/JSON) + Chart.js + auto-detect column types (>85% confidence) + auto-suggest 3 chart types (histogram, top categories bar, doughnut) + 6 KPI cards + 50-row preview
```

### ✅ What Changed

- Single index.html 19KB — drop any CSV/TSV/JSON, get 3 charts auto
- Type detection — number/date/boolean/text with >85% confidence threshold
- Histogram with auto-bucketing into 12 bins
- Top 10 categories by numeric sum (horizontal bar)
- Doughnut distribution for text columns
- 2 sample datasets (sales 576 rows, survey 1000 rows)

---

# 📚 CodeHub (codehub) {#codehub}

**Category**: Dev Tools  
**Tags**: versioning, docs, ai-readable, static-site, 16tb  
**Tech**: vanilla HTML, Python build script, nginx, Let's Encrypt, XFS 16TB  
**Created**: 2026-07-08  
**Live**: https://codehub.sj88ai.com  

**Description**: เก็บ code ทุกเวอร์ชั่นพร้อม screenshot + คำสั่ง + คำตอบ AI เพื่อให้ AI ตัวอ่านอ่านแล้วทำตามได้

**Versions**: 1

## v1.0 — CodeHub v1.0 — Static foundation + AI-readable docs

**Date**: 2026-07-08  
**Status**: released  
**Files changed**: 12  
**Lines added**: +1,850  
**Deployed**: https://codehub.sj88ai.com  

### 🗣️ User Command

```
อยากทำ codehub เก็บ code เป็นเวอร์ชั่นทุกเวอร์ชั่น (ไปเก็บลูก 16tb) ทำแนวๆ http://62.84.178.0:3001/ เก็บรวม code และคำสั่ง แต่ล่ะเวอร์ชั่นและหน้าตาทุกเวอร์ชั่น และมีหน้าให้ Ai ตัวอ่านอ่านและทำตาม ผลมันต้องคล้ายๆแบบนี้คือ http://62.84.178.0:3001/ ให้เก็บทุกเวอร์ชั่น หน้าแรกมีหน้า รวม code พร้อมสกีน short พร้อม จัดหมวดหมู่ ออกแบบเวอร์ชั่นแรกมา วางแผนทำไว้ 10 เฟส ทำเฟสแรกมาก่อน ทำ SSL และ Deploy codehub.sj88ai.com points to 5.231.28.248
```

### 🤖 AI Response

```
วางแผน 10 เฟส ลุยเฟส 1: โครงสร้าง 16TB + seed 7 โปรเจกต์ + index.html แบบ journey-page + nginx+SSL + /ai-instructions.md สำหรับ AI ตัวอ่าน
```

### ✅ What Changed

- สร้าง data structure บน /mnt/16tb/codehub/ (projects.json + projects/<slug>/versions/vX/)
- สร้าง builder/generate.py ที่ scan โครงสร้างแล้ว gen static HTML ลง /mnt/16tb/codehub/www/
- หน้าแรก hero + grid โปรเจกต์แยกหมวดหมู่ พร้อม screenshot + live URL
- หน้าโปรเจกต์ journey-page แบบ 62.84.178.0:3001 มี TOC + version section (user cmd / AI response / what changed)
- endpoint /ai-instructions.md รวมทุก user_cmd + ai_response ทุกโปรเจกต์ทุกเวอร์ชั่น ให้ AI ตัวอ่านอ่านได้
- nginx vhost + Let's Encrypt SSL ที่ codehub.sj88ai.com

**Screenshots**: 3 image(s)

---
