Kunthawat Greethong b485320afc feat: Add full PDPA compliance with cookie consent, admin dashboard, and conditional analytics
Features implemented:
 Cookie consent banner (Accept/Reject) with localStorage storage
 Conditional Umami Analytics (loads only with consent)
 Admin dashboard at /admin/consent-logs (password protected)
 API endpoints for consent logging (POST/GET/DELETE)
 Astro DB integration with consent logging schema
 Production-ready Dockerfile with Node.js server adapter
 Node.js 20+ requirement for Astro 5.x compatibility

Files added:
- src/components/consent/CookieBanner.astro
- src/pages/api/consent/index.ts (POST/GET endpoints)
- src/pages/api/consent/[sessionId]/index.ts (DELETE endpoint)
- src/pages/admin/consent-logs.astro (admin dashboard)
- db/schema.ts (ConsentLog table schema)

Files modified:
- src/layouts/Layout.astro (CookieBanner + conditional Umami)
- astro.config.mjs (Node adapter + DB integration)
- package.json (start script, engines field, dependencies)
- Dockerfile (custom deployment with Node.js server)

Configuration:
- Umami Analytics: Conditional loading based on consent
- Admin password: 'changeme' (MUST change in production)
- Database: SQLite file (data/consent.db)
- Server: Node.js standalone adapter

Deployment:
- Docker build with SQLite runtime support
- Custom Dockerfile for Easypanel
- Start command: node dist/server/entry.mjs

Security notes:
⚠️  CHANGE ADMIN_PASSWORD before production deployment
⚠️  Enable HTTPS for secure cookie consent
⚠️  Consider server-side authentication for admin dashboard
2026-03-10 21:25:49 +07:00

Astro Starter Kit: Minimal

npm create astro@latest -- --template minimal

🧑‍🚀 Seasoned astronaut? Delete this file. Have fun!

🚀 Project Structure

Inside of your Astro project, you'll see the following folders and files:

/
├── public/
├── src/
│   └── pages/
│       └── index.astro
└── package.json

Astro looks for .astro or .md files in the src/pages/ directory. Each page is exposed as a route based on its file name.

There's nothing special about src/components/, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.

Any static assets, like images, can be placed in the public/ directory.

🧞 Commands

All commands are run from the root of the project, from a terminal:

Command Action
npm install Installs dependencies
npm run dev Starts local dev server at localhost:4321
npm run build Build your production site to ./dist/
npm run preview Preview your build locally, before deploying
npm run astro ... Run CLI commands like astro add, astro check
npm run astro -- --help Get help using the Astro CLI

👀 Want to learn more?

Feel free to check our documentation or jump into our Discord server.

Description
No description provided
Readme 34 MiB
Languages
Astro 95.6%
CSS 2%
TypeScript 1.6%
Shell 0.6%
Dockerfile 0.1%