Skip to content

gdr-sys/FlashMind

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 FlashMind β€” Smart Flashcards PWA

A modern, cloud-synced flashcard app with spaced repetition.
Built with React, Tailwind CSS, Firebase, and Lucide React. Installable as a PWA.


✨ Features

Core

  • πŸ“‡ 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

Cloud & Auth πŸ†•

  • πŸ” 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

UX & Design

  • πŸ“± 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

Bonus Features

  • 🏷️ 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

πŸš€ Quick Start

Prerequisites

  • Node.js β‰₯ 18
  • npm β‰₯ 9
  • Firebase project (free tier is fine)

1. Clone & Install

git clone <your-repo-url>
cd flashmind
npm install

2. Set Up Firebase

  1. Go to Firebase Console
  2. Create a new project (or use existing)
  3. Enable Authentication:
    • Go to Authentication β†’ Sign-in method
    • Enable Google provider
    • Enable Email/Password provider
  4. Create Firestore Database:
    • Go to Firestore Database β†’ Create database
    • Start in test mode (for development)
  5. Get Your Config:
    • Go to Project Settings β†’ Your apps β†’ Add web app
    • Copy the config values

3. Configure Environment

cp .env.example .env

Edit .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:abc123

4. Set Up Firestore Security Rules

In 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;
    }
  }
}

5. Run Development Server

npm run dev

Open http://localhost:5173 in your browser.

6. Build for Production

npm run build
npm run preview

πŸ“¦ Deploy on Vercel

Option 1: One-Click Deploy

  1. Push this repository to GitHub
  2. Go to vercel.com and sign in
  3. Click "New Project" β†’ Import your GitHub repo
  4. Add environment variables:
    • Add all VITE_FIREBASE_* variables from your .env
  5. Deploy! πŸŽ‰

Option 2: Vercel CLI

npm i -g vercel
vercel --prod

Post-Deploy Checklist

  • Add your Vercel domain to Firebase Auth β†’ Authorized domains
  • Update Firestore security rules for production
  • Test Google Sign-In on the deployed URL

πŸ—‚οΈ Project Structure

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

🎯 How Spaced Repetition Works

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

🌍 Supported Languages

Language Code Auto-detect
English en βœ…
Italiano it βœ…
EspaΓ±ol es βœ…
FranΓ§ais fr βœ…
Deutsch de βœ…
PortuguΓͺs pt βœ…

πŸ”’ Security

  • 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)

πŸ“„ Import/Export Format

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 }
        }
      ]
    }
  ]
}

πŸ“œ License

MIT License β€” free for personal and commercial use.


Made with ❀️ and β˜• β€” Happy studying! πŸŽ“

About

A modern, cloud-synced flashcard app with spaced repetition.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages