Skip to content

Latest commit

 

History

History
166 lines (113 loc) · 4.1 KB

File metadata and controls

166 lines (113 loc) · 4.1 KB

📚 Cardsy — Intelligent Spaced Repetition Platform

Cardsy is a scalable, production-grade learning platform built around spaced repetition, analytics, and gamified practice.
It combines Node.js microservices, a C++ native scheduling engine, and a Mongo + PostgreSQL + Redis data strategy to deliver high performance and deep learning insights.


🖥️ Screenshots (Key Pages)

  • Dashboard
Image
  • Analytics
Image
  • Decks Page
Image
  • Flashcard (Question)
Image
  • Flashcard (Answer & Evaluation)
Image

⚙️ Technical Architecture

Microservices Overview

Service Responsibility Stack
Auth JWT, OAuth, sessions Node.js + PostgreSQL
Deck Deck & card CRUD Node.js + MongoDB
Practice Engine Card ranking & SRS Node.js + C++ + C++ Addon
Gamification XP, streaks, leaderboards Node.js + Redis
Analytics Aggregations & insights Node.js + PostgreSQL (TimescaleDB)

Communication

  • gRPC / REST via API Gateway
  • Realtime updates via WebSockets

Frontend

  • React + Tailwind CSS
  • Recharts / Chart.js

🧠 Practice Session Flow

  1. User starts a session
  2. Due cards fetched from MongoDB
  3. Metadata sent to C++ SRS engine
  4. Engine ranks cards (Regular / Hard mode)
  5. Node streams cards to frontend
  6. User responses update progress
  7. XP & analytics processed asynchronously

🧩 Spaced Repetition Algorithm (SM-2 Variant)

EF' = EF + (0.1 - (5 - quality) * (0.08 + (5 - quality) * 0.02))
interval = previous_interval * EF'
  • quality: 0–5 (derived from correctness + response time)
  • EF starts at 2.5, min 1.3
  • Implemented in C++ (Node Addon) for 10–20× speedup

⚡ Gamification Engine

  • XP, levels, streaks, badges
  • Redis Sorted Sets for leaderboards:
ZINCRBY leaderboard:userXP <value> <user_id>
  • Weekly resets via Redis Lua scripts

📊 Analytics

  • Daily activity heatmaps (365 days)
  • Deck-wise accuracy & mastery
  • Retention curves & streak tracking
  • Auto-tagging of easy / medium / hard cards

🧱 Database Strategy

Data Database
Users, Auth PostgreSQL
Decks, Cards MongoDB
User Progress MongoDB
XP, Streaks Redis + PostgreSQL
Analytics PostgreSQL (TimescaleDB)

🎯 Core Features

Learning

  • Spaced repetition (Easy / Normal / Hard modes)
  • Paragraph & MCQ answers
  • Markdown, LaTeX & images in cards

Decks

  • Public & private decks
  • Deck sharing & invites
  • Collaborative decks
  • Deck duplication

Gamification

  • XP & levels
  • Daily / monthly streaks
  • Achievements & badges
  • Deck-level leaderboards

Social

  • Friend profiles
  • Popular deck discovery
  • Competitive challenges

🧠 C++ Native Engine Responsibilities

  • Card priority ranking
  • Adaptive difficulty tuning
  • Recall probability estimation
  • Full-text search & ranking (optional)
#include <napi.h>
Napi::Object CalculateNextReview(const Napi::CallbackInfo& info);

const srs = require('./build/Release/srs.node');
const ranked = srs.rankCards(payload);

🔍 Recruiter Highlights

  • Hybrid Node.js + C++ backend
  • Custom SM-2 spaced repetition engine
  • Event-driven architecture with Redis & queues
  • Tri-database design for scale & performance
  • Real-time gamification & analytics

Built for learning. Engineered for scale.