📦 Hướng dẫn Cài đặt CivicTwin AI
Hướng dẫn chi tiết để cài đặt và chạy CivicTwin AI trên máy local hoặc server
🔧 Yêu cầu Hệ thống
Yêu cầu Cơ bản
- OS: Linux, macOS, Windows (WSL2)
- RAM: Tối thiểu 8GB (khuyến nghị 16GB)
- Disk: 20GB trống (để dữ liệu + model AI)
- Internet: Kết nối ổn định
Nếu dùng Docker (Khuyến nghị ✅)
| Công nghệ | Phiên bản | Ghi chú |
|---|---|---|
| Docker | 20.10+ | Tải Docker Desktop |
| Docker Compose | 2.0+ | Đi kèm Docker Desktop |
| Git | 2.30+ | Tải Git |
Lợi ích: Không cần cài Node.js, PostgreSQL, Redis... Tất cả đã có trong containers!
Nếu KHÔNG dùng Docker
| Công nghệ | Phiên bản | Mục đích |
|---|---|---|
| Node.js | 18.0+ | Backend API, Microservices |
| npm/yarn | 9.0+ | Package manager |
| PostgreSQL | 12.0+ | Main database |
| PostGIS | 3.0+ | Geospatial extension |
| Python | 3.9+ | AI prediction models |
| Redis | 6.0+ | Caching & sessions |
🚀 Cài đặt Nhanh (5 phút)
Bước 1: Clone Repository
git clone https://github.com/asean-ai/civic-twin.git
cd civic-twin
Bước 2: Tạo file .env
cp .env.example .env
Chỉnh sửa .env (đặc biệt các dòng):
# Database
DATABASE_URL=postgresql://civic_user:civic_pass@postgres:5432/civic_twin
POSTGIS_ENABLED=true
# AWS (Bedrock) - Để dùng AI prediction
AWS_REGION=us-east-1
AWS_ACCESS_KEY_ID=your_aws_key
AWS_SECRET_ACCESS_KEY=your_aws_secret
# Application
NODE_ENV=development
PORT=3000
# Maps
MAPBOX_TOKEN=your_mapbox_token # Optional, lấy từ https://mapbox.com
# Redis
REDIS_URL=redis://redis:6379
# Session
SESSION_SECRET=your_secret_key_here