FlashLearn is a simple study app where you upload PDF notes and get AI-generated flashcards and timed quizzes.
- Frontend: React, Vite, Tailwind CSS
- Backend: FastAPI (Python)
- Database: SQLite + SQLAlchemy ORM
- AI: Google Gemini 1.5 Flash API
- PDF parsing: PyPDF2
Create a virtual environment using pyenv / python -m venv and activate it.
Copy .env.example to .env in the project root and fill in your values:
cp .env.example .envRequired variables:
GEMINI_API_KEY— your Gemini API keyDATABASE_URL— defaults tosqlite:///./flashlearn.dbCORS_ORIGINS— usuallyhttp://localhost:5173
cd backend
pip install -r requirements.txt
uvicorn main:app --reload --port 8000The API will be available at http://localhost:8000.
Key endpoints:
POST /api/upload— upload a PDF, returnsdoc_idGET /api/flashcards/{doc_id}— list flashcards for a documentPOST /api/quiz/start— start a quiz for a documentPOST /api/quiz/answer— submit an answer, returns next question or completionGET /api/quiz/results/{quiz_id}— quiz results
cd frontend
npm install
npm run devOpen http://localhost:5173 in your browser.
- Upload a PDF from the homepage (drag and drop or file picker).
- Wait for flashcards to be generated (spinner shows progress).
- Review flashcards (click to flip between question and answer).
- Choose quiz size (5 / 10 / 15) and take a timed quiz (30s/question).
- View results: score, time taken, and list of wrong answers with corrections.
- No authentication is implemented; everything is anonymous and local.
- Errors from Gemini or PDF parsing are surfaced as user-friendly messages in the UI.
- Layout is responsive and tuned for both desktop and mobile.