An AI-powered flashcard application for English B2/C1 level learners. Generate flashcards from text using AI, create them manually, and test your knowledge with interactive quizzes.
- 🤖 AI Flashcard Generation - Extract vocabulary from text using OpenAI GPT-4o
- ✏️ Manual Creation - Create custom flashcards with English-Polish translations
- 🧠 Interactive Quiz - Test knowledge with 4-option multiple choice questions
- 📚 Flashcard Management - Browse, edit, and delete your flashcard collection
- 🔐 User Authentication - Secure login with demo account available
- 🌙 Dark Theme - Modern, responsive design optimized for learning
- 🎯 B2/C1 Focus - Specifically designed for advanced English learners
Clean authentication interface with demo account option
Test your vocabulary knowledge with multiple-choice questions and real-time scoring
Paste English text and let AI extract B2/C1 vocabulary automatically
Create custom flashcards with English-Polish translations
Browse and manage your collection of 25+ vocabulary cards with edit/delete options
- Astro v5.5.5 - Modern web framework
- React v19.0.0 - UI components
- TypeScript v5 - Type safety
- Tailwind CSS v4.0.17 - Styling
- Supabase - Database and authentication
- OpenRouter.ai - AI API access
- Node.js v22.14.0 or later
- npm (comes with Node.js)
- Supabase CLI v1.0.0 or later
- Docker (for Supabase local development)
git clone <repository-url>
cd 10xCards
npm install
# Run automated setup script
# Linux/macOS:
./scripts/setup.sh
# Windows PowerShell:
.\scripts\setup.ps1
# Or using npm:
npm run setupThe setup script will:
- Install Supabase CLI (if needed)
- Start Supabase local instance
- Configure environment variables automatically
- Set up database with demo data
- Provide next steps
git clone <repository-url>
cd 10xCards
npm install# macOS
brew install supabase/tap/supabase
# Windows (PowerShell)
Invoke-WebRequest -Uri https://github.com/supabase/cli/releases/latest/download/supabase_windows_amd64.tar.gz -OutFile supabase.tar.gz
# Linux
curl -fsSL https://github.com/supabase/cli/releases/latest/download/supabase_linux_amd64.tar.gz | tar -xzCopy the example environment file:
cp .env.example .env# Start Supabase local development
supabase start
# This will output your local credentials - copy the anon keyUpdate .env with your Supabase credentials:
# Supabase Configuration (from supabase start output)
PUBLIC_SUPABASE_URL=http://127.0.0.1:54321
PUBLIC_SUPABASE_ANON_KEY=your_actual_anon_key_here
# OpenRouter.ai Configuration (optional - for AI features)
OPENROUTER_API_KEY=your_openrouter_api_key_here# Reset database and run migrations
supabase db reset
# Seed with demo data
supabase db seednpm run devVisit http://localhost:3000 and sign in with:
- Email:
demo@example.com - Password:
demopass
AI flashcard generation requires an OpenRouter API key:
- Visit OpenRouter.ai
- Sign up for an account
- Generate an API key
- Add it to your
.envfile asOPENROUTER_API_KEY
Note: The app works without an API key, but AI generation will be disabled.
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run setup- Run automated setup script
npm run lint- Run ESLintnpm run lint:fix- Fix ESLint issuesnpm run format- Format code with Prettiernpm run format:check- Check code formatting
npm test- Run tests in watch modenpm run test:unit- Run unit tests with coveragenpm run test:integration- Run integration testsnpm run test:watch- Run tests in watch modenpm run test:ui- Open Vitest UInpm run test:coverage- Generate coverage report
npm run db:reset- Reset database with fresh migrationsnpm run db:seed- Seed database with demo datasupabase start- Start local Supabasesupabase stop- Stop local Supabasesupabase status- Check Supabase status
├── src/
│ ├── components/ # React components
│ │ ├── ui/ # Reusable UI components
│ │ ├── AuthForm.tsx # Authentication
│ │ ├── Quiz.tsx # Quiz interface
│ │ ├── FlashcardApp.tsx # Main app
│ │ └── ...
│ ├── lib/ # Utilities and API clients
│ │ ├── auth.ts # Authentication logic
│ │ ├── supabase.ts # Database client
│ │ └── openrouter.ts # AI API client
│ ├── pages/ # Astro pages
│ │ ├── api/ # API endpoints
│ │ └── index.astro # Main page
│ └── layouts/ # Page layouts
├── supabase/ # Database configuration
│ ├── config.toml # Supabase config
│ ├── migrations/ # Database migrations
│ └── seed.sql # Demo data
└── public/ # Static assets
- Email/password registration and login
- Password reset functionality
- Demo account for testing
- Secure session management
- Paste English text (up to 1500 words)
- AI extracts B2/C1 level vocabulary
- Review and edit suggestions before saving
- Powered by OpenAI GPT-4o via OpenRouter
- Create custom English-Polish flashcard pairs
- Simple form interface
- Instant save to your collection
- Random flashcard selection
- 4-option multiple choice format
- Instant feedback with color coding
- Score tracking and statistics
- Unlimited questions
- Browse your complete collection
- Edit existing flashcards
- Delete unwanted cards
- Filter by source (AI, manual, default)
The app uses a simple PostgreSQL schema with Supabase:
-- Flashcards table
CREATE TABLE flashcards (
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
user_id UUID REFERENCES auth.users(id) ON DELETE CASCADE,
front TEXT NOT NULL, -- English word/phrase
back TEXT NOT NULL, -- Polish translation
source VARCHAR(10) DEFAULT 'manual' CHECK (source IN ('ai', 'manual', 'default')),
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);Row Level Security (RLS) ensures users can only access their own flashcards.
The project includes comprehensive testing setup with:
- Vitest - Fast, Vite-native test runner
- Testing Library - React component testing
- jsdom - Browser environment simulation
- Coverage with v8 - Built-in code coverage
npm run test:unitTests core functions and components:
src/lib/*.test.ts- Library function testssrc/components/**/*.test.tsx- Component tests- Mocks external dependencies (Supabase, fetch)
npm run test:integrationTests API endpoints and database interactions:
src/**/*.integration.test.ts- Integration tests- Requires running Supabase locally
- Tests real API calls and database operations
npm run test:coverageGenerates detailed coverage reports in coverage/ directory.
Note: The coverage/ directory is automatically generated and should not be committed to the repository (it's included in .gitignore).
# Run all tests
npm test
# Run tests with UI
npm run test:ui
# Run tests in watch mode during development
npm run test:watch
# Run only unit tests
npm run test:unit
# Run only integration tests (requires Supabase)
npm run test:integrationGitHub Actions automatically:
- Runs linting and formatting checks
- Executes unit tests on Node.js 20.x and 22.x
- Runs integration tests with Supabase
- Generates coverage reports
- Performs security audits
- Builds the application
Tests run on every push and pull request to main branches.
# Build and run with Docker
docker-compose up -d- Build the application:
npm run build- Set up Supabase project:
- Create a new project at supabase.com
- Run migrations:
supabase db push - Update environment variables with production URLs
- Deploy to your preferred platform (Vercel, Netlify, etc.)
The project includes automated deployment workflows:
- Vercel - Automatic deployment on push to main
- Docker Hub - Docker image building on releases
- Environment secrets - Secure handling of API keys
- Port conflicts: Stop other services on ports 54321-54324
- Docker issues: Ensure Docker is running
- Migration errors: Try
supabase db reset
- Missing API key: AI features will be disabled but app still works
- Wrong URLs: Ensure LOCAL URLs for development, PRODUCTION URLs for deployment
- Login fails: Check if demo user exists in database
- No flashcards: Ensure seed data was loaded
- AI not working: Verify OpenRouter API key is valid
- Fork the repository
- Create a feature branch
- Make your changes
- Run the test suite:
npm run lint npm run test:unit npm run build
- Submit a pull request
- Setup: Run
npm run setupfor automated environment setup - Development: Use
npm run devwithnpm run test:watch - Testing: Write tests for new features and bug fixes
- Quality: Ensure all tests pass and code is properly formatted
- CI: GitHub Actions will verify your changes automatically
MIT
Demo Account: demo@example.com / demopass (25 pre-loaded B2/C1 flashcards)