# Content sources & attribution

Sparkbright's question bank (`public.items`) combines open datasets, our own
procedurally-generated maths, and AI-generated courses. Attribution below
satisfies the licences; the same summary is linked from the site footer.

| Source | Licence | What we use | `items.source` tag |
|---|---|---|---|
| [Tatoeba](https://tatoeba.org) | [CC BY 2.0 FR](https://creativecommons.org/licenses/by/2.0/fr/) (some sentences CC0) | Language-pair example sentences → flashcards and translation questions | `tatoeba` |
| [kaikki.org](https://kaikki.org) (Wiktionary extract via [wiktextract](https://github.com/tatuylonen/wiktextract)) | [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/) + GFDL | Vocabulary glosses → flashcards and word-scramble items | `kaikki` |
| [Open Trivia Database](https://opentdb.com) | [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/) | Science, geography and history quiz questions | `opentdb` |
| Sparkbright archive banks + procedural maths generators | © Sparkbright | Curated science/words/world/logic questions and infinite maths | `archive` |
| Google Gemini 2.5 Flash-Lite | per [Google's Gemini API terms](https://ai.google.dev/gemini-api/terms) | On-demand course generation for typed topics | `gemini` |

## Share-alike note (CC BY-SA)

Items tagged `kaikki` and `opentdb` are licensed CC BY-SA 4.0 by their authors.
They remain under that licence as content presented within the Sparkbright
service. Each row keeps its `source` tag so provenance is always recoverable.
A formal licence review is recommended before large-scale commercial use; until
then, CC BY-SA content is used on free-tier courses, while paid-tier courses are
generated by Gemini.

## Seeding the bank

Ingest scripts live in [`scripts/`](scripts/) and run locally with a Supabase
service role key in the environment (never commit the key):

```bash
cd scripts && npm install
SUPABASE_URL=https://ftfcnxeopmgokbovyqsb.supabase.co \
SUPABASE_SERVICE_ROLE_KEY=<service_role_key> node seed-archive.js      # offline: procedural maths
SUPABASE_URL=... SUPABASE_SERVICE_ROLE_KEY=... node seed-opentrivia.js # network: OpenTDB API
# language pairs (download a Tatoeba/Anki pairs file first):
SUPABASE_URL=... SUPABASE_SERVICE_ROLE_KEY=... node seed-tatoeba.js ./eng-spa.txt en es spanish
# vocab (download a kaikki JSONL first):
SUPABASE_URL=... SUPABASE_SERVICE_ROLE_KEY=... node seed-kaikki.js ./kaikki-Spanish.jsonl es spanish
```

A small starter set of real questions across all six subjects is already loaded,
so the app is playable before you run any of these.
