Cardly is a modern flashcard application that helps you learn and memorize content through spaced repetition. Built with React frontend and Flask backend, it features AI-powered card generation from images and intelligent study scheduling.
- Spaced Repetition Algorithm: Uses the SM-2 algorithm to optimize learning retention
- Study Dashboard: View cards that are due for review based on your performance
- Progress Tracking: Cards are rescheduled based on how well you remember them
- Image-to-Flashcards: Upload images containing text and let AI generate flashcards automatically
- Google Gemini Integration: Powered by Google's Gemini AI for accurate content extraction
- Manual Card Creation: Create cards manually for full control over content
- Responsive Design: Works seamlessly on desktop, tablet, and mobile devices
- Material-UI Components: Clean, modern interface with consistent design
- Interactive Card Study: Flip cards to reveal answers with smooth animations
- Intuitive Navigation: Easy-to-use routing between different app sections
- Secure Authentication: JWT-based authentication system
- User Accounts: Each user has their own private flashcard sets
- Session Management: Persistent login sessions with secure token handling
- React 19.1.0 - Modern React with hooks and functional components
- Material-UI 7.3.2 - Google's Material Design components
- React Router 7.8.2 - Client-side routing
- Axios 1.11.0 - HTTP client for API communication
- Vite 7.0.4 - Fast build tool and development server
- Flask 3.1.2 - Python web framework
- Peewee 3.18.2 - Lightweight ORM for database operations
- MySQL - Primary database for data persistence
- JWT Authentication - Secure token-based authentication
- Google Gemini AI - AI-powered image processing
- Flask-CORS - Cross-origin resource sharing support
AIFlashCardsApp/
βββ client/ # React frontend
β βββ src/
β β βββ components/ # React components
β β βββ css/ # Custom styles
β β βββ assets/ # Static assets
β βββ dist/ # Built frontend (served by Flask)
βββ server/ # Flask backend
β βββ app/
β β βββ models/ # Database models
β β βββ logic/ # AI processing logic
β β βββ routes.py # API endpoints
β β βββ auth.py # Authentication routes
β βββ run.py # Flask application entry point
βββ README.md
- Python 3.8+
- Node.js 16+
- MySQL database
- Google Gemini API key
-
Navigate to server directory:
cd server -
Create virtual environment:
python -m venv .venv source .venv/Scripts/activate # Windows # or source .venv/bin/activate # macOS/Linux
-
Install Python dependencies:
pip install -r requirements.txt
-
Configure database:
- Copy
app/models/db.config-example.jsontoapp/models/db.config.json - Update with your MySQL database credentials:
{ "name": "your_database_name", "user": "your_username", "password": "your_password", "host": "127.0.0.1", "port": 3306 } - Copy
-
Set up API keys:
- Create
app/secret_key.pywith your secrets:
SECRET_KEY = "your-jwt-secret-key" GOOGLE_API_KEY = "your-google-gemini-api-key"
- Create
-
Initialize database:
python -m app.models.migrations
-
Navigate to client directory:
cd client -
Install dependencies:
npm install
-
Build for production:
npm run build
-
Start the Flask server:
cd server python run.py -
Access the application: Open your browser to
http://localhost:5000
The Flask server serves both the API and the built React frontend.
POST /api/signup- Create new user accountPOST /api/login- User login
GET /api/card-sets/- Get user's flashcard setsPOST /api/card-sets/- Create new flashcard setGET /api/card-sets/{id}- Get specific set detailsDELETE /api/card-sets/{id}- Delete flashcard set
GET /api/card-sets/{id}/cards- Get cards in a setPOST /api/card-sets/{id}/cards- Add cards to a setPUT /api/cards/{id}- Update specific cardDELETE /api/cards/{id}- Delete specific cardPUT /api/score/{id}- Update card performance for spaced repetition
POST /api/process-image/- Generate flashcards from uploaded image
- Click "Create New Set" from the dashboard
- Enter set name and description
- Add cards manually or upload images for AI generation
- Review and save your set
- Click "Study" on any flashcard set
- View the question, think of the answer
- Click "Reveal Answer" to see the correct answer
- Click "I remembered this π" or "I forgot this π"
- Cards are automatically rescheduled based on your performance
- When adding cards, choose "Upload Image (AI)" tab
- Upload an image containing text
- AI will automatically extract content and create flashcards
- Review and edit generated cards as needed
- id, username, email, password_hash, created_at, updated_at
- id, owner (FK), name, description, created_at, updated_at
- id, question, answer, fc_set (FK), created_at, updated_at
- interval, repetitions, ease_factor, due_date (for spaced repetition)
cd client
npm run dev # Start development server with hot reloadcd server
export FLASK_ENV=development
export FLASK_DEBUG=1
python run.py- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Spaced Repetition Algorithm: Based on the SM-2 algorithm for optimal learning
- Google Gemini AI: Powers the image-to-flashcard generation feature
- Material-UI: Provides the beautiful, consistent user interface
- Flask & React: Modern, scalable web application architecture