Reusable starter repo for building a domain-specific news or newsletter tracker. It keeps the production plumbing from the education newsletter system, but removes the original project history, trained model artefacts, live source roster, private notes, and client-specific governance write-ups.
Use this as the base for a new tracker when you want the same shape of system: source ingestion, Supabase storage, classification, ranking, summary enrichment, monitoring jobs, and a curator dashboard.
- Python scraping and ingestion modules under
src/scraping/. - Sentence-transformer embedding and scikit-learn classifier training under
src/classify/. - FastAPI model serving under
src/serving/. - Streamlit curator dashboard under
dashboard/. - Supabase migrations under
migrations/. - Manual GitHub Actions workflows under
.github/workflows/. - Reusable governance templates under
docs/templates/.
- No trained model files.
- No original labelled training data.
- No real source roster or Google Alert feed URLs.
- No previous project history.
- No client/stakeholder notes.
-
Create a new GitHub repository from this template.
-
Edit
config/domain.ymlwith the tracker name, labels, colours, relevance terms, and table names. -
Copy
config/sources.example.ymltosrc/scraping/sources.ymland replace the example sources. -
Set up a fresh Supabase project and run the migrations in
migrations/. -
Add labelled training data as
data/modelling/train.csvanddata/modelling/val.csv. -
Train a model:
python src/pipeline.py --training
-
Deploy the FastAPI classifier and set the app secrets.
-
Turn on the scheduled GitHub Actions once secrets and sources are ready.
The training scripts expect:
data/modelling/train.csvdata/modelling/val.csv
Each file should contain at least:
text_clean: text used for classification.target: class label matching one of the label keys inconfig/domain.yml.titleandurlare optional but useful for evaluation outputs.
python -m venv .venv
source .venv/bin/activate
pip install -r requirements-dev.txt
python -m pytest tests/ -qRun the dashboard locally:
streamlit run dashboard/app.pyRun the API locally after training a model:
uvicorn src.serving.api:app --host 0.0.0.0 --port 8000Start from .env.example. For a deployed tracker, configure secrets in the hosting
provider and in GitHub Actions rather than committing local .env files.
Typical runtime secrets:
SUPABASE_URLSUPABASE_SERVICE_KEYCLASSIFIER_API_URLCLASSIFIER_API_KEYOPENAI_API_KEYANTHROPIC_API_KEYif you use Anthropic fallback enrichment
The included workflows are templates. Keep them manual until a new tracker has:
- a fresh Supabase project,
- a deployed classifier,
- configured secrets,
- reviewed schedules,
- curated source and relevance config.
Use the files in docs/templates/ as starting points for a new tracker:
- model card,
- dataset datasheet,
- threat model,
- deployment checklist.