๐ฎ LearnPlay AI โ Full Installation & Usage Guide Make Hard Concepts Feel Like Play
๐ Introduction LearnPlay AI is a local, privacy-friendly learning assistant powered by Ollama and built with Node.js + React. This guide will walk you through EVERYTHING you need โ installing dependencies, downloading models, running backend, running frontend, uploading documents, generating quizzes, and more. โ Prerequisites Before you begin, ensure you have the following installed: โข Node.js (v18 or higher recommended) โข NPM (comes with Node.js) โข Ollama (for local LLMs) โข Git (optional but recommended) ๐ง Step 1 โ Install Ollama Ollama is required to run local LLMs. Download from: https://ollama.com/download
After installation, open your terminal and verify: ollama --version
๐ฅ Step 2 โ Download Required Models LearnPlay requires 2 models:
- LLM model โ llama3.2:3b
- Embedding model โ nomic-embed-text
Run these commands: ollama pull llama3.2:3b ollama pull nomic-embed-text
๐ Project Folder Structure learnplay/ โโโ client/ (React frontend) โโโ server/ (Node.js backend) โโโ README.md
๐ฆ Step 3 โ Install Server Dependencies Navigate into the server folder: cd server
Install all required dependencies: npm install
This installs packages like: โข express โข cors โข multer โข pdf-parse โข mammoth โข dotenv
โ๏ธ Step 4 โ Create .env File Inside /server create a file named .env with: PORT=5179 OLLAMA_URL=http://localhost:11434 OLLAMA_MODEL=llama3.2:3b
You should see: Server running โ http://localhost:5179
โ๏ธ Step 6 โ Install Frontend Dependencies Navigate to the client folder: cd client
Install packages: npm install
This installs React, Vite, and all UI dependencies.
๐ Step 7 โ Start the LearnPlay Frontend Run the frontend UI: npm run dev
You should now see LearnPlay running at: http://localhost:5173
๐ Step 8 โ Using LearnPlay AI โ Type a topic in the Topic box (e.g., 'Eigenvalues') โ Click: โข Teach Me โ explanation with analogy + example + check question โข Co-Relate โ relate to badminton/cooking โข Quiz Me โ generates quiz (JSON hidden) as UI โข Make It Fun โ story-mode explanation
๐ Step 9 โ Uploading Documents (PDF/DOCX/TXT) Click the Upload button in the Topic panel and upload: โข PDF file โข DOCX file โข TXT file
LearnPlay will: โ Extract text โ Chunk it โ Embed it using nomic-embed-text โ Enable document mode Now all buttons use ONLY the uploaded document content.
๐ฏ Step 10 โ Quiz Mode (Document or Topic) When clicking 'Quiz Me': โ LearnPlay generates 3 questions โ JSON is parsed silently (NOT shown to user) โ Quiz UI appears below chat โ Answers are auto-graded โ Score is tracked persistently
๐งน Step 11 โ Clear Document Context Click the Clear button to switch back to topic mode. This resets: โข Document chunks โข Embeddings โข Quiz data
๐ ๏ธ Troubleshooting โ If Vite throws HTML parse errors โ remove React syntax from index.html โ If Node crashes with memory error โ update Node to v20+ โ If Ollama model errors โ re-run: ollama pull llama3.2:3b ollama pull nomic-embed-text
โจ You Are Ready! Your LearnPlay AI setup is complete. Enjoy fun, interactive, document-powered learning!