Files
star-erp/README.md

82 lines
2.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Koori ERP
本專案是一個基於 Laravel 12, Inertia.js (React) 與 Tailwind CSS 開發的 ERP 系統。
## 開發環境需求
- **WSL2** (Windows 建議環境)
- **Docker Desktop** 或 **Docker Engine**
- **PHP 8.5+** (本地端若需執行基礎 composer 指令,或直接使用 Sail 容器)
- **Node.js 20+**
## 啟動步驟
本專案使用 [Laravel Sail](https://laravel.com/docs/12.x/sail) 作為 Docker 開發環境。
### 1. 安裝依賴 (初次啟動)
建立目錄mkdir 檔案名稱 && cd 檔案名稱
抓取代碼git clone http://git網址/帳號/專案.git .
如果您是第一次 clone 專案,請先安裝 PHP 與 JS 依賴:
```bash
# 初始化 .env 檔案
cp .env.example .env
```
### 2. 啟動 Docker 容器
在專案根目錄執行:
```bash
# 背景執行容器
docker compose up -d --build
docker exec -it koori-erp-laravel.test-1 composer install
# 生成 App Key
docker exec -it koori-erp-laravel.test-1 php artisan key:generate
```
### 3. 資料庫遷移與初始化
```bash
# (選填) 如果有種子資料
docker exec -it koori-erp-laravel.test-1 php artisan migrate --seed
```
### 4. 啟動前端開發伺服器 (Vite)
```bash
docker exec -it koori-erp-laravel npm install
docker exec -it koori-erp-laravel npm run dev
```
啟動後,您可以透過以下連結瀏覽專案:
- **後台網址**: [http://localhost](http://localhost)
- **Vite 伺服器**: [http://localhost:5174](http://localhost:5174)
## 常用 Sail 指令
- **停止服務**: `./vendor/bin/sail stop`
- **執行 Artisan 指令**: `./vendor/bin/sail artisan ...`
- **執行 Composer 指令**: `./vendor/bin/sail composer ...`
- **執行測試**: `./vendor/bin/sail test`
## 技術棧
- **Backend**: Laravel 12
- **Frontend**: React (Functional Components) via Inertia.js
- **Styling**: Tailwind CSS
- **Database**: MySQL 8.0
- **Cache/Session**: Redis
## 開發規範
請參考專案內的開發文件或 AI 指導規則,確保 UI/UX 元件與後端邏輯符合專案架構。