This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Import Task Master's development workflow commands and guidelines, treat as if import is in the main CLAUDE.md file. @./.taskmaster/CLAUDE.md
SnorkelForecast.com is a Django 5.0 web application that provides snorkeling forecasts for Carboneras, Spain by integrating with Open-Meteo's free Marine & Weather APIs. The app displays a 72-hour forecast showing ideal snorkeling conditions based on wave height, wind speed, and sea temperature thresholds.
# Install dependencies
uv venv # Create virtual environment
uv sync # Install dependencies from uv.lock
# Run development server (from snorkelforecast/ directory)
cd snorkelforecast && python manage.py runserver
# Build CSS in watch mode
npm run tailwind:watch
# Build CSS for production
npm run tailwind:build
# Lint code
uv run ruff check .# Run from snorkelforecast/ directory
python manage.py runserver # Start dev server
python manage.py collectstatic # Collect static files
python manage.py migrate # Run migrations (if any added)# Build CSS and collect static files
npm run tailwind:build
cd snorkelforecast && python manage.py collectstatic --noinput
# Run with gunicorn
PYTHONPATH=/app uv run gunicorn snorkelforecast.wsgi:application├── snorkelforecast/ # Django project directory
│ ├── snorkelforecast/ # Main Django config
│ │ ├── settings.py # Django settings
│ │ ├── urls.py # Main URL routing
│ │ └── wsgi.py # WSGI config
│ └── manage.py # Django management script
├── conditions/ # Main Django app
│ ├── snorkel.py # Core business logic
│ ├── views.py # Django views
│ ├── urls.py # App URL routing
│ └── templates/ # Django templates
└── static/ # Static files
├── src/input.css # Tailwind source
└── css/output.css # Compiled CSS
-
Business Logic (
conditions/snorkel.py):fetch_forecast(): Fetches weather data from Open-Meteo APIsCARBONERAS: Hardcoded coordinates (lat: 36.997, lon: -1.896)THRESHOLDS: Snorkeling condition thresholds (wave height ≤ 0.3m, wind ≤ 4.5 m/s, water temp 22-29°C)- Returns list of
Hourobjects withtimeandok(boolean) fields
-
Views (
conditions/views.py):home(): Main view that fetches forecast data and renders template
-
Template (
conditions/templates/conditions/index.html):- Displays 72-hour grid with green (good) or gray (poor) conditions
- Uses Tailwind CSS classes for styling
- Responsive grid layout (6 cols mobile, 12 cols desktop)
- Django 5.0+: Web framework
- httpx: HTTP client for API calls
- python-dateutil: Timezone handling
- whitenoise: Static file serving in production
- gunicorn: WSGI server for production
- Tailwind CSS: Styling framework
The app makes concurrent requests to two Open-Meteo endpoints:
- Marine API: Wave height, sea surface temperature
- Weather API: Wind speed at 10m
All data is fetched in UTC and converted to Europe/Madrid timezone for display.
- Input CSS:
static/src/input.css(Tailwind directives) - Output CSS:
static/css/output.css(compiled, git-ignored) - Use
npm run tailwind:watchduring development - Django static files collected to
staticfiles/for production
The Django project currently has no explicit test setup. When adding tests:
- Use Django's built-in testing framework
- Mock API calls to Open-Meteo in tests
- Test threshold logic in
snorkel.py
Configured for containerized deployment (fly.io, Railway) with:
- Dockerfile using Python 3.13 slim
- WhiteNoise middleware for static file serving
- No database requirements (SQLite for Django admin only)
Current MVP is Carboneras-only but designed for expansion:
- Coordinates are parameterized in
CARBONERASconstant - Template and view structure supports dynamic location data
- API calls can accept lat/lon parameters
- Use
uv runto execute Python commands in the virtual environment