Case Study · Holiday rental · Astro + Cloudflare Workers

Leo Appartamenti

A website for the three apartments of a holiday rental just outside the walls of Erice, with a patio overlooking Trapani and the sea. Bilingual, fast and built to move bookings from Booking to direct contact with the owners.

Astro Three.js JavaScript TypeScript Cloudflare Workers iCal Resend node:test Schema.org i18n
Visit the site View on GitHub

Mobile preview: day, night, apartment and availability

Desktop preview: day, night, apartment and availability

The brief

The owners got almost every booking through Booking, paying a commission of about 15–18%, and answered the same questions every day: parking, check-in times, pets, how to get there.

They needed a site that put the three strengths guests mention in reviews first, the view, the location and the hosts, showed the real free dates and turned a visit into a direct enquiry.

Goal

More direct bookings and fewer repeated questions.

Audience

Italian and international guests, couples, families and groups of up to 15.

Constraints

Small budget, a site updated a few times a year, no database.

Architecture

A static site generated with Astro, in Italian and English. On Cloudflare Workers the pages are served as static files and only requests to /api/* go through the Worker: one reads the calendars, the other sends enquiries by email. No server to manage and no database.

From a booking on Booking to a taken date on the site

Calendars
Booking + Google
Each apartment exports an iCal from Booking; the owner adds their own dates in Google Calendar.
→
Worker
/api/disponibilita
Reads and merges the iCal feeds, drops cancelled bookings and caches the result for 15 minutes.
→
Site
Astro calendar
Shows free and taken nights for one or more apartments; picking dates fills in the form.
→
Enquiry
/api/richiesta
The Worker validates the fields and sends the email with Resend; enquiries are not stored.

If a calendar can't be reached the site keeps working: it says availability isn't up to date and still invites guests to send an enquiry.

Technologies

Astro

Why: a content site that changes a few times a year doesn't need a client-side framework.

How: pages generated at build time from JSON files (apartments, services, contacts) and .astro components; automatic sitemap, self-hosted fonts.

Result: light static HTML, and text the client edits in one file without touching the code.

Three.js

Why: the opening photo had to make you feel the fog rising over Erice, not just show it.

How: fog banks as instanced sprites with a noise texture, animated in a shader; the cursor opens a gap and at night the fog picks up the amber light of the street lamps. The module loads with import() after the page.

Result: an effect that holds up on a phone and doesn't slow down the first load.

Cloudflare Workers

Why: two small APIs were needed, not a server running all day.

How: static files served by Cloudflare, a Worker only for /api/*, calendar URLs and keys stored as Worker secrets.

Result: free hosting, a deploy on every push and no keys in the code.

Tests with node:test

Why: a wrong iCal parser shows a night as free when it's already sold.

How: 16 tests on the iCal reader, the calendar merge and form validation, with no external libraries.

Result: the delicate rules (checkout night excluded, cancelled events, required fields) stay verified on every change.

Key features

Challenges and lessons

Calendars from different sources

Solution: a single iCal reader that merges Booking and Google, drops cancelled events and treats checkout as a free night, covered by tests. Lesson: with data from other systems, the rules have to be written down and verified, not guessed.

A 3D effect that stays light

Solution: fog computed in the shader, with JavaScript updating only a few values, loaded after the rest of the page. Lesson: an animated background is designed for the slowest phone, not the fastest computer.

A site the owners update themselves

Solution: data and copy in JSON files and a README explaining where to change contacts, prices and photos. Lesson: when the client is the one editing, the documentation is part of the product.

Want to see the site or the code?

Visit the site View on GitHub Get in touch