Settings
The Settings page is the home for platform-wide knobs that apply to every school. Today it has two cards: AI provider/model selection and the coin-purchase economics that drive the parent app's "buy AI coins" flow. Per-school settings live elsewhere; this page intentionally stays small.
At a glance
| Who can do this | Super admin (full access). Regular admins can navigate here too — the Settings sidebar entry is in their trimmed sidebar — but changes are platform-wide, so audit who you let touch it. |
| Where it lives | Admin panel → /dashboard/settings (gear icon in sidebar) |
| Scope | Whole platform, not per-school |
| Related features | Coins & Credits · AI Usage · Admin Panel Overview |
Inventory of settings
The page has two cards, each with its own Save button (saves are independent — saving AI settings does not push coin settings).
Card 1 — AI Model
Controls the AI provider and model used across the platform for the AI Assistant, AI tools in the teacher/student apps, and embeddings.
| Field | Type | Notes |
|---|---|---|
| Provider | Single-select | Google Generative AI (Gemini), OpenAI, Anthropic. Changing provider clears the Model field. |
| Model | Single-select | Options depend on provider: • Google: gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite • OpenAI: gpt-5 • Anthropic: claude-4-5-sonnet, claude-4-5-haiku |
| Tokens per credit | Number (min 1) | How many AI tokens one student credit covers. Tooltip: "How many AI tokens one student credit covers." |
Save button: Save AI Settings.
Card 2 — Coin Purchases
Controls the parent app's coin-purchase flow (parents buy coins → top up their child's AI credits).
| Field | Type | Notes |
|---|---|---|
| Coins per ₹1 | Decimal (min 0.01, step 1, precision 2) | Conversion rate. Drives the "₹100 = N coins" preview text shown live. |
| Currency | Text | Currently free-text (e.g. "INR"). |
| Min purchase (₹) | Integer (min 1) | Lower bound a parent can buy in one transaction. |
| Max purchase (₹) | Integer (min 1) | Upper bound. Must be ≥ Min (validated on save with toast "Min purchase must be ≤ Max purchase"). |
| Enabled | Toggle | Master switch for the whole purchase flow. When off, parents can't buy coins at all. |
Footer line shows "Updated <timestamp>" reflecting the last save. Save button: Save Coin Settings.
How it flows
Step-by-step
1. Open the page
- Route:
/dashboard/settings(clicked from the gear icon at the bottom of the sidebar). - A loading state ("Loading settings…") shows until both cards' current values are fetched.
2. Update AI provider/model
- Pick a Provider (Gemini / OpenAI / Anthropic). Selecting a new provider clears the Model field.
- Pick a Model from the filtered options.
- Adjust Tokens per credit if the credit-economy ratio needs tuning.
- Click Save AI Settings.
- Toast on success: "Settings saved". The new provider/model takes effect for subsequent AI requests across the platform.
3. Update coin purchase rates
- Set Coins per ₹1 — the live preview at the bottom-right of the card updates immediately ("₹100 = N coins").
- (Rarely) change Currency.
- Set Min purchase and Max purchase rupee amounts.
- Toggle Enabled off if you need to disable the parent purchase flow temporarily.
- Click Save Coin Settings.
- Client-side validation runs first: if Min > Max, save is blocked with a toast. Backend errors surface as toasts as well. On success, the "Updated …" timestamp refreshes.
What's NOT here
These knobs live elsewhere — don't look for them on this page:
- Per-school overrides — there are none today. AI provider/model and coin pricing are shared across all schools.
- Cognitive categories, icons, boards / classes / subjects taxonomy — managed under their own super-admin pages.
- Coin packages (preset rupee amounts shown to parents) — managed under the Coin Packages page (super admin).
- Yearly plans, transport, sections — those are inside the school-scoped dashboard at
/dashboard/school/:id/*.
Edge cases & things to test
- Provider change wipes model: pick OpenAI → GPT-5, then switch provider to Anthropic — confirm the Model field clears (not stuck on
gpt-5) and the dropdown lists Anthropic models only. Submitting without re-selecting a model should fail "Required". - Tokens per credit = 0: try
0— should fail min-1 validation. - Tokens per credit very large: enter
999999999— confirm it saves and downstream credit math doesn't overflow. - Coins-per-rupee fractional: try
0.5(one coin per ₹2) — confirm the live "₹100 = 50 coins" preview is correct. - Min > Max blocking: set Min ₹500, Max ₹100 → Save — should be blocked client-side with toast "Min purchase must be ≤ Max purchase".
- Min == Max: set both to ₹100 → confirm save succeeds (only that exact amount becomes purchasable).
- Disable then re-enable: toggle Enabled off, save, log into the parent app — confirm the buy-coins flow is hidden/disabled. Toggle back on, save, refresh parent app — confirm it returns.
- Independent saves: change AI settings AND coin settings, click only Save AI Settings. Confirm coin changes are NOT persisted (the card's draft state stays dirty).
- Network error mid-save: kill connectivity, click Save — confirm a "Failed to update configuration" / "Failed to save coin settings" toast and the form values are preserved (not silently reset).
- Currency field: try
"USD"then"₹"— both save? Confirm any downstream parent-app text that references the currency renders correctly. - Concurrent edits: two super admins open settings simultaneously and save different values — last-write-wins is expected; confirm both UIs reflect the latest after refresh.
- Permissions: log in as a regular admin (non-super), navigate to
/dashboard/settings— page loads (the route is allowed). Decide whether changes should be permitted at all from this tier; today they are.
Related
- AI Usage — observe consumption that the tokens-per-credit ratio drives
- Coins & Credits — end-to-end where these coin rates surface
- Admin Panel Overview