The Personalized Learning Platform is an AI-powered web application designed to deliver customized, dynamic educational content to users. The platform allows users to log in, select a topic of interest, and instantly receive a comprehensive, beginner-friendly lesson generated by Artificial Intelligence.
To reinforce learning, the application also provides features to generate concise revision notes and interactive multiple-choice assessments. The entire application is built using a decoupled architecture, with a static HTML/JS frontend hosted on Vercel and a robust Python Flask backend hosted on Render.
- Frontend: HTML, CSS, Vanilla JavaScript. Hosted on Vercel.
- Backend: Python, Flask, Flask-CORS. Hosted on Render.
- Database: PostgreSQL (via SQLAlchemy) for tracking user progress and saving generated lessons.
- AI Integration: Initially designed around Google's Gemini SDK, later adapted to a robust, keyless AI provider (
pollinations.ai) to bypass rate-limiting constraints. - Markdown Parsing:
marked.jsis used on the frontend to render the raw Markdown text generated by the AI into beautiful, professional web typography.
The development process was split into two primary phases: local development and production deployment.
- Decoupling the Architecture: We separated the codebase into a
frontendandbackenddirectory. This allowed Vercel to serve the frontend as a fast static site, while Render handled the heavy lifting of the Flask API and PostgreSQL database. - Dynamic API Routing: We updated the frontend JavaScript to automatically detect whether the app was running locally (development) or on Vercel (production). This allowed the frontend to dynamically switch its API requests from
http://127.0.0.1:5000to the livehttps://personalised-learning-platform-2.onrender.comURL. - Database Integration: We implemented SQLAlchemy to automatically save generated lessons into the database and associate them with the logged-in user, allowing users to review past lessons in the "My Progress" tab.
During the deployment and finalization of the project, we encountered several critical, real-world engineering challenges:
- The Problem: When the Vercel frontend attempted to request lesson data from the Render backend, the browser blocked the request due to Cross-Origin Resource Sharing (CORS) restrictions.
- The Solution: We configured the
Flask-CORSextension on the backend to accept wildcard (*) origins, allowing secure cross-domain communication between Vercel and Render.
- The Problem: The login and registration pages were initially hardcoded to send authentication requests to
localhost. When deployed to Vercel, users could not log in because the frontend was trying to reach a local server that didn't exist. - The Solution: We replaced all hardcoded URLs in
login.htmlandregister.htmlwith a dynamicAPI_URLvariable that routes to the live Render backend automatically.
- The Problem: During final testing, the AI generation completely stopped working. Checking the server logs revealed a
429 RESOURCE_EXHAUSTEDerror. The free-tier Google Gemini API key had reached its hard limit of 0 available tokens, causing the backend to crash and return 500 errors to the frontend. - The Solution: To save the project right before the deadline, we completely stripped out the
google-genaidependency. We rewrote the backend's AI engine to securely connect topollinations.ai, a completely free, keyless AI fallback provider. This immediately restored full functionality without requiring any API keys.
- The Problem: The AI generated highly detailed lessons using Markdown syntax (e.g.,
**bold**,## Headings). However, the frontend was injecting this as raw text, making the application look messy and unprofessional. - The Solution: We integrated the
marked.jslibrary into the frontend. This allowed the app to instantly parse the raw Markdown and convert it into beautiful, styled HTML elements, giving the platform a polished, professional aesthetic. We also added a dynamic scoring UI with color-coded feedback (Green/Orange/Red) for the assessments.
The project is now 100% complete and fully functional. It successfully demonstrates a modern, scalable web architecture with secure authentication, cloud database persistence, and robust AI generation that is resilient to rate limits.