Unify server, persist ratings via API, refresh scraper data
All checks were successful
Build and Push / build (push) Successful in 13s

- Replace split setup (ratings_server.py on :8081 + http.server on :8080)
  with a single combined Flask server (server.py) on :8080 that serves
  static files and the /api/ratings GET/POST endpoints
- Ratings are now persisted server-side: mapa_bytu.html loads ratings
  from GET /api/ratings on startup (API as source of truth) and POSTs
  on every change — enables cross-browser and cross-device state sharing
  while keeping localStorage as a synchronous read cache
- Dockerfile: install flask, copy server.py instead of ratings_server.py,
  expose only port 8080
- entrypoint.sh: start single server process instead of two
- Makefile: add serve / serve-debug targets for local development
- scrape_psn.py: fix log label, add --max-pages stub arg for CLI parity
- Refresh all scraped property data

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jan Novak
2026-02-25 13:51:02 +01:00
parent b8d4d44164
commit c2bc3f452f
15 changed files with 1692 additions and 31234 deletions

View File

@@ -5,7 +5,7 @@ VALIDATION_CONTAINER := maru-hleda-byt-validation
VALIDATION_VOLUME := maru-hleda-byt-validation-data
PORT := 8080
.PHONY: build run stop logs scrape restart clean help validation validation-local validation-stop validation-local-debug
.PHONY: build run stop logs scrape restart clean help validation validation-local validation-stop validation-local-debug serve serve-debug
help:
@echo "Available targets:"
@@ -20,6 +20,8 @@ help:
@echo " validation-local-debug - Run validation locally with DEBUG logging"
@echo " restart - Restart the container (stop and run again)"
@echo " clean - Stop container and remove the Docker image"
@echo " serve - Run server.py locally (DATA_DIR=., port $(PORT))"
@echo " serve-debug - Run server.py locally with DEBUG logging"
@echo " help - Show this help message"
build:
@@ -65,6 +67,12 @@ validation-local:
validation-local-debug:
./run_all.sh --max-pages 1 --max-properties 10 --log-level DEBUG
serve:
DATA_DIR=. PORT=$(PORT) python server.py
serve-debug:
DATA_DIR=. PORT=$(PORT) python server.py --verbose
restart: stop run
clean: stop