- Added 11 PDF price list files to public/documents/ - Updated 7 product pages with downloadable PDF sections: - ฉนวนหุ้มท่อ-pipe-insulation (4 PDFs) - เทอร์โมเบรค-thermobreak (1 PDF) - ท่อhdpe (1 PDF) - เม็กกรู๊ฟ-คับปลิ้ง (1 PDF) - ท่อระบายน้ำ-3-ชั้น-ไซเลนท (2 PDFs) - ท่อพีพีอาร์ตราช้าง (1 PDF) - ท่อ-ppr-thai-ppr (1 PDF) - Updated AGENTS.md files with PDF/document structure
91 lines
3.8 KiB
Markdown
91 lines
3.8 KiB
Markdown
# dealplustech-astro/
|
|
|
|
**Generated:** 2026-03-27
|
|
**Branch:** main
|
|
|
|
## OVERVIEW
|
|
|
|
Astro 5.x Thai industrial e-commerce site (dealplustech.co.th). Migrated from WordPress. PDPA-compliant cookie consent, Umami analytics, 63 pages, 45 Thai-named routes.
|
|
|
|
## STRUCTURE
|
|
|
|
```
|
|
dealplustech-astro/
|
|
├── src/
|
|
│ ├── components/ # .astro components (common/, consent/, product/, ui/)
|
|
│ ├── content/ # Astro content collections (blog/, products/) - EMPTY
|
|
│ ├── layouts/ # BaseLayout.astro (root HTML shell)
|
|
│ ├── pages/ # 45 Thai-named static routes + index.astro
|
|
│ ├── styles/ # global.css
|
|
│ ├── images/ # ppr-tables/ (product reference images)
|
|
│ └── lib/ # EMPTY
|
|
├── public/
|
|
│ ├── images/ # All product/corporate images (dist/, public/ mirrored)
|
|
│ └── documents/ # PDF price lists (11 PDFs linked from product pages)
|
|
├── db/ # EMPTY (SQLite/Turso for consent logs at runtime)
|
|
├── astro.config.mjs # Astro config: site URL, i18n (th only), sitemap
|
|
├── tailwind.config.js # Kanit font, custom colors (primary green, accent orange)
|
|
├── Dockerfile # Multi-stage: node:20-alpine → nginx:alpine
|
|
└── package.json # Scripts: dev, build, preview, db:push, db:seed
|
|
```
|
|
|
|
## WHERE TO LOOK
|
|
|
|
| Task | Location | Notes |
|
|
|------|----------|-------|
|
|
| Global layout | `src/layouts/BaseLayout.astro` | HTML shell, SEO meta, cookie consent |
|
|
| Homepage | `src/pages/index.astro` | 13KB - main entry |
|
|
| Product pages | `src/pages/[thai-url]/index.astro` | 45 static routes |
|
|
| Header/Footer | `src/components/common/` | Header.astro, Footer.astro |
|
|
| Cookie consent | `src/components/consent/` | EMPTY - handled via astro-consent |
|
|
| API routes | `src/pages/api/` | EMPTY - no API routes configured |
|
|
| Content config | `src/content.config.ts` | Content collections definition |
|
|
|
|
## CONVENTIONS
|
|
|
|
- **Thai URLs only** — Never use English URLs for routes
|
|
- **Astro components** — `.astro` files with frontmatter imports
|
|
- **Kanit font** — Thai-optimized, set in tailwind.config.js
|
|
- **Cookie consent** — astro-consent package, blocks analytics until accepted
|
|
- **Umami analytics** — Requires `UMAMI_WEBSITE_ID` env var
|
|
- **Admin password** — Required for consent log access at `/admin/consent-logs`
|
|
|
|
## ANTI-PATTERNS (THIS PROJECT)
|
|
|
|
- Do NOT add TypeScript entry points (no `src/main.ts`)
|
|
- Do NOT use English route names — SEO depends on Thai URLs
|
|
- Do NOT modify `dist/` directly — it's gitignored build output
|
|
- Do NOT run crawlers from Python in production environment
|
|
- Do NOT commit `.env` files
|
|
|
|
## UNIQUE STYLES
|
|
|
|
- **Custom Tailwind colors**: primary (green #3f8b6d), accent (orange #e35c18)
|
|
- **PDPA compliance**: 14-disclosure privacy policy, granular cookie consent
|
|
- **Custom animations**: fade-in, slide-up, slide-down, scale-in
|
|
- **i18n**: Thai-only site, `prefixDefaultLocale: false`
|
|
- **Image organization**: Mirrored `public/images/` and `dist/images/`
|
|
|
|
## COMMANDS
|
|
|
|
```bash
|
|
cd dealplustech-astro
|
|
|
|
npm install # Install dependencies
|
|
npm run dev # Dev server at localhost:4321
|
|
npm run build # Production build → dist/
|
|
npm run preview # Preview built site
|
|
|
|
# Database
|
|
npm run db:push # Push schema to SQLite/Turso
|
|
npm run db:seed # Seed database
|
|
```
|
|
|
|
## NOTES
|
|
|
|
- **No tests** — `package.json` has no test script
|
|
- **Easypanel deploy** — Auto-deploys on push to main, uses `npm install` then `npm run build`
|
|
- **Image pipeline** — Python `image_processor.py` processes downloaded images
|
|
- **Consent logs** — SQLite at `db/consent.db` (gitignored), or Turso if configured
|
|
- **PDF price lists** — 11 PDFs in `public/documents/`, linked from 7 product pages with "ราคาสินค้า" section
|