AI-Powered Learning Platform with FSRS Spaced Repetition & Advanced Study Modes
StudyWise AI transforms study materials into intelligent, interactive learning experiences by combining proven educational psychology with state-of-the-art AI.
# 1. Clone and set up a virtual environment
git clone <repository-url>
cd study-wise-ai
python -m venv study-env && source study-env/bin/activate
pip install -r requirements.txt
# 2. Configure environment variables
cp .env.example .env
# Edit .env with your API keys
# 3. Generate a secure secret key (production only)
python scripts/generate_secret_key.py
# 4. Run the development server
python start_local_demo.py # http://localhost:8000
StudyWise AI ships with first-class support for Google Cloud Run. Two options are provided.
./deploy.sh # backend only, Cloud Build + Cloud Run
The script will:
- Enable required GCP APIs (Cloud Build, Cloud Run, Container Registry).
- Build the container image and push it to Container Registry.
- Deploy the image to Cloud Run with recommended CPU, memory, and scaling parameters.
- Output the live service URL so that it can be added to the frontend or CORS configuration.
Add a build trigger in the Cloud Console that points to the repository and references the included cloudbuild.yaml
. Every push to main
will then:
- Build the Docker image
gcr.io/$PROJECT_ID/studywise-api:$COMMIT_SHA
. - Push it to Container Registry.
- Deploy the image to Cloud Run (region
us-central1
, service namestudywise-api
).
A minimal manual invocation looks like this:
# From the project root
gcloud builds submit --config cloudbuild.yaml
Once deployment finishes, retrieve the service URL:
SERVICE_URL=$(gcloud run services describe studywise-api \
--region us-central1 \
--format="value(status.url)")
echo "Backend available at $SERVICE_URL"
Tip : To deploy the companion React frontend as well, see
deploy-both.sh
, which builds and deploys both images and automatically wires the frontend'sVITE_API_URL
to the new backend URL.
- FSRS Algorithm: Scientific spaced repetition with 17-parameter algorithm for your flashcards
- Document Processing: PDF/DOCX upload with semantic search
- Hybrid Architecture: Weaviate (vector) + Supabase (relational)
- Semantic Search: OpenAI embeddings with similarity scoring --> Talk to you database.
- Real-time Analytics: Comprehensive learning insights and progress tracking
- FastAPI Backend: High-performance API with 36+ endpoints
- React Frontend: Modern TypeScript interface
- UUID Authentication: Secure user session management
- Comprehensive Testing: 30+ tests with automated validation
๐ React Frontend โโ โก FastAPI Backend โโ ๐ Weaviate (Vector) + ๐ Supabase (Data)
โ
๐ค OpenAI (GPT-4 + Embeddings)
Key Components:
- Study Framework: FSRS Flashcards
- Document Processing: PDF/DOCX handlers with intelligent chunking
- Vector Search: Semantic document retrieval and similarity
- Analytics Engine: Learning progress and personalized recommendations
# Quick sanity check (โ 1 second)
python scripts/pre_merge_validation.py --quick
# Full test suite (โ 45 seconds)
python scripts/pre_merge_validation.py
- Pre-commit hooks: Validate every commit automatically
- GitHub Actions: CI/CD pipeline with PR validation
- Zero disruption guarantee: All changes tested against existing functionality
- โ 442 tests collected across all modules
- โ FSRS Algorithm: Integration tests with real scheduling
- โ API Endpoints: All 36 routes validated
# Development: Auto-generates secure keys
ENVIRONMENT=development
# Production: Requires explicit SECRET_KEY
ENVIRONMENT=production
SECRET_KEY=your_secure_key_here # Generate with scripts/generate_secret_key.py
- Secret Management: Environment-based with validation
- No Hardcoded Keys: Production deployment blocked without proper secrets
- Security Scanning: Automated detection of security issues
- Smart Scheduling: 17-parameter algorithm optimizes review intervals
- 4-Point Rating: Again (1 day) โ Hard (2 days) โ Good (4 days) โ Easy (8 days)
- Adaptive Learning: Algorithm learns from your performance patterns
GET /api/v1/flashcards/due-today # Cards due for review
POST /api/v1/flashcards/{id}/review # Record review with rating
GET /api/v1/flashcards/stats/overview # Learning statistics
# Get cards due today
curl http://localhost:8000/api/v1/flashcards/due-today
# Review with FSRS rating (1=Again, 2=Hard, 3=Good, 4=Easy)
curl -X POST "http://localhost:8000/api/v1/flashcards/card_001/review?difficulty_rating=3"
# Upload PDF with automatic flashcard generation
curl -X POST -F "file=@document.pdf" -F "generate_flashcards=true" \
http://localhost:8000/api/v1/documents/upload
# Search across all documents
curl -X POST -F "query=machine learning concepts" \
http://localhost:8000/api/v1/documents/search
Component | Technology | Purpose |
---|---|---|
Backend | FastAPI + Python 3.12 | High-performance API |
Frontend | React + TypeScript + Vite | Modern UI |
Vector DB | Weaviate Cloud | Semantic search |
Database | Supabase PostgreSQL | Structured data |
AI/ML | OpenAI GPT-4 + Embeddings | Natural language processing |
Algorithm | FSRS | Scientific spaced repetition |
study-wise-ai/
โโโ ๐ง api/ # FastAPI backend
โโโ ๐ง src/study_modes/ # Learning modes (FeynmanMode, Traditional)
โโโ ๐งฎ src/flashcards/ # FSRS spaced repetition system
โโโ ๐ src/file_handlers/ # Document processing (PDF, DOCX)
โโโ ๐งช tests/ # Comprehensive test suite (442 tests)
โโโ ๐ scripts/ # Validation & deployment tools
โโโ ๐ docs/ # Documentation & guides
# 1. Validate starting point
python scripts/pre_merge_validation.py --quick
# 2. Make your changes...
# 3. Auto-validation on commit
git commit -m "Your changes" # Pre-commit hook runs
# 4. Full validation before PR
python scripts/pre_merge_validation.py
- Install validation:
python scripts/install_pre_commit_hook.py
- Follow workflow: Design โ Scaffold โ Implement โ Test
- Ensure tests pass: All validation must pass before merge
- Document changes: Update relevant documentation
- Production Security Guide: Secret management & deployment
- Testing Strategy: Validation system & best practices
- MVP Deployment Guide: Feature-separated deployment
- API Documentation: Interactive Swagger docs
# Core Application
GET / # Welcome & feature overview
GET /health # System health check
GET /docs # API documentation
# Flashcards (FSRS)
GET /api/v1/flashcards/due-today # Cards due for review
POST /api/v1/flashcards/{id}/review # Record review & get next interval
# Documents
POST /api/v1/documents/upload # Upload PDF/DOCX with processing
POST /api/v1/documents/search # Semantic search across documents
# Analytics
GET /api/v1/flashcards/stats/overview # Learning progress & insights
GET /api/v1/users/stats # User statistics & performance
# Live demos
python demo_spaced_repetition.py # FSRS algorithm demonstration
python test_feynman_demo.py # FeynmanMode teaching analysis
# Validation
python scripts/pre_merge_validation.py --quick # Fast validation
python scripts/pre_merge_validation.py # Full system validation
# Server
python start_local_demo.py # Demo server with all features
StudyWise AI - Transforming Learning Through Teaching ๐ง โจ
Built with modern AI, educational psychology, and comprehensive validation
ยฉ 2025 Renato Boemer. All rights reserved.