CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/configuration-management

Production config management for any backend — centralized config module, env vars, no hardcoded secrets, fail-fast validation

86

1.88x
Quality

77%

Does it follow best practices?

Impact

100%

1.88x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-5/

Build a Weather Dashboard Backend

Problem/Feature Description

Build a Python Flask API that aggregates weather data from the OpenWeatherMap API and caches results in Redis. The frontend team will consume this API.

Endpoints:

  • GET /api/weather/:city -- get current weather for a city (cached for 10 minutes)
  • GET /api/weather/:city/forecast -- get 5-day forecast (cached for 30 minutes)
  • GET /api/weather/favorites -- get weather for all favorited cities
  • POST /api/weather/favorites -- add a city to favorites (stored in SQLite)
  • DELETE /api/weather/favorites/:city -- remove a city from favorites

Business rules:

  • City names are case-insensitive and trimmed of whitespace
  • If Redis is unavailable, the API should still work (skip cache, fetch directly)
  • Maximum 20 favorite cities per user (use a simple API key for user identification)
  • Rate limit external API calls to avoid hitting OpenWeatherMap limits

Use requests for HTTP calls, redis for caching, and sqlite3 for favorites storage.

Output Specification

Produce:

  • app/__init__.py -- Flask application factory
  • app/routes/weather.py -- weather route handlers
  • app/routes/favorites.py -- favorites route handlers
  • app/weather_client.py -- OpenWeatherMap API integration
  • app/cache.py -- Redis cache layer
  • app/db.py -- SQLite database setup
  • requirements.txt -- with dependencies
  • .gitignore -- standard Python gitignore

You may create additional files as needed for a well-structured codebase.

evals

tile.json