feat: add Django web app, CloudKit sync, dashboard, and game_datetime_utc export

Adds the full Django application layer on top of sportstime_parser:
- core: Sport, Team, Stadium, Game models with aliases and league structure
- scraper: orchestration engine, adapter, job management, Celery tasks
- cloudkit: CloudKit sync client, sync state tracking, sync jobs
- dashboard: staff dashboard for monitoring scrapers, sync, review queue
- notifications: email reports for scrape/sync results
- Docker setup for deployment (Dockerfile, docker-compose, entrypoint)

Game exports now use game_datetime_utc (ISO 8601 UTC) instead of
venue-local date+time strings, matching the canonical format used
by the iOS app.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-02-19 14:04:27 -06:00
parent 4353d5943c
commit 63acf7accb
114 changed files with 13070 additions and 887 deletions

254
templates/base.html Normal file
View File

@@ -0,0 +1,254 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}{{ title|default:'SportsTime' }}{% endblock %} - SportsTime</title>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
background: #f5f7fa;
color: #333;
line-height: 1.6;
}
.navbar {
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
padding: 1rem 2rem;
display: flex;
justify-content: space-between;
align-items: center;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.navbar h1 {
color: #fff;
font-size: 1.5rem;
font-weight: 600;
}
.navbar h1 span {
color: #4fc3f7;
}
.navbar-links {
display: flex;
gap: 1.5rem;
}
.navbar-links a {
color: #adb5bd;
text-decoration: none;
font-weight: 500;
transition: color 0.2s;
}
.navbar-links a:hover, .navbar-links a.active {
color: #4fc3f7;
}
.container {
max-width: 1400px;
margin: 0 auto;
padding: 2rem;
}
.page-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 2rem;
}
.page-header h2 {
font-size: 1.75rem;
color: #1a1a2e;
}
.btn {
display: inline-block;
padding: 0.5rem 1rem;
border-radius: 6px;
text-decoration: none;
font-weight: 500;
cursor: pointer;
border: none;
transition: all 0.2s;
}
.btn-primary {
background: #4fc3f7;
color: #1a1a2e;
}
.btn-primary:hover {
background: #29b6f6;
}
.btn-success {
background: #28a745;
color: white;
}
.btn-danger {
background: #dc3545;
color: white;
}
.btn-secondary {
background: #6c757d;
color: white;
}
.card {
background: white;
border-radius: 12px;
box-shadow: 0 2px 8px rgba(0,0,0,0.08);
padding: 1.5rem;
margin-bottom: 1.5rem;
}
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1rem;
padding-bottom: 0.75rem;
border-bottom: 1px solid #eee;
}
.card-header h3 {
font-size: 1.1rem;
color: #1a1a2e;
}
.stat-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 1.5rem;
}
.stat-card {
background: white;
border-radius: 12px;
box-shadow: 0 2px 8px rgba(0,0,0,0.08);
padding: 1.5rem;
text-align: center;
}
.stat-card.primary {
background: linear-gradient(135deg, #4fc3f7 0%, #29b6f6 100%);
color: white;
}
.stat-card.success {
background: linear-gradient(135deg, #66bb6a 0%, #43a047 100%);
color: white;
}
.stat-card.warning {
background: linear-gradient(135deg, #ffca28 0%, #ffa000 100%);
color: #333;
}
.stat-card.danger {
background: linear-gradient(135deg, #ef5350 0%, #e53935 100%);
color: white;
}
.stat-card .stat-value {
font-size: 2.5rem;
font-weight: 700;
margin-bottom: 0.25rem;
}
.stat-card .stat-label {
font-size: 0.9rem;
opacity: 0.9;
}
.table {
width: 100%;
border-collapse: collapse;
}
.table th, .table td {
padding: 0.75rem;
text-align: left;
border-bottom: 1px solid #eee;
}
.table th {
font-weight: 600;
color: #666;
font-size: 0.85rem;
text-transform: uppercase;
}
.table tbody tr:hover {
background: #f8f9fa;
}
.badge {
display: inline-block;
padding: 0.25rem 0.5rem;
border-radius: 4px;
font-size: 0.75rem;
font-weight: 600;
}
.badge-success { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-info { background: #d1ecf1; color: #0c5460; }
.badge-secondary { background: #e2e3e5; color: #383d41; }
.progress-bar {
height: 8px;
background: #e9ecef;
border-radius: 4px;
overflow: hidden;
}
.progress-bar .fill {
height: 100%;
border-radius: 4px;
transition: width 0.3s;
}
.grid-2 {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 1.5rem;
}
.grid-3 {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 1.5rem;
}
@media (max-width: 768px) {
.grid-2, .grid-3 {
grid-template-columns: 1fr;
}
.stat-grid {
grid-template-columns: repeat(2, 1fr);
}
}
.alert {
padding: 1rem;
border-radius: 8px;
margin-bottom: 1rem;
}
.alert-success { background: #d4edda; color: #155724; border-left: 4px solid #28a745; }
.alert-warning { background: #fff3cd; color: #856404; border-left: 4px solid #ffc107; }
.alert-danger { background: #f8d7da; color: #721c24; border-left: 4px solid #dc3545; }
.alert-info { background: #d1ecf1; color: #0c5460; border-left: 4px solid #17a2b8; }
.text-muted { color: #6c757d; }
.text-success { color: #28a745; }
.text-danger { color: #dc3545; }
.text-warning { color: #ffc107; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
</style>
{% block extra_css %}{% endblock %}
</head>
<body>
<nav class="navbar">
<h1>Sports<span>Time</span></h1>
<div class="navbar-links">
<a href="{% url 'dashboard:index' %}" {% if request.resolver_match.url_name == 'index' %}class="active"{% endif %}>Dashboard</a>
<a href="{% url 'dashboard:stats' %}" {% if request.resolver_match.url_name == 'stats' %}class="active"{% endif %}>Stats</a>
<a href="{% url 'dashboard:scraper_status' %}" {% if request.resolver_match.url_name == 'scraper_status' %}class="active"{% endif %}>Scraper</a>
<a href="{% url 'dashboard:sync_status' %}" {% if request.resolver_match.url_name == 'sync_status' %}class="active"{% endif %}>Sync</a>
<a href="{% url 'dashboard:review_queue' %}" {% if request.resolver_match.url_name == 'review_queue' %}class="active"{% endif %}>Review</a>
<a href="{% url 'dashboard:export' %}" {% if request.resolver_match.url_name == 'export' %}class="active"{% endif %}>Export</a>
<a href="{% url 'admin:index' %}">Admin</a>
</div>
</nav>
<div class="container">
{% if messages %}
{% for message in messages %}
<div class="alert alert-{{ message.tags }}">{{ message }}</div>
{% endfor %}
{% endif %}
{% block content %}{% endblock %}
</div>
{% block extra_js %}{% endblock %}
</body>
</html>