LearnLoop is an integrated, AI-powered web application designed to be a one-stop-shop for studying. It combines an interactive chatbot, a quiz generator, and a flashcard creator into a single, cohesive learning experience.
As a lifelong learner and now a data science student, I constantly felt the friction of juggling multiple study tools. I had one app for notes, another for flashcards, a separate website for practice quizzes, and chatbots that felt disconnected from my actual course material. I wanted to build a single "learning command center" where I could:
- Interact with any topic through a natural, student-teacher dialogue.
- Quiz myself on specific concepts or pasted text, with instant feedback.
- Generate flashcards for quick, on-the-fly review sessions.
- Review past sessions so that no learning progress is ever lost.
The goal of LearnLoop was to blend conversation, testing, and memory aids into one seamless web experience—powered by AI, but packaged in a way that feels intuitive and focused.
This project is organized into three core, interconnected modules:
-
🧠 ThinkMate Chat
- Engage in a dynamic student-teacher dialogue on any subject.
- Control the AI's tone (natural, formal, humorous, technical) and who starts the conversation.
- Every conversation is automatically saved with a timestamp and topic for later review.
-
📝 Quiz Builder
- Instantly generate mixed-type quizzes (Multiple Choice, True/False, Fill-in-the-Blank) from any topic or pasted content.
- Answer questions in an interactive UI with immediate scoring and explanations.
- All quiz sessions are persisted, tracking your scores and showing a full history with analytics.
-
📇 Flashcard Generator
- Create sets of topic-focused flashcards with a term and a definition.
- Review your cards with a simple, responsive click-to-flip grid layout.
- All generated sets are saved for future study sessions.
-
📊 Dashboard & Analytics
- View aggregate stats: total chats, quizzes taken, average scores, and more.
- Easily navigate between recent activities and a complete history.
- A minimal, professional design keeps the focus on your learning progress.
| Layer | Technology | Rationale |
|---|---|---|
| Language | Python / JavaScript | Python for a lightweight API; JS/React for a dynamic UI. |
| Framework | Flask / React | Flask’s simplicity is perfect for an API; React’s component model is ideal for the UI. |
| AI Client | openai-python |
The official, easy-to-integrate client for OpenAI models. |
| Database | SQLite (for local dev) | Zero-setup local persistence in a single conversations.db file. |
| HTTP | REST + JSON | Simple, universal, and works perfectly with axios and Flask. |
| Styling | CSS Modules + Flexbox | A custom look with minimal dependencies, avoiding heavy UI libraries. |
| Container | Docker Compose | Allows spinning up the entire full-stack environment with a single command. |
This project is fully containerized with Docker for a simple setup.
- Docker and Docker Compose installed.
- An OpenAI API Key.
-
Clone the Repository
git clone cd learnloop -
Configure Your API Key
- In the
backend/directory, create a new file named.env. - Add your OpenAI API key to this file:
OPENAI_API_KEY=sk-YourSecretKeyHere
- In the
-
Build and Run with Docker Compose
- Install dependencies:
pip install -r requirements.txt - From the root directory of the project, run:
docker compose up --build
- This command will build the images for both the frontend and backend, install all dependencies, and start the services.
- Install dependencies:
-
Access the Application
- Frontend: Open your browser and go to
http://localhost:3000 - Backend API: The backend will be running on
http://localhost:5000
- Frontend: Open your browser and go to
Developing this project involved solving several interesting technical hurdles:
-
Challenge: Unreliable JSON from AI
- Problem: The GPT model would sometimes return JSON with formatting errors, like trailing commas, which would break the Python
json.loadsparser. - Solution: I implemented a pre-processing step using a regular expression to clean up the JSON string before parsing. I also added
try...exceptblocks to gracefully handle any remaining errors and report them.
- Problem: The GPT model would sometimes return JSON with formatting errors, like trailing commas, which would break the Python
-
Challenge: Losing Data in Docker
- Problem: The SQLite database file (
conversations.db) was being created inside the Docker container, so it was deleted every time the container was rebuilt. - Solution: I used a Docker bind mount to map the
./backenddirectory on my local machine to the/code/backenddirectory inside the container. This ensures the.dbfile persists on my machine, surviving container rebuilds.
- Problem: The SQLite database file (
-
Challenge: Uniform Styling
- Problem: I wanted a consistent layout with a side-panel accent across multiple pages without duplicating CSS.
- Solution: I created a shared
.page-bg-wrapperCSS class snippet and wrapped every main page component in it, ensuring a consistent look and feel with minimal code.
- User Accounts & Auth: Implement user authentication so learners can have private, secure notebooks and track their progress over time.
- Export & Share: Add functionality to export flashcard sets as CSVs or share quiz results with classmates via a link.
- Adaptive Learning: Track a user's weak topics based on quiz performance and automatically generate targeted review quizzes.
- Enhanced Analytics: Build out more detailed progress graphs, topic heatmaps, and time-to-complete metrics.