Hướng dẫn cài đặt và chạy HeyTeX trên Mac Mini M2.
- macOS (Apple Silicon M2)
- Homebrew (sẽ tự động cài nếu chưa có)
- Node.js >= 18.0.0 (✅ đã có v25.2.1)
cd /Users/mac/heytex
./setup-mac.shScript này sẽ:
- ✅ Cài đặt PostgreSQL 16
- ✅ Cài đặt MinIO
- ✅ Tạo database và user cho HeyTeX
- ✅ Cài đặt tất cả Node.js dependencies
- ✅ Setup Prisma database schema
Thời gian: Khoảng 5-10 phút tùy tốc độ mạng.
./start-mac.shSau khi setup xong, bạn có 2 options:
Terminal 1 - Backend Server:
cd /Users/mac/heytex/server
npm run devTerminal 2 - Frontend Client:
cd /Users/mac/heytex/client
npm run devTruy cập:
- Frontend: http://localhost:5173
- Backend API: http://localhost:3001
cd /Users/mac/heytex/texlyre
npm install # chỉ cần chạy 1 lần
npm run startTruy cập:
Ưu điểm:
- ✅ Đơn giản, không cần backend phức tạp
- ✅ Đã được test kỹ, ổn định
- ✅ Hỗ trợ cả LaTeX và Typst
- ✅ Local-first architecture
./start-mac.sh./stop-mac.shpg_isready -h localhost -p 5432curl http://localhost:9000/minio/health/liveTruy cập MinIO Console tại: http://localhost:9001
- Username:
heytex_admin - Password:
heytex_minio_2024
/Users/mac/heytex/
├── server/ # Backend (Node.js + Express + Socket.IO)
│ ├── .env # Cấu hình database, MinIO, JWT
│ └── src/
├── client/ # Frontend (React + Vite)
│ ├── .env # Cấu hình API URLs
│ └── src/
├── texlyre/ # TeXlyre standalone (⭐ Recommended)
├── data/
│ └── minio/ # MinIO storage data
├── setup-mac.sh # Script cài đặt
├── start-mac.sh # Script khởi động services
└── stop-mac.sh # Script dừng services
brew services restart postgresql@16
brew services listpkill -f "minio server"
./start-mac.sh# Kiểm tra port đang sử dụng
lsof -i :5173 # Frontend
lsof -i :3001 # Backend
lsof -i :9000 # MinIO
lsof -i :5432 # PostgreSQL
# Kill process
kill -9 <PID>cd /Users/mac/heytex/server
npx prisma db push --force-resetcd /Users/mac/heytex
rm -rf node_modules server/node_modules client/node_modules
npm install
cd server && npm install && cd ..
cd client && npm install && cd ..tail -f /Users/mac/heytex/data/minio/minio.logtail -f /opt/homebrew/var/log/postgresql@16.logcd /Users/mac/heytex/server
npm update
cd /Users/mac/heytex/client
npm updateDATABASE_URL="postgresql://heytex:heytex_secure_2024@localhost:5432/heytex?schema=public"
JWT_SECRET="heytex_jwt_secret_change_in_production_2024"
MINIO_ENDPOINT="127.0.0.1"
MINIO_PORT=9000
PORT=3001VITE_API_URL=/api
VITE_SOCKET_URL=/Nếu gặp vấn đề:
- Kiểm tra các services đang chạy
- Xem logs của từng service
- Thử restart services:
./stop-mac.shvà./start-mac.sh
- README.md - Tổng quan dự án
- FIX_GUIDE.md - Hướng dẫn fix các vấn đề thường gặp
- Assessment.md - Đánh giá và phân tích dự án