TrendScope is a full-stack economic sentiment monitoring platform. It collects financial headlines, classifies sentiment with an ONNX-optimized model, and exposes regional trend data through an API and web dashboard.
The platform tracks sentiment across seven regions:
- Global
- United States
- European Union
- Africa
- Egypt
- Saudi Arabia
- Middle East
Headline collection is scheduled with Celery Beat, and results are persisted for trend analysis and historical comparison.
- Backend: FastAPI, Celery, Redis, SQLite
- Sentiment inference: Distilled FinancialBERT exported to ONNX (quantized)
- Frontend: SvelteKit
- Deployment: Docker Compose
- backend: API, workers, model tooling, and data pipeline
- frontend: SvelteKit dashboard and API proxy routes
- docker-compose.yml: local and server orchestration
From repository root:
docker compose up --buildThis compose setup is production-oriented:
- Frontend is intended to be exposed by reverse proxy (Traefik/Coolify).
- Backend, Redis, and Celery services are internal-only.
cd backend
pip install -r requirements.txt
uvicorn main:app --reloadcd frontend
npm install
npm run devThis repository separates runtime and model-build dependencies.
- Runtime dependencies: backend/requirements.txt
- Model build/export dependencies: backend/requirements.model-build.txt
Use the model-build set only when rebuilding ONNX artifacts:
cd backend
pip install -r requirements.model-build.txt
python build_model.pyNote: model build dependencies may be significantly heavier than runtime dependencies.
Use liveness endpoints for orchestrator health decisions:
- Frontend liveness: /healthz or /health (port 3000)
- Backend liveness: /health, /healthz, or /health/live (port 8000)
Readiness diagnostics:
- Backend readiness: /health/ready or /api/health
Quick checks after deployment:
# External check (replace with your domain)
curl -i https://your-domain.example/healthz
# Internal container checks
docker compose exec frontend wget -q -O - http://localhost:3000/healthz
docker compose exec backend curl -i http://localhost:8000/health/live
docker compose exec backend curl -i http://localhost:8000/health/ready- Assign your domain to the frontend service in Coolify.
- Set the service port to 3000 in the domain configuration.
- Do not expose backend/redis/celery services with domains or host ports.
- Keep frontend health check path at /healthz.
If health appears green but the domain still times out, validate service reachability through the proxy path:
docker compose ps
docker compose logs --tail=200 frontend
docker compose logs --tail=200 backend
curl -i https://your-domain.example/
curl -i https://your-domain.example/healthzIn this situation, the common root cause is reverse-proxy networking/routing, not application liveness.
MIT. See LICENSE for details.