mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-13 23:45:18 +00:00
- Streaming AI endpoint at /campanha/api/ai-chat with DeepSeek V4 Flash - 8 tools: calculate, getMunicipalityVotes, getTopDeputies, getDobradinhas, getMunicipalityOverview, getLeaderships, getOrganizations, searchEntities - In-memory rate limiter (50 msgs / 15 min per user) - Desktop: resizable right sidebar via react-resizable-panels - Mobile: full-screen Drawer opened by FAB (2/3 size of quick-actions FAB) - Markdown rendering with react-markdown + remark-gfm (tables, bold, lists) - Session-bound context (clean slate each open) - Auth via existing campaign-token cookie, tools respect user RBAC - Architecture doc: docs/plans/ai-chat-sollinha.md - E2E tests: campaignAiChat.e2e.spec.ts (mocked endpoint)
41 lines
2.2 KiB
Text
41 lines
2.2 KiB
Text
# Copy this file to `.env.local` for local development.
|
|
#
|
|
# For LOCAL DEVELOPMENT, DATABASE_URL must point at the local Postgres started by
|
|
# docker-compose (`pnpm db:start`). `pnpm dev` will REFUSE to start against a
|
|
# non-local host (e.g. the production Neon database) unless you explicitly set
|
|
# ALLOW_REMOTE_DB=true — this is intentional, to protect production data.
|
|
DATABASE_URL=postgresql://teqo:teqo@localhost:5432/teqo
|
|
|
|
PAYLOAD_SECRET=YOUR_SECRET_HERE
|
|
BLOB_READ_WRITE_TOKEN=YOUR_BLOB_TOKEN_HERE
|
|
# Canonical public origin used in absolute campaign invite links. In production
|
|
# this must be an exact HTTPS non-local origin: no credentials, path other than
|
|
# `/`, query, or fragment. Production ignores request headers and invite
|
|
# creation fails closed when this value is invalid. Development/test accepts
|
|
# request-derived origins only for exact localhost, 127.0.0.1, or ::1 hosts and
|
|
# normalizes them to HTTP; otherwise this configured origin is the only fallback.
|
|
NEXT_PUBLIC_SITE_URL=http://localhost:3000
|
|
|
|
# Shared secret guarding POST /api/revalidate, which busts ISR cache tags on demand.
|
|
# Needed after direct-DB writes (e.g. `pnpm db:seed:posts`, Onda 0 migrations) since those
|
|
# bypass the deployed Payload hooks. Default tag is `posts`; allowlisted tags also include
|
|
# `global_privacy-policy` for /privacidade. MUST be set in the Vercel project env for production. Generate with e.g. `openssl rand -hex 32`.
|
|
REVALIDATE_SECRET=YOUR_REVALIDATE_SECRET_HERE
|
|
|
|
# Web Push (D2 — /campanha notifications). Generate VAPID keys with: npx web-push generate-vapid-keys
|
|
VAPID_PUBLIC_KEY=
|
|
VAPID_PRIVATE_KEY=
|
|
VAPID_SUBJECT=mailto:campanha@jorgesolla.com.br
|
|
NEXT_PUBLIC_VAPID_PUBLIC_KEY=
|
|
|
|
# Campaign password reset emails (Resend). Required in production for forgot-password.
|
|
RESEND_API_KEY=YOUR_RESEND_API_KEY_HERE
|
|
CAMPAIGN_EMAIL_FROM=campanha@jorgesolla.com.br
|
|
CAMPAIGN_EMAIL_FROM_NAME=Campanha Jorge Solla
|
|
|
|
# Note: the automated test suite ignores this file and reads .env.test instead,
|
|
# and only ever runs against a database whose name ends with "_test".
|
|
|
|
# DeepSeek API key for the AI chat feature (Sollinha).
|
|
# Get one at https://platform.deepseek.com/api_keys
|
|
DEEPSEEK_API_KEY=YOUR_DEEPSEEK_API_KEY_HERE
|