Galle, LK--:--5/6 sites live

Model the Island as Data

Before any page exists, describe Sri Lanka as typed data: activities, destinations, itineraries and encyclopedia articles — the schema behind the Nora Travels portal.

11 Oct 20264 min read#TypeScript#Data modelling#Tourism

Lesson 1 of 10 · Tourism Tech · built from Nora Travels, Nora Labs, Mahesh Travellers and my hospitality sites

A tourism site is a catalogue first and a website second. If the places, activities and routes are well-structured data, every page — cards, detail pages, search, maps — falls out of it. The Nora Travels portal keeps 100% of its content in JSON under /data/ and reads it through typed getters.

Example — the Activity schema

ExampleTypeScript
export interface Activity {
  id: string;
  slug: string;
  title: string;
  tagline: string;
  category: string;        // e.g. "Safari & Wildlife"
  region: string;          // e.g. "Sigiriya & Cultural Triangle"
  duration: string;
  difficulty: string;
  bestSeason: string;
  priceRange: string;      // "$" … "$$$$"
  rating: number;
  reviewsCount: number;
  heroImage: string;
  highlights: string[];
  overview: string;
  practicalTips: string[];
  coordinates: { lat: number; lng: number };
  relatedWikiSlug?: string;
  tags: string[];
}

Example — typed getters

ExampleTypeScript
import activitiesData from '@/data/activities.json';

export function getAllActivities(): Activity[] {
  return activitiesData as unknown as Activity[];
}

export function getActivityBySlug(slug: string): Activity | undefined {
  return (activitiesData as unknown as Activity[]).find((a) => a.slug === slug);
}

Why this shape works

  • slug becomes the URL; id stays stable even if the title changes.
  • coordinates are stored once and reused by maps, "nearby" lists and route planning.
  • relatedWikiSlug links a bookable activity to the encyclopedia article that explains it — commerce and culture side by side.
  • The same pattern covers Destination (province, climate, best time, elevation, key attractions), Itinerary (route + days) and WikiArticle (infobox, sections, references).

Try it yourself: open the Nora Labs case study and notice how every screen — wizard, map, studio — is a different view over the same destination data.

Exercise

Add a Destination for Ella with province, climate, bestTime, elevation and three keyAttractions. Which fields would a map need, and which would a detail page need?


Keep going: ← Course overview · Lesson 2 →

ExerciseKnowledge check

In the Nora Travels portal, where does page content come from?

Finished this one?

Progress is saved in this browser.

Guide