This document is a filled-in, travelmathlite-focused copy of LAYMAN_CHECKLIST_01.md, marked against the current repository state (travelmathlite/ app suite) and annotated with brief notes pointing to code, tests, and gaps/TODOs.
Legend
- Completed and verified
- Not yet completed or pending docs/tests
- HTTP request/response flow —
core/urls.pywires calculators/airports/search/accounts/trips to CBVs inapps/*/views.py, returning templates/partials. - Runserver demonstration — Not recorded; run
uv run python manage.py runserverfromtravelmathlite/to capture screenshots/asciinema. - Console inspection —
core.middleware.RequestLoggingMiddlewareemits JSON logs with request_id/duration; validated incore/tests/test_observability.py. - Code commentary — Views/models carry concise docstrings (e.g.,
apps/calculators/views.py,apps/airports/models.py). - Visual diagram (optional) — No request/response diagram checked in.
- urls.py created — Namespaced app URLs under
core/urls.py; app routes inapps/*/urls.py. - Namespace clarity —
include(..., namespace=...)used for calculators, airports, search, accounts, trips, base. - URL naming discipline — All routes named and reversed in templates/tests (see
apps/base/tests/test_namespaces.py,apps/calculators/tests.py). - Canonical link alignment — Canonical tags on search results (
apps/search/templates/search/results.html); SEO endpointssitemap.xml/robots.txtwired. - Test coverage (resolve/reverse) — URL reverse/resolve tests across apps (e.g.,
apps/airports/tests/tests_views.py,apps/search/tests/test_root.py).
- Views defined — CBVs for calculators (FormView), airports (FormView/JSON), search (TemplateView), auth/trips (Template/List/Delete).
- Proper rendering — Views return templates or HTMX partials with fallbacks for non-HTMX POSTs.
- View docstrings — Present on custom middleware, models, and views for intent/context.
- Error handling — Form validation and queryset scoping (e.g.,
SavedCalculationDeleteViewfilters by user) ensure 404/validation paths. - Unit tests — Extensive view/form tests in
apps/calculators/tests,apps/airports/tests/tests_views.py,apps/search/tests/test_views.py.
- Templates configured —
core/settings/base.pyincludes projecttemplates/and app directories. - Base template —
templates/base.htmlwith navbar/footer/includes; pages extend base and use Bootstrap 5 + HTMX pins. - Feature templates — Calculators, nearest airports, search results, auth, and trips render structured layouts with partials for HTMX swaps.
- Template tags — Safe highlight filter (
apps/search/templatetags/highlight.py) and sanitize filter (apps/base/templatetags/sanitize.py) used for user text. - Accessibility compliance — ARIA labels/focus scripting exist, but no formal a11y audit/contrast report checked in.
- Forms created — Calculator and nearest-airport forms with custom validators (
apps/calculators/forms.py,apps/airports/forms.py). - CSRF token — Present across templates.
- Validation handled — Clean methods resolve city/IATA/latlon and enforce ranges/units.
- Form lifecycle — GET shows form; POST/HTMX renders partial results; non-HTMX POST falls back to full template.
- Persistence — Session helpers exist (
core/session.py) but calculators do not yet persist last inputs for reuse.
- Domain models — Country/City (normalized), Airport, Profile, SavedCalculation implemented with indexes and managers.
- Migrations applied — Initial migrations under each app.
- Admin entry — ModelAdmins for base/airports/trips with search/filter (
apps/base/admin.py,apps/airports/admin.py,apps/trips/admin.py). - Model methods — No
get_absolute_url()on public models (not needed yet). - ORM queries — Views rely on QuerySets (nearest search, search results) with tests covering CRUD (
apps/airports/tests/tests_import.py,apps/trips/tests/test_saved_calculation.py).
- Admin site enabled —
core/urls.py: admin/; custom ModelAdmins registered. - Admin usage docs — Superuser creation and screenshots not documented.
- Custom ModelAdmin — List/search/filter configs for Airport/Country/City/SavedCalculation; select_related in trips admin queryset.
- Permissions model — No staff-only customization beyond defaults; calculators remain public.
- Admin tests — See
apps/airports/tests/test_admin.py,apps/base/tests/test_admin.py.
- App layout — Conventional Django app structure under
travelmathlite/apps/. - Settings modularization —
core/settings/{base,local,prod}.pywith env-driven config. - INSTALLED_APPS — Domain apps plus contrib apps declared in
core/settings/base.py. - Static files pipeline — WhiteNoise middleware plus
STATICFILES_DIRS; CSS overrides instatic/css/. - README mapping —
travelmathlite/README.mddocuments structure and quickstart.
- Authentication system enabled — Django auth in INSTALLED_APPS/middleware.
- Login/Logout views —
RateLimitedLoginView+ Logout wired; password reset routes configured. - User registration —
SignupViewusesUserCreationForm; templates underapps/accounts/templates/registration/. - Permissions — No role/permission gating beyond LoginRequired for saved calculations; calculators open to anonymous users.
- Tests — Auth templates/rate limiting/profile upload covered (
apps/accounts/tests/test_rate_limit.py,test_profile.py).
- Middleware stack reviewed — RequestID, RequestLogging, CacheHeader, WhiteNoise, security/auth stack in
core/settings/base.py. - Custom middleware created — Request ID/timing and cache headers in
core/middleware.pywith tests incore/tests/test_observability.py. - Common middleware explained — Cache policies per ADR-1.0.10 applied to calculators/search.
- Middleware ordering docs — No README narrative; GZip not enabled (rely on platform).
- Tests — Caching and request logging verified (
apps/calculators/test_caching.py,apps/search/tests/test_caching.py).
- Static files configuration —
STATIC_URL,STATICFILES_DIRS, optional ManifestStaticFilesStorage via env; WhiteNoise middleware active. - Template integration —
{% load static %}and Bootstrap/HTMX pins intemplates/includes/head.html. - Assets verified — CSS overrides and screenshots for calculators under
travelmathlite/screenshots/calculators/. - Production strategy — CDN/cache headers not documented; STATIC_ROOT/collectstatic steps not recorded.
- Tests — No static asset tests.
- Test suite created — Django TestCase suites across calculators, airports, base, search, accounts, trips.
- Model/view/form tests — Coverage for nearest lookup, calculators (HTMX), search pagination/highlight, auth rate limiting, saved calculations.
- CI integration —
.github/workflows/travelmathlite-tests.ymlruns lint/format/check/migrations/tests on push/PR. - Coverage target — No coverage report; tests not rerun locally in this session.
- CI scope — Workflow currently runs app subset (airports/base); full suite relies on local runs.
- Production settings —
core/settings/prod.pyenforces SECRET_KEY/ALLOWED_HOSTS, secure cookies, HSTS, SSL redirect. - Deployment target — No platform/ALB/CDN docs or rollback plan.
- Static/media serving — WhiteNoise ready, but CDN/collectstatic steps and monitoring not documented.
- HTTPS enforcement — No cert/ingress setup captured; deploy checklist not run.
- Session middleware — Enabled with default DB backend.
- Session data usage — Calculator views do not persist last inputs; helpers in
core/session.pyunused by views. - Session binding — Login signal marks session user-bound (
apps/accounts/signals.py); tests inapps/accounts/tests/test_session_migration.py. - Session security/cleanup — No
clearsessions/rotation docs; secure flags rely on env defaults.
- Settings organization — base/local/prod split; django-environ for env parsing.
- Environment-specific configs — DB/cache/settings driven by env vars; SECRET_KEY required in prod.
- Logging configuration — Structured JSON logging with request_id/duration in
core/logging.py. - Email backend — Not configured per environment; README lacks mail guidance.
- Validation — No custom
checkhooks for settings; limited documentation of required env vars.
- Media configuration —
MEDIA_URL/MEDIA_ROOTset; default FileSystemStorage. - File upload field — Profile avatar upload form/template (
apps/accounts/forms.py,accounts/profile_form.html) with tests intest_profile.py. - Development serving —
core/urls.pydoes not mountMEDIA_URLfor DEBUG; needs doc or URL helper. - Production serving — No CDN/storage backend plan; file validation limited to accept=image/*.
- Custom management command —
import_airports,update_airports,validate_airportswith dry-run/limit/URL options. - Command structure — Uses BaseCommand with arguments; idempotent upsert and location linking (
apps/airports/management/commands/import_airports.py). - Tests — Import/update/validate commands covered in
apps/airports/tests/tests_import.py,tests_update_command.py,tests_validate_command.py. - Automation — Scheduling/cron docs not present.
- Database query optimization — Bounding-box filters and haversine in
AirportQuerySet.nearest; indexes on hot fields. - Caching implemented —
@cache_pageon calculators/search; CacheHeaderMiddleware sets cache-control; cache backend configurable via env. - Pagination — Search results paginated; saved calculations paginated.
- Profiling — No Debug Toolbar/profiling tools; nearest JSON endpoint not cached.
- Documentation — No performance benchmarks/notes.
- Security settings enabled — Secure cookies, HSTS, SSL redirect, referrer/XFO headers in base/prod settings.
- CSRF protection — Middleware active; forms include CSRF tokens.
- Input sanitization —
sanitize_htmlfilter and highlight escaping; saved calculations sanitized in templates/tests. - CSP/rate limiting breadth — CSP not configured; rate limiting only on auth; dependency scanning not automated.
- Deploy check —
manage.py check --deploynot documented in CI/readme.
- Logging configured — Request logging with request_id/duration; JSON formatter; health endpoint.
- Error pages — Custom 404/500 templates tested in
core/tests/test_observability.py. - Error tracking toggle — Optional Sentry init guarded by env (
core/sentry.py). - Tooling — No Debug Toolbar/VS Code launch configs or query logging guidance.
- Reproduction docs — Debug how-to and bug reproduction steps not documented.
- FR coverage — Calculators, nearest lookup, search, auth, and saved-calculation scaffolding align with PRD §4; ADRs under
docs/travelmathlite/adr/. - Traceability — No matrix mapping PRD → ADR → tests/files; acceptance tracked loosely in feature checklist.
- NFRs — Accessibility/performance/security documentation partial; no lint/coverage badges.
- CHECKLIST_COMPLETION.md — This file (travelmathlite edition).
- Screenshots/asciinema — Calculator screenshots in
travelmathlite/screenshots/calculators/. - Summary table (PRD → ADR → Tests) — Not yet created.
- Additional media — Search/nearest/auth flows and deployment evidence not captured.
-
Caching and observability
- Cache directives for calculators/search via
@cache_pageandCacheHeaderMiddleware; cache backend/env toggles incore/settings/base.py. - Request ID + structured logging in
core/middleware.pyandcore/logging.py; tested incore/tests/test_observability.py. - Health endpoint returns status (and optional commit SHA) at
/health/.
- Cache directives for calculators/search via
-
Data/imports
- OurAirports import pipeline with location linking in
apps/airports/management/commands/import_airports.py; dry-run and limit flags covered by tests. - Normalized Country/City models (
apps/base/models.py) back Airport foreign keys; search uses select_related for pagination efficiency.
- OurAirports import pipeline with location linking in
-
Auth/trips
- Auth views/templates live under
apps/accounts/; login rate limiting toggled via env inRateLimitMixin. - SavedCalculation list/delete flows and sanitization are implemented, but calculators do not yet persist submissions into SavedCalculation or sessions. Action item: hook calculators to
core/session.pyhelpers and persist to trips when logged in.
- Auth views/templates live under
-
Quick wins (low risk)
- Add
MEDIA_URLserving in DEBUG, plus storage/CDN note for prod. - Add deployment/runbook steps (collectstatic, ALLOWED_HOSTS, certs, rollback) and map PRD → ADR → tests.
- Enable full test matrix in CI (accounts/calculators/search/trips) and add coverage badge/report.
- Add