David Aviani

Behind the scenes

How this site is built

A lightweight, server-rendered site deployed on the edge of the Cloudflare network. Here are the full technical details.

Server and hosting

Platform
Cloudflare Workers (V8 runtime at the edge); there is no traditional server or virtual machine to maintain.
Where it runs
On Cloudflare's global network: every visit is served from the data center closest to the visitor.
Static files
Workers Static Assets: CSS, JS, images, favicon and CV are served from Cloudflare's CDN.
Domain and DNS
aviani.com.ar and www.aviani.com.ar are custom domains of the Worker; DNS is delegated to Cloudflare and HTTPS is automatic.
Bindings
ASSETS (static files), IMAGES (Cloudflare Images) and SESSION (KV Namespace).
Observability
Worker logs and metrics enabled in Cloudflare (observability).
Configuration
wrangler.jsonc, with compatibility_date 2026-11-17 and the global_fetch_strictly_public flag.

Application

Framework
Astro 7 with server-side rendering (SSR) through the @astrojs/cloudflare 14 adapter.
Language
TypeScript. Development runtime: Node.js 22 or later.
Styles
Tailwind CSS 4, integrated as a Vite plugin; palette and fonts are defined as tokens in @theme.
Typefaces
Montserrat (text) and Poppins (logo), from Google Fonts.
React
The @astrojs/react 7 integration with React 19 is installed for interactive components; today the page works without framework JavaScript.
SEO and sharing
Open Graph and Twitter Card metadata, a 1200×630 preview image and a lang attribute that follows the language.

Languages

Dictionary
All copy lives in a typed dictionary (src/i18n/ui.ts) for Spanish and English.
Selection
An Astro middleware reads the lang cookie; the site defaults to Spanish.
Switching
The selector also works without JavaScript: /?lang=en stores the cookie and redirects with a 303.
Caching
Because the response depends on the cookie, Vary: Cookie is sent so no cache mixes languages.

Contact form

Endpoint
POST /api/contact, a server route running in the same Worker.
Validation
Required fields, email format, per-field length limits and error messages in the visitor's language.
Anti-spam
A hidden honeypot field and a check that the Origin is the same site.
Security
Line breaks are stripped from the subject to prevent mail header injection.
Delivery
Resend API. The key and mailboxes are stored as Worker secrets (wrangler secret), never in the code.

Publishing

Code
GitHub repository, main branch.
Deploy
npm run deploy: astro build and wrangler deploy. It uploads new assets and publishes a new Worker version within seconds.
Local environment
npm run dev serves the site at localhost:4321 with the same Workers runtime.

What happens when someone opens the site

  1. 1

    The browser resolves aviani.com.ar on Cloudflare DNS and connects over HTTPS to the nearest data center.

  2. 2

    Cloudflare serves static files (CSS, images, icons) straight from its CDN.

  3. 3

    For pages, the Worker runs: the middleware reads the language cookie and Astro renders the HTML in that language.

  4. 4

    The response returns with Vary: Cookie and the browser requests the remaining resources.

  5. 5

    If the visitor submits the form, the Worker validates the data and asks Resend to send the email.

← Back to home