GoCard is a lightweight, file-based spaced repetition system (SRS) built in Go. It uses plain Markdown files organized in directories as its data source, making it perfect for developers who prefer working with text files and version control.
- File-Based Storage: All flashcards are stored as Markdown files in regular directories
- Git-Friendly: Easily track changes, collaborate, and back up your knowledge base
- Terminal Interface: Clean, distraction-free TUI for focused learning
- Rich Markdown Support: Full Markdown rendering with syntax highlighting
- Spaced Repetition Algorithm: Enhanced SM-2 algorithm implementation
- Interactive Statistics: Comprehensive views of your learning progress
- Cross-Platform: Works on Linux, macOS, and Windows
Download the latest binary for your platform from the releases page.
go install github.com/DavidMiserak/GoCard/cmd/gocard@latest
git clone https://github.com/DavidMiserak/GoCard.git
cd GoCard
go build -o gocard ./cmd/gocard
- Create a directory for your flashcards:
mkdir -p ~/GoCard/programming
- Create your first card as a markdown file:
touch ~/GoCard/programming/two-pointer-technique.md
- Edit the file with the following markdown structure:
---
tags: [algorithms, techniques, arrays]
created: 2025-04-02
review_interval: 0
---
# Two-Pointer Technique
## Question
What is the two-pointer technique in algorithms and when should it be used?
## Answer
The two-pointer technique uses two pointers to iterate through a data structure simultaneously.
It's particularly useful for:
- Sorted array operations
- Finding pairs with certain conditions
- String manipulation (palindromes)
- Linked list cycle detection
Example (Two Sum in sorted array):
```python
def two_sum(nums, target):
left, right = 0, len(nums) - 1
while left < right:
current_sum = nums[left] + nums[right]
if current_sum == target:
return [left, right]
elif current_sum < target:
left += 1
else:
right -= 1
return [-1, -1] # No solution
- Launch GoCard and point it to your directory:
gocard -dir ~/GoCard
GoCard features a clean, terminal-based user interface designed for distraction-free learning. Below are screenshots of the main application screens:
Click to view GoCard Interface Gallery
The main menu provides quick access to study, browse decks, and view statistics.
Browse and select from your collection of flashcard decks.
Focus on one question at a time with a clean, distraction-free interface.
Rate your recall using the SuperMemo algorithm scale after revealing the answer.
Get an overview of your study progress and retention rates.
Analyze performance for specific decks with detailed metrics.
GoCard follows a standard Go project layout with a focus on modularity and clean separation of concerns:
github.com/DavidMiserak/GoCard/
├── cmd/gocard/ # Main application entry point
├── internal/ # Private implementation packages
│ ├── data/ # Data handling and storage
│ │ ├── dummy_store.go # Sample data for demo mode
│ │ ├── markdown_parser.go # Markdown parsing for cards
│ │ ├── markdown_writer.go # Writing cards back to markdown
│ │ └── store.go # Main data store functionality
│ ├── model/ # Data models
│ │ ├── card.go # Card model
│ │ └── deck.go # Deck model
│ ├── srs/ # Spaced repetition algorithm
│ │ └── algorithm.go # SM-2 implementation
│ └── ui/ # Terminal user interface
│ ├── browse_decks.go # Deck browsing screen
│ ├── main_menu.go # Main menu screen
│ ├── markdown_renderer.go # Markdown rendering
│ ├── stats_screen.go # Statistics screens
│ ├── study_screen.go # Card study interface
│ └── styles.go # UI styling
├── assets/ # Application resources
└── docs/ # Documentation
GoCard supports the following command-line options:
Usage: gocard [options]
Options:
-dir Directory containing flashcard decks (default: ~/GoCard)
Cards are stored as markdown files with a YAML frontmatter section for metadata:
---
tags: [tag1, tag2, tag3]
created: YYYY-MM-DD
last_reviewed: YYYY-MM-DD
review_interval: N
difficulty: 0-5
---
# Card Title
## Question
Your question goes here. This can be multiline and include any markdown.
## Answer
Your answer goes here. This can include:
- Lists
- Code blocks
- Images
- Tables
- And any other markdown formatting
GoCard implements an enhanced version of the SuperMemo-2 (SM-2) algorithm for optimal learning efficiency:
- Adaptive Intervals: Review intervals automatically adjust based on your performance
- Five-Point Rating Scale:
- 1: Blackout (complete failure)
- 2: Wrong (significant difficulty)
- 3: Hard (correct with difficulty)
- 4: Good (correct with some effort)
- 5: Easy (correct with no effort)
- Smart Scheduling: Cards are prioritized based on your learning history
GoCard provides comprehensive statistics to help you track your learning progress:
- Summary View: Overall stats including retention rate and daily progress
- Deck Review: Deck-specific metrics and rating distribution
- Review Forecast: Visual representation of upcoming reviews
The clean, distraction-free terminal interface includes:
- Deck Browser: Navigate and manage your deck collection
- Study Interface: Focus on one card at a time with markdown rendering
- Statistics Screens: Interactive visualizations of your progress
Key | Action |
---|---|
Space |
Show answer |
1-5 |
Rate card difficulty |
↑/k |
Move up/scroll up |
↓/j |
Move down/scroll down |
Enter |
Select/confirm |
Tab |
Switch tab (in statistics) |
b |
Back to previous screen |
q |
Quit |
Contributions are welcome! Please feel free to submit a Pull Request.
Before submitting PR:
- Ensure tests pass:
go test ./...
- Format your code:
go fmt ./...
- Follow conventional commits for commit messages
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by Anki and SuperMemo
- Built with Bubble Tea terminal UI framework
- Markdown rendering via Goldmark and Glamour
- Terminal styling with Lip Gloss
- Code syntax highlighting via Chroma