Skip to content

ttang1024/AI_Study_Platform

Repository files navigation

Study Platform

AI-powered learning — from any content, in any subject

.NET React TypeScript PostgreSQL Redis License: MIT

Upload documents in 80+ formats, videos (paste any link — YouTube · Bilibili · Vimeo · TED · Dailymotion · TikTok · Facebook · Instagram · X · Reddit · LinkedIn, auto-detected — or your own files), podcasts (paste any episode link, RSS feed, or MP3), and web articles — AI generates summaries, flashcards, quizzes, glossaries, and mind maps. Master any topic with spaced repetition, one-button daily smart sessions, an exam planner with AI mock exams and cram sheets, and a hands-free voice tutor.


Study Platform demo


Features

Category What you get
📄 Content Sources 80+ document formats — PDF (scanned PDFs & images get AI OCR), Office incl. legacy .doc/.ppt/.xls, OpenDocument, iWork, eBooks (EPUB / MOBI / FB2), email (EML / MSG / MHTML), XPS / Visio / SVG, Jupyter notebooks, subtitles, LaTeX / Markdown / HTML / RTF, source code — plus online video from 11 sites auto-detected from the pasted link (YouTube & Bilibili with playlist / multi-part import; Vimeo, TED, Dailymotion; public TikTok, Facebook, Instagram, X/Twitter, Reddit, LinkedIn posts), uploaded videos & audio (most containers), web article clipping, podcasts from any episode link (Apple Podcasts, Overcast, Castro, Pocket Casts, Podbean, Buzzsprout & more — plus RSS feeds with an episode picker and direct MP3 links)
🤖 AI Generation Summaries, flashcards (basic / cloze / chart), adaptive quizzes (difficulty tunes to your performance on the material), glossaries, mind maps, worked problems
🎯 Study Tools Rich-text notes, hands-free voice tutor (speaks, listens, and answers back), graded teach-back, photo problem capture, FSRS-4.5 spaced repetition, question bank, knowledge graph & learning paths
🗓️ Today & Practice Daily study plan with goal budgeting, one-button smart session (due reviews + mistake redos + weak concepts, interleaved), unified Practice / Exam mode (quiz · flashcard · glossary · problem), timed runner
🎓 Exam Prep Exam planner with countdown & day-by-day schedule, AI cram sheets built from your weak spots, timed AI mock exams, mistakes notebook, reinforcement center
📊 Insights Time-on-task & accuracy analytics, per-course mastery, knowledge-gap detection, AI recommendations, AI usage & estimated cost, XP & levels
🔔 Reminders Browser push reminders when flashcards come due (Web Push), notification digest — due cards, streak-at-risk, daily-goal progress, top knowledge gaps
📴 Offline PWA Installable app shell; flashcards & glossary cached for offline review with background sync
🔊 Extras PDF annotations, text-to-speech, semantic full-text search (finds related concepts even when the words differ) + ask-your-library AI answers (cited sources), public share links
🔄 Import / Export Anki import & export, Notion / Markdown ZIP import, study-pack export (PDF / CSV), ICS calendar feed, web clipper, highlight-to-flashcard from any web page
👥 Study Groups Shared courses & documents, real-time chat, live co-study rooms with shared focus timer, assignments, live quiz battles, XP leaderboard
🔐 Auth Email + OTP, Google / GitHub OAuth, JWT sessions
📱 Mobile App React Native (Expo) app in rn/ with full web-feature parity, plus biometric app lock, camera scan-to-summarize, haptic study feedback, keep-awake exams, offline review, and push reminders

AI Providers — Gemini · OpenAI · Claude · Grok · DeepSeek · Kimi · Doubao · Qwen · Wenxin Yiyan (multi-provider routing, switchable from settings)


Tech Stack

Backend — .NET 10 · ASP.NET Core · EF Core 9 · MediatR · FluentValidation · SignalR · PostgreSQL · Redis · Amazon S3 · yt-dlp · ffmpeg · Whisper.net · MailKit · JWT

Frontend — React 19 · TypeScript 5.8 · Vite 6 · TailwindCSS 4 · React Router 7 · Tiptap · D3.js + Markmap · Service Worker + idb-keyval (offline PWA)

Mobile — React Native 0.86 · Expo SDK 57 · expo-router · SignalR · WebView-hosted pdf.js / KaTeX / markmap (see rn/README.md)

Sharedpackages/core (@study/core): platform-agnostic API services, SSE stream reader, and DTOs consumed by web/, rn/, and extension/

Build systems: Vite (npm run dev / npm run build) is the production path — deploy.sh ships web/dist to S3/CloudFront. The Next.js scripts (dev:next / build:next / start:next) are an alternative SSR entry (web/src/app) added for landing/share-page SEO experiments and are not deployed; keep changes working under Vite first.

Architecture — Clean Architecture · CQRS · Repository + Unit of Work · SSE streaming


Local Setup

