Memora is an interactive flashcard application that uses AI to help you learn any topic. The application generates custom flashcards based on your chosen topic and difficulty level, evaluates your answers, and provides detailed feedback with markdown support.
The project consists of two main components:
- Flask Backend: Handles API requests, interacts with the Gemini AI API, and serves the application
- React Frontend: Provides the user interface for creating and interacting with flashcards
- Python 3.10+ for the backend
- Node.js 20+ and npm for the frontend
- Google Cloud API key with access to Gemini API
- Git
git clone <repository-url>
cd <repository-directory># Windows
python -m venv .venv
.venv\Scripts\activate
OR:
.venv\Scripts\activate.ps1
# macOS/Linux
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txtCreate a .env file in the project root:
FLASK_ENV=development
FLASK_APP=server.py
GOOGLE_API_KEY=your_google_api_key_here
# With Flask development server
flask run --debug
# Alternative (Windows)
py server.py
# Linux/MacOS
python server.pywaitress-serve server:appcd frontendnpm installCreate a .env file in the frontend directory:
VITE_API_URL=http://localhost:5000
npm run devThis will start the development server at http://localhost:5173.
npm run buildThe built files will be in the dist directory, which can be served with any static file server.
The main interface where users create new flashcard sets
Creating AI-powered flashcards on your selected topic
Answer questions and get detailed feedback with markdown support
Review your performance and save your progress
- Topic Selection: Begin by entering a topic you want to learn about
- Flashcard Generation: The AI creates custom questions based on your topic
- Answer Questions: Go through each flashcard and provide your best answer
- Instant Feedback: Receive detailed feedback with markdown formatting
- Progress Tracking: See your performance and track improvement over time
- Save Sessions: Save your progress and continue learning later
The application uses Google's Gemini API to generate custom flashcards on any topic you choose. You can select the difficulty level and number of cards to generate.
Answer questions at your own pace with an intuitive interface. Navigate through cards, track your progress, and save game sessions for later.
The AI evaluates your answers and provides detailed feedback with a rating system that helps you understand how well you've grasped the concept.
AI feedback is rendered with full markdown support, allowing for:
- Rich text formatting (bold, italic, lists)
Code blockswith syntax highlighting- Tables for structured information
- Links to additional resources
- Blockquotes for emphasizing important points
Save your learning sessions and return to them later. Track your progress over time and see how your understanding improves.
- Start both the backend and frontend servers
- Navigate to
http://localhost:5173in your browser - Enter a topic, choose difficulty level, and select the number of flashcards
- Click "Generate Flashcards" to create your study set
- Answer the questions and get AI-powered feedback
- View your results and save your progress
POST /api/generate: Generates flashcards based on the given topicPOST /api/evaluate: Evaluates user answers to flashcards
The application includes a comprehensive logging system to help with debugging and monitoring:
- Server logs are stored in
server.login the project root directory - Logs include timestamp, log level, and detailed messages
- API requests and responses are logged for debugging purposes
- Error conditions are clearly logged with full stack traces
- API client interactions with Gemini API are logged in
api.log - Includes request parameters, response data, and error details
- Helps troubleshoot AI model interactions
- Rate limiting and token limit issues are specially tagged
You can adjust the logging level in both files by modifying the logging.basicConfig section:
# More verbose logging
logging.basicConfig(level=logging.DEBUG, ...)
# Less verbose logging
logging.basicConfig(level=logging.INFO, ...)# View server logs
cat server.log
# or
tail -f server.log # Live monitoring
# View API logs
cat api.log
# or
tail -f api.log # Live monitoring- API Key Not Working: Ensure your Google API key has access to Gemini API and is correctly added to the
.envfile - CORS Errors: Check that the CORS_ORIGIN in the backend
.envfile matches your frontend URL - Rate Limiting: The Gemini API has rate limits; if you encounter errors, wait a moment and try again
- API Connection Errors: Make sure your backend server is running and the VITE_API_URL is correct
- Markdown Not Rendering: Ensure react-markdown and remark-gfm are installed correctly
- Server Response Time: For large flashcard sets, the API may take longer to generate content
