- Vote state now persists on page load (user_vote in proposals query)
- Stats bar: live votes-today / citizens / proposals counts
- Leaderboard section: top 10 proposals with milestone progress bars
- Milestone system: 100→viral, 500→community, 1k→publish, 5k→minister, 10k→media
- Email capture modal after 3rd vote (postcode optional)
- Milestone email notifications via Resend (requires RESEND_API_KEY secret)
- Weekly digest cron (Monday 9am AEST) to all subscribers
- Share-as-image button opens dynamic SVG in new tab
- Flag/report button hides proposals after 5 flags
- Proposals with hidden=1 excluded from all feeds
- DB: users.email, users.postcode, proposals.flag_count, proposals.hidden,
proposal_flags, milestone_notifications tables
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
53 lines
1.1 KiB
TOML
53 lines
1.1 KiB
TOML
name = "radical"
|
|
main = "worker.js"
|
|
compatibility_date = "2024-03-31"
|
|
|
|
# D1 Database Binding
|
|
[[d1_databases]]
|
|
binding = "DB" # Use this name in your code
|
|
database_name = "radical-db"
|
|
database_id = "1f2a5273-bfcb-45c8-a759-5d675c05620c"
|
|
|
|
# R2 Bucket Binding
|
|
[[r2_buckets]]
|
|
binding = "MEMES_BUCKET"
|
|
bucket_name = "memes"
|
|
|
|
# Static Assets Binding
|
|
[[r2_buckets]]
|
|
binding = "ASSETS"
|
|
bucket_name = "assets"
|
|
|
|
# Environment variables (optional)
|
|
[vars]
|
|
ENVIRONMENT = "production"
|
|
|
|
# wrangler.toml (wrangler v3.88.0^)
|
|
[observability.logs]
|
|
enabled = true
|
|
|
|
# Main routes for API endpoints
|
|
[[routes]]
|
|
pattern = "theradicalparty.com/api/*"
|
|
zone_name = "theradicalparty.com"
|
|
|
|
# Media file routes
|
|
[[routes]]
|
|
pattern = "theradicalparty.com/memes/*"
|
|
zone_name = "theradicalparty.com"
|
|
|
|
[[routes]]
|
|
pattern = "theradicalparty.com/audio/*"
|
|
zone_name = "theradicalparty.com"
|
|
|
|
# Ensure static assets are properly routed
|
|
[[routes]]
|
|
pattern = "theradicalparty.com/styles.css"
|
|
zone_name = "theradicalparty.com"
|
|
|
|
# Weekly digest — Monday 9am AEST (Sunday 23:00 UTC)
|
|
[triggers]
|
|
crons = ["0 23 * * 0"]
|
|
|
|
|
|
|