CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/graceful-degradation

Every external call needs a timeout, every timeout needs a fallback — resilience patterns for HTTP, databases, and third-party services

88

4.72x
Quality

90%

Does it follow best practices?

Impact

85%

4.72x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-4/

Travel Planner API

Build a Node.js Express API for a travel planning service that aggregates data from multiple travel providers.

GET /api/travel/search

Query parameters: origin, destination, departDate, returnDate, passengers

The endpoint searches multiple providers in parallel and returns combined results:

  1. Flights -- Skyscanner API (https://api.skyscanner.net/v3/flights/search) returns available flights with prices.
  2. Hotels -- Booking.com API (https://api.booking.com/v2/hotels/search) returns hotels at the destination with prices and ratings.
  3. Car Rentals -- Rentalcars API (https://api.rentalcars.com/v1/search) returns available rental cars at the destination.
  4. Activities -- Viator API (https://api.viator.com/v1/activities/search) returns tours and activities at the destination.

Return a combined response:

{
  "search": {
    "origin": "London",
    "destination": "Paris",
    "departDate": "2025-06-15",
    "returnDate": "2025-06-20",
    "passengers": 2
  },
  "flights": [
    { "airline": "Air France", "price": 120, "currency": "GBP", "departure": "08:30", "arrival": "11:00" }
  ],
  "hotels": [
    { "name": "Hotel Le Marais", "pricePerNight": 95, "rating": 4.2, "stars": 3 }
  ],
  "carRentals": [
    { "company": "Europcar", "category": "Economy", "pricePerDay": 35 }
  ],
  "activities": [
    { "name": "Eiffel Tower Skip-the-Line", "price": 25, "duration": "2 hours" }
  ]
}

API keys come from environment variables: SKYSCANNER_KEY, BOOKING_KEY, RENTALCARS_KEY, VIATOR_KEY.

Output

Produce TypeScript files in a src/ directory:

  • src/index.ts -- Express server with the search route
  • src/services/flights.ts -- search flights
  • src/services/hotels.ts -- search hotels
  • src/services/carRentals.ts -- search car rentals
  • src/services/activities.ts -- search activities
  • src/types.ts -- TypeScript interfaces for all response types

Do not include test files or build configuration.

evals

tile.json