Prerequisites — .NET SDK 10 · Node.js 18+ · PostgreSQL 17 with pgvector (migrations create the vector extension — stock Postgres won't migrate) · Redis 7+ · ffmpeg · AWS CLI Required services — Google Gemini API key, Google & GitHub OAuth apps, SMTP/SES email, S3 or MinIO storage (other AI providers optional)

# 1. Clone
git clone https://github.com/your-username/Study_Platform.git
cd Study_Platform

# 2. Create database
psql postgres -c "CREATE USER studyplatform WITH PASSWORD 'yourpassword';"
psql postgres -c "CREATE DATABASE studyplatform OWNER studyplatform;"

# 3. Start local services (MinIO console: http://localhost:9001, minioadmin / minioadmin123)
redis-server
docker compose up -d minio minio-init

# 4. Configure server/StudyPlatform.API/appsettings.Development.json (see below)

# 5. Migrate & run backend
cd server
dotnet ef database update --project StudyPlatform.Infrastructure --startup-project StudyPlatform.API
dotnet run --project StudyPlatform.API     # → http://localhost:5001

# 6. Run frontend
cd web && npm install && npm run dev       # → http://localhost:3000

# 7. (Optional) Run the mobile app — see rn/README.md for env setup
cd rn && npm install && npx expo start

Configuration

server/StudyPlatform.API/appsettings.Development.json

{
  "ConnectionStrings": {
    "DefaultConnection": "Host=localhost;Port=5432;Database=studyplatform;Username=studyplatform;Password=yourpassword",
  },
  "Redis": { "Enabled": false, "ConnectionString": "localhost:6379" },
  "JwtSettings": {
    "SecretKey": "your-32-char-secret",
    "AccessTokenExpiryMinutes": 15,
    "RefreshTokenExpiryDays": 7,
  },
  "EmailSettings": {
    "Provider": "Ses",
    "FromEmail": "you@gmail.com",
    "SesRegion": "ap-southeast-2",
  }, // or SMTP fallback
  "S3": {
    "BucketName": "documents-dev",
    "ServiceUrl": "http://localhost:9000", // local MinIO
    "PublicServiceUrl": "http://localhost:9000",
    "ForcePathStyle": true,
    "AccessKey": "minioadmin",
    "SecretKey": "minioadmin123",
  },
  "GoogleOAuth": { "ClientId": "xxxx.apps.googleusercontent.com", "ClientSecret": "GOCSPX-..." },
  "GitHubOAuth": { "ClientId": "Ov23lic...", "ClientSecret": "..." },
  "Cors": { "AllowedOrigins": ["http://localhost:3000", "http://localhost:3001"] },
  "AppLimits": { "DocumentUploadLimit": -1 }, // -1 = unlimited; hosted default is 10 documents / audio / video uploads per account
  // Optional — enables browser push reminders for due flashcards.
  // Generate a key pair once with: npx web-push generate-vapid-keys
  "Vapid": { "PublicKey": "", "PrivateKey": "", "Subject": "mailto:you@example.com" },
  // Optional — AI token metering. DailyTokenLimit 0 = unlimited; Pricing is per-million
  // tokens keyed by model-name prefix (longest match wins) and drives the cost estimates
  // in the AI-usage view. Unpriced models still log tokens, just with a $0 estimate.
  "AiUsage": {
    "DailyTokenLimit": 0,
    "Pricing": { "gemini-2.5-flash": { "InputPerMillion": 0.30, "OutputPerMillion": 2.50 } },
  },
}

web/.env.local (and admin/.env.local with just VITE_API_URL)

VITE_API_URL=http://localhost:5001
VITE_GOOGLE_CLIENT_ID=xxxx.apps.googleusercontent.com
VITE_GITHUB_CLIENT_ID=Ov23lic...

Web Clipper

Clip any web page into your library as a cleaned-up Markdown article:

  • Browser extension — load extension/ as an unpacked extension (Chrome / Edge / Brave). Also adds a right-click Save selection as flashcard action: the highlighted text becomes the front, AI writes the back. See extension/README.md.
  • Bookmarklet — Settings → Export → Web Clipper bookmarklet; no install needed.

Deployment

Docker (self-hosted)

Bundles PostgreSQL, Redis, and MinIO — no external database, cache, or storage account needed.

cp .env.example .env          # fill in all values
docker compose up --build -d
docker compose exec api dotnet ef database update \
  --project StudyPlatform.Infrastructure --startup-project StudyPlatform.API

Web :3000 · Admin :4200 · API + Swagger :5001 · MinIO console :9001

VITE_* variables are baked in at build time — rebuild frontend images after changing them. MinIO credentials and bucket come from .env (MINIO_ROOT_USER / MINIO_ROOT_PASSWORD / S3_BUCKET_NAME); S3_PUBLIC_SERVICE_URL must be reachable from the host browser.

Kubernetes (Helm)

Cloud-agnostic chart at k8s/helm/study-platform/ running the same stack (API, web, admin, in-cluster Postgres/Redis/MinIO) on any cluster — kind/minikube locally, EKS/GKE in production. Note: the API is single-replica by design (in-process background workers + SignalR without a backplane).

AWS

./deploy.sh provisions ECS on a low-cost EC2 instance (t3.micro, ECS_MEMORY=768 by default — override for more headroom), an ALB for the API, RDS PostgreSQL, ElastiCache Redis, S3 buckets, and static web / admin frontends. Export DB_PASS, JWT_SECRET, GOOGLE_CLIENT_ID/SECRET, GITHUB_CLIENT_ID/SECRET, SMTP_USER, and SMTP_PASSWORD before running it.

Video transcripts (production)

Online videos (YouTube, Bilibili, Vimeo, TED, Dailymotion, TikTok, and public social posts) use native captions when available (YouTube json3 or WebVTT), then fall back to yt-dlp + Whisper; uploaded videos are transcribed with ffmpeg + Whisper. YouTube may block cloud IPs — set YOUTUBE_PROXY_URL (SOCKS/HTTP proxy) and optionally YOUTUBE_COOKIES_B64="$(base64 < cookies.txt | tr -d '\n')" before running ./deploy-backend.sh.


License

MIT

About

AI study platform for generating summaries, flashcards, quizzes, and mind maps from documents, videos, podcasts, and web articles.

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors