diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..dcd81ee --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,250 @@ +# AI Agent Work Log - MoreMiniMore Website + +**Project:** MoreMiniMore Website Redesign +**Repository:** https://git.moreminimore.com/kunthawat/moreminimore-website.git +**Current Commit:** c6b56b9 - Fix: Change text-xs and text-sm to text-base +**Last Updated:** March 10, 2026 + +--- + +## ๐Ÿ“ Current Status + +**Status:** โœ… **Reverted to Original Design** +**Deployed:** Yes (Easypanel auto-deploy) +**Branch:** main + +--- + +## ๐Ÿ”„ Recent History + +### March 10, 2026 - REVERTED + +**Action:** Reverted all PDPA compliance changes +**Commit:** `c6b56b9` +**Reason:** User requested revert to original design + +**What Was Removed:** +- โŒ Cookie consent system +- โŒ Consent logging database (Astro DB) +- โŒ Admin dashboard +- โŒ API endpoints for consent +- โŒ Updated Privacy Policy (PDPA version) +- โŒ Updated Terms & Conditions (PDPA version) +- โŒ Thai company name (เธกเธญเธฃเนŒเธกเธดเธ™เธดเธกเธญเธฃเนŒ) + +**What Was Restored:** +- โœ… Blog pages (`src/pages/blog/`) +- โœ… Blog category pages (`src/pages/category/`) +- โœ… Original company name: "MoreminiMore" +- โœ… Original Privacy Policy & Terms + +**Backup Branch:** `backup-before-revert-20260310` + +--- + +### March 9-10, 2026 - PDPA Implementation (REVERTED) + +**Previous Work (Now on backup branch):** + +**Features Implemented:** +1. **Cookie Consent System** + - Simplified Accept/Reject buttons + - Consent logging to Astro DB + - Umami Analytics integration (conditional loading) + +2. **Admin Dashboard** + - URL: `/admin/consent-logs` + - Password: `moreminimore2026!Secure` + - View/delete consent records + +3. **API Endpoints** + - `POST /api/consent` - Log consent + - `GET /api/consent` - Retrieve records + - `DELETE /api/consent/:sessionId` - Right to be Forgotten + +4. **Legal Pages** + - Privacy Policy (14-section PDPA compliance) + - Terms & Conditions (17 sections) + +5. **Company Name Update** + - Changed to: "เธกเธญเธฃเนŒเธกเธดเธ™เธดเธกเธญเธฃเนŒ" / "เธšเธฃเธดเธฉเธฑเธ— เธกเธญเธฃเนŒเธกเธดเธ™เธดเธกเธญเธฃเนŒ เธˆเธณเธเธฑเธ”" + +6. **Blog Removal** + - Removed all blog content + - Removed blog navigation + +**Docker Configuration (Final Working Version):** +```dockerfile +FROM node:20-alpine AS builder +WORKDIR /app +COPY package*.json ./ +RUN npm ci +COPY . . +RUN mkdir -p ./data && ASTRO_DB_REMOTE_URL=file:./data/consent.db npx astro build --remote + +FROM node:20-alpine +WORKDIR /app +COPY package*.json ./ +RUN npm install --production +COPY --from=builder /app/dist ./dist +COPY --from=builder /app/db ./db +COPY --from=builder /app/data ./data + +RUN apk add --no-cache sqlite-libs + +EXPOSE 80 + +ENV NODE_ENV=production +ENV ASTRO_DB_REMOTE_URL=file:/app/data/consent.db +ENV HOST=0.0.0.0 +ENV PORT=80 +ENV ADMIN_PASSWORD=moreminimore2026!Secure + +CMD ["node", "dist/server/entry.mjs"] +``` + +**Lessons Learned:** +1. Always test build locally before deploying +2. Use `node dist/server/entry.mjs` for production (not `astro preview`) +3. Docker containers need `HOST=0.0.0.0` environment variable +4. Astro DB requires `--remote` flag and data directory creation +5. Simplified cookie consent (Accept/Reject) works better than granular options + +**Documentation Created:** +- `WEBSITE-CREATOR-IMPROVEMENTS.md` - Lessons for skill improvement +- `PDPA-COMPLIANCE-SUMMARY.md` - Implementation guide (removed) + +--- + +## ๐Ÿ“ Project Structure (Current) + +``` +moreminimore-redesign/ +โ”œโ”€โ”€ src/ +โ”‚ โ”œโ”€โ”€ pages/ +โ”‚ โ”‚ โ”œโ”€โ”€ blog/ โœ… Restored +โ”‚ โ”‚ โ”œโ”€โ”€ category/ โœ… Restored +โ”‚ โ”‚ โ”œโ”€โ”€ index.astro +โ”‚ โ”‚ โ”œโ”€โ”€ about-us.astro +โ”‚ โ”‚ โ”œโ”€โ”€ services.astro +โ”‚ โ”‚ โ”œโ”€โ”€ contact-us.astro +โ”‚ โ”‚ โ”œโ”€โ”€ privacy-policy.astro (original version) +โ”‚ โ”‚ โ””โ”€โ”€ terms-and-conditions.astro (original version) +โ”‚ โ”œโ”€โ”€ components/ +โ”‚ โ”œโ”€โ”€ layouts/ +โ”‚ โ”‚ โ””โ”€โ”€ Layout.astro +โ”‚ โ””โ”€โ”€ styles/ +โ”œโ”€โ”€ public/ +โ”‚ โ””โ”€โ”€ branding/ +โ”œโ”€โ”€ Dockerfile +โ”œโ”€โ”€ package.json +โ””โ”€โ”€ README.md +``` + +--- + +## ๐Ÿ”ง Technical Stack + +- **Framework:** Astro 5.x +- **Styling:** Tailwind CSS 4.x +- **Deployment:** Easypanel (auto-deploy from Gitea) +- **Analytics:** Umami (configured but not conditional) +- **Server:** Node.js adapter (`@astrojs/node`) + +--- + +## ๐Ÿš€ Deployment + +### Easypanel Configuration + +**Auto-deploy:** Enabled +**Branch:** main +**Port:** 80 +**Build Command:** Via Dockerfile + +**Environment Variables:** +``` +NODE_ENV=production +PORT=80 +HOST=0.0.0.0 +``` + +### Git Workflow + +```bash +# Make changes +git add . +git commit -m "Description of changes" +git push origin main + +# Easypanel auto-deploys (~3 minutes) +``` + +--- + +## ๐Ÿ“ Available Commands + +```bash +# Development +npm run dev # Start dev server (localhost:4321) + +# Build +npm run build # Build for production +npm run preview # Preview build locally + +# Docker +docker build -t moreminimore:latest . +docker run -p 80:80 moreminimore:latest + +# Database (not currently in use) +npm run db:push # Push Astro DB schema +npm run db:seed # Seed database +``` + +--- + +## ๐Ÿ“Š Umami Analytics + +**Status:** Configured but not conditional +**Instance:** https://umami.moreminimore.com +**Website ID:** `b2e87a6c-0b64-43c8-bb09-e406ffca0af1` + +**To Enable Conditional Loading:** +1. Re-implement cookie consent system +2. Add conditional script loading in Layout.astro +3. Log consent to database + +--- + +## ๐Ÿ“ž Contact & Support + +**Company:** MoreMiniMore +**Email:** contact@moreminimore.com +**Phone:** 080-995-5945 +**Line:** @moreminimore + +--- + +## ๐Ÿ“‹ TODO (Future Enhancements) + +- [ ] Optional: Re-implement cookie consent (simpler version) +- [ ] Optional: Add Thai company name option +- [ ] Optional: Re-add blog content (if desired) +- [ ] Monitor Umami Analytics +- [ ] Update content as needed + +--- + +## ๐Ÿ”— Resources + +- [Gitea Repository](https://git.moreminimore.com/kunthawat/moreminimore-website.git) +- [Easypanel Dashboard](https://easypanel.io) +- [Astro Docs](https://docs.astro.build) +- [Umami Docs](https://umami.is/docs) +- [PDPC Thailand](https://www.pdpc.or.th) + +--- + +**Last Agent Session:** March 10, 2026 +**Agent:** Sisyphus (OhMyOpenCode) +**Status:** Reverted to original design successfully