Student wellness via Telegram. Deno + Supabase + Ollama. Mood tracking, study scheduling, escalation detection. Mac Mini for local AI.
| Component | Technology | Why |
|---|---|---|
| Telegram Bot | Deno + Telegram Bot API | Primary interface — check-ins, stress toolkit, schedule sharing |
| Backend | Deno 2 | 24/7 on Mac Mini |
| Database | Supabase (PostgreSQL) | Student profiles, mood entries, study schedules, escalation logs |
| Scheduler | Upstash QStash | Morning check-ins, wind-down reminders, weekly report triggers |
| AI | Ollama (Mac Mini) | Study schedule optimization, stress response selection, escalation detection |
| Resend | Weekly parent reports | |
| Crisis | Escalation to human counselor | When escalation detected, alert school's counselor via email/SMS |
| students | ||
|---|---|---|
| id | uuid | |
| telegram_chat_id | varchar(50) | |
| timezone | varchar(50) | |
| school_id | uuid (FK, nullable) | For school-wide accounts |
| parent_email | varchar(255) (nullable) | For weekly reports |
| consent_parent_reports | boolean | |
| mood_entries | ||
|---|---|---|
| id | uuid | |
| student_id | uuid (FK) | |
| mood_score | integer (1–10) | |
| context | text | What triggered the mood |
| created_at | timestamp | |
| escelation_flag | boolean | Auto-set by AI if patterns detected |
| study_schedules | ||
|---|---|---|
| id | uuid | |
| student_id | uuid (FK) | |
| subject | varchar(100) | |
| exam_date | date | |
| target_hours | integer | |
| daily_schedule_json | jsonb | [{time, subject, break_minutes}] |