Update README file
This commit is contained in:
+21
-16
@@ -1,33 +1,38 @@
|
|||||||
# فرانتاند گروه ساختمانی آرامش
|
|
||||||
|
|
||||||
سایت React + Vite + Tailwind — تمام متنها و تصاویر از بکاند (`GET /api/site`) خوانده میشود.
|
|
||||||
|
|
||||||
## اجرا
|
# Aramesh Construction Group — Frontend
|
||||||
|
|
||||||
|
A React + Vite + Tailwind CSS application. All text content and assets are fetched dynamically from the backend API (`GET /api/site`).
|
||||||
|
|
||||||
|
## Typography
|
||||||
|
The **Pinar** font is installed and served locally. The application no longer relies on any external servers or CDNs for font rendering.
|
||||||
|
|
||||||
|
## Development Setup
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm install
|
npm install
|
||||||
npm run dev
|
npm run dev
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
در حالت توسعه، Vite درخواستهای `/api` و `/media` را به Traefik (پورت ۵۱۷۳) پروکسی میکند —
|
In development mode, Vite proxies `/api` and `/media` requests to Traefik (port 5173). Therefore, the Docker stack must be running.
|
||||||
پس استک Docker باید در حال اجرا باشد. آدرس بکاند در `src/config.ts` از `VITE_API_URL`
|
The backend API URL is read from the `VITE_API_URL` environment variable in `src/config.ts`; an empty default implies same-origin requests.
|
||||||
خوانده میشود؛ پیشفرض خالی یعنی درخواستهای هممبدأ.
|
|
||||||
|
|
||||||
## ساخت
|
## Build & Production
|
||||||
|
|
||||||
بیلد روی هاست انجام میشود (کانتینر فقط با Caddy فایلهای `dist/` را سرو میکند):
|
The build process runs on the host machine. The Docker container only serves the generated static files in the `dist/` directory using Caddy:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm run build
|
npm run build
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
> نکته: بکاند برای تزریق متای سئو در صفحات `/blog` و `/projects` همین پوشه `dist/` را
|
> **Note:** The backend reads the `dist/` directory (mounted at `/srv/frontend` in Docker Compose) to inject SEO metadata into the `/blog` and `/projects` pages. After making any frontend changes, running `npm run build` and restarting the backend is sufficient.
|
||||||
> (در compose به `/srv/frontend` سوار است) میخواند — بعد از هر تغییر فرانت، `npm run build`
|
|
||||||
> و سپس ریاستارت بکاند کافی است.
|
|
||||||
|
|
||||||
## بخشهای کلیدی
|
## Key Modules & Architecture
|
||||||
|
|
||||||
|
* `src/api.tsx` — Handles site data loading and draft article merging for the admin view.
|
||||||
|
* `src/admin/` — Live editing layer (Digital Twin): includes the admin toolbar, entity drawers, and the article editor.
|
||||||
|
* `src/seo.ts` — Manages page-level SEO tags (Title, Description, Open Graph, Canonical, JSON-LD).
|
||||||
|
* `src/data/site.ts` — Shared TypeScript data models and interfaces.
|
||||||
|
|
||||||
- `src/api.tsx` — بارگذاری داده سایت و ادغام پیشنویس مقالهها برای ادمین
|
|
||||||
- `src/admin/` — لایه ویرایش زنده (دوقلوی دیجیتال): نوار مدیریت، کشوی موجودیتها، صفحه نوشتن مقاله
|
|
||||||
- `src/seo.ts` — تگهای title / description / OG / canonical / JSON-LD هر صفحه
|
|
||||||
- `src/data/site.ts` — انواع داده مشترک
|
|
||||||
|
|||||||
Reference in New Issue
Block a user