Cadence Cards is a modern flashcard application built with SvelteKit and PostgreSQL. It implements an SM-2 based spaced repetition algorithm and integrates with Claude.AI for enhanced learning across any subject matter.
Note: This is a personal project I've open sourced. I use it daily and maintain it actively, but this isn't a commercial product with formal support.
manage.py helper commandsClone the repository with submodules:
git clone --recursive [email protected]:stalexan/cadence-cards.git
cd cadence-cards
If you already cloned without --recursive, initialize the submodule:
git submodule update --init
Create a .env file from the template:
cp .env.example .env
Edit the .env file and fill in the required values:
AUTH_SECRETCLAUDE_API_KEYBuild and start the development environment:
./manage.py build
./manage.py up -d
Or explicitly set the environment:
ENVIRONMENT=dev ./manage.py build
ENVIRONMENT=dev ./manage.py up -d
Open a shell in the running app environment:
./manage.py shell --service web
Run the database migrations:
npx prisma migrate dev
Seed the database with sample data (optional):
npx prisma db seed
Start the development server:
npm run dev
Access the application at http://localhost:5173
The project supports both development and production environments.
The application uses different ports for development and production:
npm run dev) which
provides hot module reloading, fast refresh, and development tooling. Port
5173 is Vite's default.node build) after running npm run build. The production build creates optimized
static assets and runs as a standard Node.js server without Vite. Port 3000
is the conventional port for Node.js applications.This is the standard pattern for SvelteKit applications where the development server provides enhanced tooling, while production runs the optimized built output directly.
http://localhost:5173Start development:
./manage.py build
./manage.py up -d
# or explicitly:
ENVIRONMENT=dev ./manage.py build
ENVIRONMENT=dev ./manage.py up -d
npm run buildStart production:
ENVIRONMENT=prod ./manage.py build
ENVIRONMENT=prod ./manage.py up -d
Note: Configure your reverse proxy to forward requests to the application container.
The project includes a manage.py helper for common Docker and environment tasks:
ENVIRONMENT variable (dev/prod) to
determine configurationRun ./manage.py --help for available commands.
Check for updates and security vulnerabilities:
./manage.py check-updates
This command checks:
Docker Engine (automatically updated via apt):
# Docker Engine is installed as an Ubuntu package and stays updated with:
sudo apt update && sudo apt upgrade
Docker Scout (needs manual updates):
# Quick update:
./scripts/update-docker-scout.sh
# Or manually:
curl -sSfL https://raw.githubusercontent.com/docker/scout-cli/main/install.sh | sh -s -- -b ~/.docker/cli-plugins
NPM packages (safe minor/patch updates):
./manage.py update-npm-packages
This command:
package.json and package-lock.jsonDocker base images and full rebuild:
# Pull latest base images and rebuild
./manage.py build --pull
# Or for a completely fresh build:
./manage.py build --no-cache --pull
./manage.py check-updates to monitor for security issues./manage.py update-npm-packages./manage.py build --pullweb/
├── src/
│ ├── routes/ # SvelteKit routes
│ │ ├── (dashboard)/ # Authenticated routes
│ │ ├── api/ # API Routes
│ │ ├── login/ # Authentication
│ │ ├── register/ # User registration
│ │ ├── +layout.svelte # Root layout
│ │ └── +page.svelte # Home page
│ ├── lib/ # Utility functions and components
│ ├── hooks.server.ts # Server-side hooks
│ └── auth.ts # Authentication configuration
├── prisma/ # Prisma files
└── static/ # Static assets
The application uses the following database schema:
Cadence Cards implements an SM-2 based spaced repetition algorithm with the following parameters:
Cards can be imported and exported in YAML format:
- Front: "Question or prompt"
Back: "Answer or explanation"
Note: "Optional additional information or context"
Priority: A # A, B, or C
Tags: [tag1, tag2] # Optional array of tags
You can easily share decks with other users:
The shared YAML includes metadata about the deck:
Note: Your username will be included in the shared deck metadata.
.yaml fileThe import process handles YAML with or without metadata comments, ensuring backward compatibility.
The application integrates with Claude.AI in multiple ways:
Claude-Assisted Card Creation: Generate flashcards from text input with AI assistance
Study Mode: Claude generates contextual questions based on card content to test understanding, provides feedback on answers, and offers explanations when needed
Chat Interface: Interactive conversations about topics to enhance learning and understanding
The spaced repetition algorithm used by this project is based on the the SuperMemo 2 (SM-2) algorithm developed by Piotr Woźniak.
Source: Application of a computer to improve the results obtained in working with the SuperMemo method.
I built this for my own use and I'm sharing it in case it's useful to others. Contributions, bug reports, and feature ideas are welcome!
Since this is a side project, I can't promise specific timelines or support, but I do actively use and maintain this. If you need something specific, PRs are encouraged.
This project is licensed under the MIT License - see the LICENSE file for details.