All projects

Voltas

An apartment website for Voltas: floor plans, short- and long-term rentals and booking through the Previo reservation system, in Czech and English.

Voltas Hero

Who it is for

Guests looking for a short stay and tenants looking for a long-term rental.

My contribution

  • Apartment, floor-plan and long-term rental pages
  • Contact page and form
  • TypeScript types for the Previo booking API

Collaboration

Two developers; I built the apartment, floor-plan, long-term rental and contact pages and the Previo typing.

The challenge

Present many apartment layouts clearly and connect the site to an existing booking system without rebuilding it.

The solution

A lean Next.js site with next-intl for Czech and English, lightbox floor plans, a typed integration with Previo and contact forms delivered via Nodemailer.

Typing someone else's API

Previo already handles bookings, so the site's job is to ask it nicely. Types at the boundary make the rest of the code safe, and a short revalidation window keeps prices fresh without hammering the API.

lib/voltas/previo.tsIllustrative example
// Illustrative — typing a third-party booking API at the boundary.
type PrevioAvailability = {
  objectId: number;
  from: string; // YYYY-MM-DD
  to: string;
  freeUnits: number;
  priceTotal: number;
};

export async function getAvailability(from: string, to: string) {
  const res = await fetch(`${process.env.PREVIO_URL}/availability`, {
    method: "POST",
    headers: { Authorization: `Bearer ${process.env.PREVIO_TOKEN}` },
    body: JSON.stringify({ from, to }),
    // Prices change, but not every second — cache for five minutes.
    next: { revalidate: 300 },
  });

  if (!res.ok) throw new Error(`Previo responded ${res.status}`);
  return (await res.json()) as PrevioAvailability[];
}

Floor plans you can actually read

Dozens of layouts, each zoomable in a lightbox, with localised labels for screen readers.

components/voltas/FloorPlans.tsxIllustrative example
// Illustrative — floor plans in a lightbox, localised captions.
"use client";

import Lightbox from "yet-another-react-lightbox";
import { useTranslations } from "next-intl";

export function FloorPlans({ plans }: { plans: FloorPlan[] }) {
  const t = useTranslations("Apartments");
  const [index, setIndex] = useState(-1);

  return (
    <>
      <ul className="grid gap-4 sm:grid-cols-2">
        {plans.map((plan, i) => (
          <li key={plan.src}>
            <button onClick={() => setIndex(i)} aria-label={t("openPlan", { name: plan.name })}>
              <Image src={plan.src} alt={plan.name} width={800} height={600} />
            </button>
          </li>
        ))}
      </ul>
      <Lightbox open={index >= 0} index={index} close={() => setIndex(-1)} slides={plans} />
    </>
  );
}