Wire production domain, CORS for tenant subdomains, celery volume mounts, and nginx reverse proxy configs for apex, API, identity, auth, and wildcard tenants. Co-authored-by: Cursor <cursoragent@cursor.com>
44 lines
1.3 KiB
Markdown
44 lines
1.3 KiB
Markdown
# Frontend (Next.js)
|
|
|
|
اپلیکیشن frontend کاملاً جدا از backend است.
|
|
|
|
## مسئولیتها
|
|
- UI، Dashboard، Forms، Pages، Components
|
|
- State Management، API Client، Theme (White-label)
|
|
|
|
## قوانین
|
|
- **هیچ** کد FastAPI، SQLAlchemy، Alembic یا Business Logic در این پوشه نیست.
|
|
- ارتباط با backend **فقط** از طریق REST API (`lib/api-client.ts`).
|
|
- برند از `public/theme.config.json` یا API خوانده میشود (بدون hardcode).
|
|
|
|
## راهاندازی
|
|
|
|
**پیشنهادی (همراه کل پلتفرم):**
|
|
```bash
|
|
# از ریشه پروژه
|
|
docker compose up -d --build
|
|
```
|
|
|
|
**اجرای مستقیم (دیباگ UI):**
|
|
```bash
|
|
cd frontend
|
|
npm install
|
|
npm run dev
|
|
```
|
|
|
|
Frontend: http://localhost:3000
|
|
|
|
## تکنولوژی
|
|
- Next.js **15.5.18** (پچ امنیتی — نسخه 14 دیگر پشتیبانی CVE ندارد)
|
|
- React 19، TypeScript، TailwindCSS
|
|
## ساختار
|
|
```
|
|
frontend/
|
|
├── app/ # صفحات و layout (Next.js App Router)
|
|
├── components/ # کامپوننتهای UI
|
|
├── hooks/ # React hooks
|
|
├── lib/ # API client، theme، utilities
|
|
├── styles/ # CSS global و Tailwind
|
|
└── public/ # فایلهای استاتیک و theme.config.json
|
|
```
|