A full-stack flashcard application implementing spaced repetition learning with multiuser support, using React frontend, FastAPI backend, and PostgreSQL database.
- β Basic Functionality: Complete spaced repetition flashcard system
- β Relational Database: PostgreSQL with proper relationships and constraints
- β Data Persistence: Robust data storage with backup and migration scripts
- β Better Looking UI: Modern, responsive React interface with clean design
- β Full Flashcard CRUD Capabilities: Complete admin interface for managing flashcards
- β Implementing Multiple Users: Full multiuser support with isolated data per user
- β Documentation: Comprehensive README, API docs, and code documentation
β οΈ Automated Testing: (In Progress) Complete test suite with 120+ tests and GitHub Actionsβ οΈ Automated Deployment/CI Work: (In Progress) Partial implementation with GitHub Actions (in progress)
- π€ Multiuser Support: Up to 5 users with individual flashcard collections
- π User Management: Create, switch between, and delete users
- π§ Spaced Repetition Algorithm: 12-bin system with increasing time intervals
- π Smart Review Logic: Prioritizes cards ready for review per user
- π Progress Tracking: Monitors correct/incorrect answers for each user
- π« Automatic Filtering: Hides cards that are too difficult (10+ wrong answers)
- π Language Support: Supports vocabulary learning in multiple languages with Unicode support
- π€ User Selection: Clean user switching and management interface
- π Study Mode: Focused flashcard review interface per user
- βοΈ Admin Tools: Create, edit, and delete user-specific flashcards
- π¨ Modern UI: Responsive design with visual bin indicators
- β±οΈ Real-time Status: Shows review progress and completion messages
- π Pagination: Navigate through large flashcard collections efficiently
- π Search & Filter: Find specific flashcards with search functionality
- π Sorting Options: Sort flashcards by various criteria (word, bin, date, difficulty)
- Maximum 5 Users: Enforced limit to prevent overcrowding
- User-Specific Data: Each user has their own flashcards and progress
- Isolated Learning: Progress and cards are completely separate per user
- Quick User Switch: Easy switching between users without losing progress
- Bulk Operations: Delete user removes all their flashcards automatically
βββ frontend/ # React application (port 3000)
βββ backend/ # FastAPI application (port 8000)
βββ database/ # PostgreSQL database
βββ deployment/ # Deployment configurations and scripts
βββ scripts/ # Database and management scripts
- Node.js (16+)
- Python (3.8+)
- PostgreSQL
# Setup database and development environment
./scripts/setup_dev.sh # Complete setup for new installations
# Start the application
./scripts/start_multiuser_app.sh# For new databases
./scripts/setup_db.sh # Create database with multiuser support
# For existing databases (migration)
./scripts/migrate_to_multiuser.sh # Add multiuser support to existing DBcd backend
pip install -r requirements.txt
cp .env.example .env
# Update DATABASE_URL in .env file
python main.pycd frontend
npm install
npm start./scripts/test_multiuser_api.sh # Test multiuser API endpoints
./scripts/clear_db.sh # Clear all data (with confirmation)
./scripts/manage_db.sh # Interactive database management
./scripts/backup_db.sh # Backup and restore database- Landing Page: Shows user selection interface
- Create Users: Add users (up to 5 maximum)
- Select User: Choose active user for session
- Add User: Create new user (if under 5 limit)
- Switch User: Change active user anytime
- Delete User: Remove user and all their flashcards
- User Validation: Prevents duplicate names and enforces limits
- Individual Progress: Each user's learning progress is isolated
- Personal Flashcards: Cards belong to specific users
- Separate Statistics: Study status calculated per user
- Independent Reviews: Spaced repetition timing per user
- Bin 0: New cards (immediate review)
- Bins 1-11: Graduated cards with increasing intervals
- Bin 1: 5 seconds
- Bin 2: 25 seconds
- Bin 3: 2 minutes
- Bin 4: 10 minutes
- Bin 5: 1 hour
- Bin 6: 5 hours
- Bin 7: 1 day
- Bin 8: 5 days
- Bin 9: 25 days
- Bin 10: 4 months
- Bin 11: Never (completed)
- Ready cards from bins 1-11 (higher bins first)
- New cards from bin 0
- Status messages when no cards available
- β Correct answer: Move to next bin
- β Wrong answer: Reset to bin 1, increment error count
- π« 10+ errors: Move to "hard to remember" (hidden)
POST /api/v1/users/- Create new userGET /api/v1/users/- Get all usersGET /api/v1/users/{id}- Get specific userPUT /api/v1/users/{id}- Update userDELETE /api/v1/users/{id}- Delete user and all flashcards
POST /api/v1/flashcards/- Create new flashcard for userGET /api/v1/flashcards?user_id={id}- Get user's flashcardsGET /api/v1/flashcards/{id}- Get specific flashcardPUT /api/v1/flashcards/{id}- Update existing flashcardDELETE /api/v1/flashcards/{id}- Delete flashcard
GET /api/v1/study/next?user_id={id}- Get next card for userPOST /api/v1/study/{card_id}/review- Submit review resultGET /api/v1/study/status?user_id={id}- Get user's study status
cd backend
bash start_server.shAPI documentation available at http://localhost:8000/docs
cd frontend
npm startApplication available at http://localhost:3000
# Start both frontend and backend
./scripts/start_multiuser_app.shid(VARCHAR, Primary Key)name(VARCHAR, Unique)created_at(TIMESTAMP)updated_at(TIMESTAMP)
id(VARCHAR, Primary Key)user_id(VARCHAR, Foreign Key β users.id)word(VARCHAR)definition(TEXT)bin_number(INTEGER)incorrect_count(INTEGER)next_review(TIMESTAMP)created_at(TIMESTAMP)updated_at(TIMESTAMP)is_hard_to_remember(BOOLEAN)- Unique Constraint: (word, user_id) - same word allowed for different users
If you have an existing single-user installation:
-
Backup your data:
./scripts/backup_db.sh
-
Run migration:
./scripts/migrate_to_multiuser.sh
-
Verify migration:
- Creates "Default User"
- Assigns existing flashcards to default user
- Updates database schema for multiuser support
The project includes several useful database management scripts:
Tests all multiuser API endpoints:
- User creation and management
- User-specific flashcard operations
- Study functionality per user
Simple script to delete all user and flashcard data with confirmation.
Comprehensive database management tool with multiuser support:
- View user statistics and card distribution per user
- Clear all data with confirmation
- Reset learning progress per user
- Remove "hard to remember" cards per user
- Add sample data for multiple users
Full backup and restore functionality with multiuser data.
Migrates existing single-user installations to multiuser support.
- React 18 with Hooks
- Axios for API calls
- CSS3 with modern design
- Responsive multiuser interface
- FastAPI (Python) with async support
- SQLAlchemy ORM with relationships
- Pydantic for data validation
- PostgreSQL with foreign keys
- CORS enabled for development
- Environment-based configuration
- Comprehensive error handling
- Real-time user switching
- Isolated user data
MIT License
This project has been developed with the assistance of Visual Studio Code and GitHub Copilot.