Skip to content

Latest commit

 

History

History
156 lines (124 loc) · 3.97 KB

File metadata and controls

156 lines (124 loc) · 3.97 KB

Study Hub — Technical Specification

1. Overview

Progetto: Portale di studio personale, mobile-first, ADHD-friendly Utente: Single-user o small group, accesso protetto via email whitelist Email: your-email@example.com URL: https://your-domain.com Stack: SvelteKit + Bun + TailwindCSS + SQLite + Lucia Auth

Obiettivi

  • Studiare/ripassare concetti tech e teorici
  • Prepararsi a colloqui tecnici
  • Tracking progresso cross-device
  • Pratica interattiva (quiz, playground, mock interview)

2. Architettura

┌─────────────────────────────────────────────────────┐
│                    Frontend                          │
│              SvelteKit (SSR + Client)               │
├─────────────────────────────────────────────────────┤
│  Lucia Auth  │  SQLite DB  │  Clawdbot API          │
│   (login)    │  (progress) │  (mock interviews)     │
└─────────────────────────────────────────────────────┘
                         │
              ┌──────────┴──────────┐
              │    Your Server      │
              └─────────────────────┘

3. Data Model (SQLite)

-- Progresso sezioni
CREATE TABLE section_progress (
  id INTEGER PRIMARY KEY,
  user_id TEXT NOT NULL,
  topic TEXT NOT NULL,
  section_id TEXT NOT NULL,
  completed BOOLEAN DEFAULT FALSE,
  completed_at DATETIME,
  last_visited_at DATETIME,
  quiz_score INTEGER,
  UNIQUE(user_id, topic, section_id)
);

-- Streak e statistiche
CREATE TABLE user_stats (
  user_id TEXT PRIMARY KEY,
  current_streak INTEGER DEFAULT 0,
  longest_streak INTEGER DEFAULT 0,
  last_study_date DATE,
  total_sections_completed INTEGER DEFAULT 0,
  total_quiz_taken INTEGER DEFAULT 0
);

-- Mock interview history
CREATE TABLE mock_interviews (
  id INTEGER PRIMARY KEY,
  user_id TEXT NOT NULL,
  topic TEXT,
  started_at DATETIME,
  completed_at DATETIME,
  questions_count INTEGER,
  score INTEGER
);

-- Sessioni di studio (per nudge)
CREATE TABLE study_sessions (
  id INTEGER PRIMARY KEY,
  user_id TEXT NOT NULL,
  started_at DATETIME,
  ended_at DATETIME,
  sections_viewed TEXT
);

4. Autenticazione (Lucia Auth)

  • Whitelist via ALLOWED_EMAILS env var
  • Middleware protegge tutte le route
  • Redirect a login se non autenticato
  • 403 se email non in whitelist

5. Features

5.1 Code Playground

  • Desktop only (Monaco Editor)
  • Mobile: messaggio "Usa desktop"

5.2 Quiz Scelta Multipla

  • 3-5 opzioni per domanda
  • Feedback immediato
  • Score salvato in DB

5.3 Sfide a Tempo

  • Timer configurabile (5/10/15 min)
  • Argomenti: Algoritmi, System Design, TypeScript
  • Submit o timeout → mostra soluzione

5.4 Mock Interview

  • Via Clawdbot (Bro)
  • 5-7 domande per sessione
  • Feedback e score alla fine

5.5 Nudge Ripasso

  • Sezione > 14 giorni → suggerisci ripasso
  • Mini-quiz opzionale
  • Score < 70% → torna "da ripassare"

5.6 Notifiche Telegram

  • Cron ore 10:00
  • Se > 3 giorni senza studio → ping

6. Priorità Implementazione

Fase 1: Auth + Sync

  • Setup Lucia Auth
  • SQLite schema
  • API progress
  • Migrazione localStorage → DB

Fase 2: Interattività

  • Quiz scelta multipla
  • Sfide a tempo
  • Nudge ripasso

Fase 3: Playground + Mock

  • Monaco Editor
  • Mock interview via Clawdbot
  • Notifiche Telegram

Fase 4: Contenuti

  • Wave 2-4 con verifica fonti
  • Quiz per ogni sezione

7. Contenuti Wave

  1. Wave 1 — TypeScript
  2. Wave 2 — Svelte, SvelteKit, Bun, Vite, ElysiaJS
  3. Wave 3 — Algoritmi, Networking, Sicurezza, System Design, App Design
  4. Wave 4 — Probabilità, ML, Matematica, Elettronica