A modern, cloud-synced flashcard app with spaced repetition.
Built with React, Tailwind CSS, Firebase, and Lucide React. Installable as a PWA.
- π Deck Management β Create, edit, delete, and color-code your flashcard decks
- βοΈ Card Editor β Add/edit/delete cards with Markdown support (bold, italic, code, lists, headings)
- π Study Mode β Tinder-style card flip with swipe gestures and keyboard shortcuts
- π§ Spaced Repetition Lite β SM-2 inspired algorithm that reschedules cards based on your performance:
- "Didn't know" β card is reshown within 1 minute
- "So-so" β moderate interval increase
- "Knew it!" β exponentially growing intervals (1 day β 2.5 days β 6 days β ...)
- π Statistics β Track your study streaks, accuracy, and card mastery progress
- π€ Import/Export β Full JSON export/import of decks for backup and sharing
- π Firebase Authentication β Sign in with Google or email/password
- βοΈ Cloud Sync β All your decks and progress sync across devices via Firestore
- π΄ Offline Support β Works offline with local storage, syncs when back online
- π Data Migration β Easily migrate existing local data to the cloud
- π± Mobile-First β Fully responsive, optimized for smartphones
- π Dark/Light/System Theme β Automatic theme detection + manual toggle
- π Multi-Language β English, Italian, Spanish, French, German, Portuguese (auto-detects browser language)
- β‘ PWA β Installable on any device, works offline
- π― Distraction-Free β Minimal, clean UI inspired by Anki and modern card-based design
- β¨οΈ Keyboard Shortcuts β Space/Enter to flip, 1/2/3 to answer during study
- π·οΈ Tags β Organize cards with tags for filtering
- π Search β Quickly find cards within a deck
- π Mastery Stages β Cards progress through: New β Learning β Review β Mastered
- π₯ Study Streak β Tracks consecutive days of study
- π Mastery Bar β Visual progress bar showing card stages
- π Markdown Preview β Live preview toggle in the card editor
- π¨ Color-coded Decks β 12 color options for deck organization
- Node.js β₯ 18
- npm β₯ 9
- Firebase project (free tier is fine)
git clone <your-repo-url>
cd flashmind
npm install- Go to Firebase Console
- Create a new project (or use existing)
- Enable Authentication:
- Go to Authentication β Sign-in method
- Enable Google provider
- Enable Email/Password provider
- Create Firestore Database:
- Go to Firestore Database β Create database
- Start in test mode (for development)
- Get Your Config:
- Go to Project Settings β Your apps β Add web app
- Copy the config values
cp .env.example .envEdit .env with your Firebase config:
VITE_FIREBASE_API_KEY=AIzaSy...
VITE_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=your-project-id
VITE_FIREBASE_STORAGE_BUCKET=your-project.appspot.com
VITE_FIREBASE_MESSAGING_SENDER_ID=123456789
VITE_FIREBASE_APP_ID=1:123456789:web:abc123In Firebase Console β Firestore β Rules, paste:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Users can only access their own data
match /users/{userId}/{document=**} {
allow read, write: if request.auth != null && request.auth.uid == userId;
}
}
}npm run devOpen http://localhost:5173 in your browser.
npm run build
npm run preview- Push this repository to GitHub
- Go to vercel.com and sign in
- Click "New Project" β Import your GitHub repo
- Add environment variables:
- Add all
VITE_FIREBASE_*variables from your.env
- Add all
- Deploy! π
npm i -g vercel
vercel --prod- Add your Vercel domain to Firebase Auth β Authorized domains
- Update Firestore security rules for production
- Test Google Sign-In on the deployed URL
flashmind/
βββ public/
β βββ icons/ # PWA icons (192Γ192, 512Γ512)
β βββ manifest.json # PWA manifest
β βββ sw.js # Service worker
βββ src/
β βββ components/
β β βββ AuthScreen.tsx # Login/Register UI
β β βββ BottomNav.tsx # Tab navigation bar
β β βββ CardEditor.tsx # Card CRUD view
β β βββ DeckManager.tsx # Home view with deck list
β β βββ FlashcardViewer.tsx # Study mode with flip & SR
β β βββ MarkdownRenderer.tsx# Markdown rendering wrapper
β β βββ Modal.tsx # Reusable modal component
β β βββ SettingsView.tsx # Theme, language, account
β β βββ StatsView.tsx # Statistics dashboard
β β βββ Toast.tsx # Toast notifications
β βββ config/
β β βββ firebase.ts # Firebase initialization
β βββ context/
β β βββ AppContext.tsx # Global state + Firebase sync
β βββ hooks/
β β βββ useAuth.ts # Firebase Auth hook
β β βββ useLocalStorage.ts # Persistent state hook
β β βββ useTheme.ts # Theme management hook
β β βββ useTranslation.ts # i18n hook
β βββ i18n/
β β βββ translations.ts # Translation strings (6 languages)
β βββ services/
β β βββ firestoreService.ts # Firestore CRUD operations
β βββ types.ts # TypeScript type definitions
β βββ utils/
β β βββ id.ts # UUID generator
β β βββ spacedRepetition.ts # SR algorithm
β βββ App.tsx # Root component
β βββ index.css # Global styles
β βββ main.tsx # Entry point
βββ .env.example # Environment variables template
βββ index.html
βββ package.json
βββ vite.config.ts
βββ README.md
βββ DEVELOPMENT.md
FlashMind uses a simplified SM-2 algorithm:
| Answer | Effect |
|---|---|
| β Didn't know | Reset streak, 1 min interval, ease -0.3 |
| π€ So-so | Keep streak, interval Γ1.2, ease -0.1 |
| β Knew it! | Streak +1, interval Γease, ease +0.15 |
Card Stages:
- π New β Never studied
- π‘ Learning β Interval < 1 day
- π΅ Review β Interval 1-21 days
- π’ Mastered β Interval > 21 days
| Language | Code | Auto-detect |
|---|---|---|
| English | en |
β |
| Italiano | it |
β |
| EspaΓ±ol | es |
β |
| FranΓ§ais | fr |
β |
| Deutsch | de |
β |
| PortuguΓͺs | pt |
β |
- Firestore Rules ensure users can only access their own data
- No sensitive data in frontend β API keys are safe for client-side Firebase
- Google OAuth handles authentication securely
- Offline data stored in localStorage (encrypted in transit via HTTPS)
FlashMind uses a JSON format for data portability:
{
"version": "1.0.0",
"exportedAt": 1700000000000,
"decks": [
{
"id": "uuid",
"name": "Spanish Basics",
"description": "Common Spanish vocabulary",
"color": "#6366f1",
"cards": [
{
"id": "uuid",
"front": "**Hola**",
"back": "Hello / Hi",
"tags": ["greetings"],
"sr": { "stage": 0, "ease": 2.5, "interval": 0, "streak": 0, "nextReview": 0 }
}
]
}
]
}MIT License β free for personal and commercial use.
Made with β€οΈ and β β Happy studying! π