ByteBuilder presents a Flashcard Generator, developed for Cal Hacks 11.0. This web application allows users to upload PDF documents and generate AI-powered flashcards, creating an excellent tool for study and revision.
- Features
- Prerequisites
- Installation
- Running the Application
- Usage
- Working
- Project Structure
- Technologies Used
- Troubleshooting
- Future Improvements
Flashcard Generator is a web application that allows users to upload PDF documents and generate flashcards based on the content. It uses AI to create multiple-choice questions and answers, making it an excellent tool for study and revision.
- PDF upload and processing
- AI-powered flashcard generation
- Multiple-choice question format
- Topic-specific flashcard creation
- Interactive flashcard interface
- Python 3.8 or higher
- Groq API key (sign up at https://www.groq.com)
-
Clone the repository:
-
Create a virtual environment (for PiP):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate -
Install dependencies using PiP(requirements.txt):
pip install -r requirements.txt -
Install dependencies using Conda (environment.yml):
conda env create -f environment.yml conda activate flashcard-env -
Set up environment variables:
- Open
.envand replaceyour_api_key_herewith your actual Groq API key
-
Start the FastAPI server:
python -m uvicorn backend.app.main:app --reload -
Open a web browser and navigate to
http://Localhost:8000or whichever is provided by CLI
- Upload a PDF file using the "Upload PDF" button.
- Enter a topic and the number of flashcards you want to generate.
- Click "Generate Flashcards" to create your flashcards.
- Navigate through the flashcards using the "Previous" and "Next" buttons.
- Click on a flashcard to reveal the answer.
Crash course in Python Book Link: https://ehmatthes.github.io/pcc/
This structure represents the main directories and files in the project:
backend/: Contains the backend logic.app/: Contains Python scripts for backend functionality.__init__.py: Initializes the Python package.main.py: The entry point of the backend application.models.py: Defines database or data models.ocr.py: Script for Optical Character Recognition (OCR).VectorDB.py: Vector database management.llm.py: Logic for Large Language Model (LLM) interactions.
frontend/: Contains frontend files.index.html: The main HTML file.styles.css: The CSS file for styling.script.js: The JavaScript file for frontend functionality.
.env.example: Example of environment variables..gitignore: Files and directories to be ignored by Git.requirements.txt: List of dependencies for the backend.README.md: Project documentation.
- Backend: FastAPI, ChromaDB, Groq API
- Frontend: HTML, CSS, JavaScript
- PDF Processing: PyPDF2
- Environment Management: python-dotenv
If you encounter any issues:
- Ensure you're using Python 3.8 or higher
- Verify that all dependencies are correctly installed
- Check that your
.envfile contains the correct Groq API key - Make sure you have an active internet connection for API calls
- Implement user accounts for saving and managing flashcard sets
- Add support for more file formats beyond PDF
- Enhance the AI model for even more accurate and diverse question generation
- Develop a mobile app version for on-the-go studying
]