Serverless content platform with secure media management built on Cloudflare Workers, R2, and Astro.
Table of Contents
KIL Construction's platform delivers a fast, CDN-optimized website paired with secure administrative tools for managing project galleries, rotating images, and structured media categories.
The frontend (Astro) communicates with two Cloudflare Workers (Not in this repository):
-
Gallery + Reviews Worker
– Handles gallery listing, reviews, admin authentication, and all R2 operations. -
Contact Worker (
kilcon-contact)
– Handles POST/api/contact, email forwarding, and Turnstile validation.
This repo contains only the Astro frontend and no backend secrets or Worker code.
📦 Cloudflare R2 Object Storage
- Serverless backend powered by Cloudflare Workers
- Gallery + Reviews Worker (in Cloudflare) for admin operations, R2, and public listing
- Contact Worker (
/api/contact) for email forwarding + Turnstile verification - Dynamic Astro frontend with category/project routing
- Secure cookie-based admin authentication
- Upload, rename, delete, and organize media in R2
- Featured review sorting + homepage review rotation
- Rotating project cards for modern visual previews
- Zero-downtime deployments + global CDN caching
Click to expand architecture details
- Static + dynamic hybrid rendering
- Responsive gallery layouts
- Rotating image card components
- Integrates directly with Worker API endpoints
-
Gallery + Reviews Worker (
kilcon-gallery-worker) (external repository)- Handles all media/gallery operations
- Review submission + featured review ordering
- Admin authentication (cookie-based)
- R2 object reading/writing
- Frontend calls it via:
/api/gallery-api*/api/reviews*
-
Contact Worker (
kilcon-contact)- Handles POST
/api/contact - Sends emails using Resend
- Validates Turnstile tokens
- Required environment variables:
RESEND_API_KEYFROM_EMAILTO_EMAILTURNSTILE_SECRET
- Deployed in Cloudflare, not stored in this repo
- Handles POST
- Category folders:
Projects/,Furniture/,Remodels/, etc. - Deterministic numeric prefix ordering
- Scalable object storage
- Secret-based admin authentication
- Cookie session validation
- Domain-level request verification
- Admin access is controlled via short-lived signed cookies
- All secrets and session controls are configured only in Cloudflare.
📸 Visual overview of the platform:
Homepage
|
Project Gallery View
|
Service Gallery View
|
Contact Page
|
Admin – Dashboard
|
Admin – Upload Images
|
Admin – Manage Images in Projects/Services
|
Admin – Approve/Deny/Feature Reviews
|
Prerequisites
- Node 18+
- Cloudflare account with R2 bucket configured
- Wrangler CLI (optional – only needed if you want to run Workers locally)
Install & Run npm install npm run dev
Deploy npm run deploy
Environment Variables
This repository contains only frontend-safe environment variables:
- PUBLIC_GALLERY_API=
- PUBLIC_CONTACT_ENDPOINT=
All sensitive values (ADMIN_SECRET, R2 paths, email API keys, Turnstile secret, etc.)
are configured directly inside Cloudflare Worker settings and are not stored in this repo.
This platform is actively deployed for a private construction company. Source code is provided solely for portfolio/demo purposes.
Proprietary Software — KIL Construction
Unauthorized use, reproduction, or distribution of this code is prohibited.
Legal Notice: All code and assets within this repository are the confidential and proprietary property of KIL Construction. No part of this project may be copied, modified, published, or distributed without prior written consent. Access is provided solely for portfolio review and technical evaluation.







