EDU_Recommender / README.md
Omarrran's picture
Add EduRecommender HuggingFace Spaces app
5bd3663
metadata
title: EDU Recommender
emoji: 😻
colorFrom: purple
colorTo: indigo
sdk: docker
pinned: false

EduRecommender β€” HuggingFace Spaces Edition

Premium glassmorphism web app for personalised educational content recommendations. Built with React + Node.js (Express), designed for Docker-based deployment on HuggingFace Spaces.


Features

  • Glassmorphism UI β€” dark theme with frosted glass cards, gradient accents, hover lift animations, and backdrop blur.
  • Full Recommendation Pipeline β€” keyword similarity retrieval + rule-based re-ranking (with optional LLM re-ranking when API key is set).
  • Preset Learner Profiles β€” Alice, Bob, Carol with one-click load.
  • Interactive Sidebar β€” tag chips, difficulty selectors, range slider, viewed-ID toggles.
  • Pipeline Toasts β€” animated step-by-step progress feedback.
  • Content Browser β€” expandable catalogue of all 10 courses.
  • Sub-millisecond ranking β€” no Python or ML model dependency in production.
  • Docker-ready β€” multi-stage build, serves on port 7860.

Quick Start (Local)

1. Install dependencies

cd huggingface-app

# Server
cd server && npm install && cd ..

# Client
cd client && npm install && cd ..

2. Build the React client

cd client && npm run build && cd ..

3. Start the server

node server/src/index.js

Open http://localhost:7860.

Development mode

Run client and server separately for hot-reload:

# Terminal 1 β€” server
node server/src/index.js

# Terminal 2 β€” client (proxies /api to server)
cd client && npm run dev

Docker

cd huggingface-app
docker build -t edu-recommender .
docker run -p 7860:7860 edu-recommender

Deploy to HuggingFace Spaces

  1. Create a new Space with Docker SDK.
  2. Push the contents of huggingface-app/ to the Space repo.
  3. (Optional) Set HF_TOKEN as a Space secret to enable LLM re-ranking.

Project Structure

huggingface-app/
β”œβ”€β”€ client/                      # React frontend (Vite)
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ Header.jsx       # Gradient hero
β”‚   β”‚   β”‚   β”œβ”€β”€ Sidebar.jsx      # Profile form + presets
β”‚   β”‚   β”‚   β”œβ”€β”€ RecommendationCard.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ RecommendationGrid.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ PipelineToast.jsx
β”‚   β”‚   β”‚   └── ContentBrowser.jsx
β”‚   β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   β”‚   └── useRecommend.js  # Fetch hook
β”‚   β”‚   β”œβ”€β”€ styles/
β”‚   β”‚   β”‚   └── global.css       # Design system tokens
β”‚   β”‚   β”œβ”€β”€ App.jsx              # Root layout
β”‚   β”‚   └── main.jsx             # Entry point
β”‚   β”œβ”€β”€ index.html
β”‚   β”œβ”€β”€ vite.config.js
β”‚   └── package.json
β”œβ”€β”€ server/                      # Node.js backend (Express)
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ index.js             # Server entry
β”‚   β”‚   β”œβ”€β”€ routes.js            # API endpoints
β”‚   β”‚   β”œβ”€β”€ data.js              # Content + profiles
β”‚   β”‚   └── recommender.js       # Pipeline (retrieval + ranking)
β”‚   └── package.json
β”œβ”€β”€ Dockerfile                   # Multi-stage build
β”œβ”€β”€ .dockerignore
β”œβ”€β”€ .env.example
β”œβ”€β”€ package.json                 # Root scripts
└── README.md

API Endpoints

Method Path Description
GET /api/health Liveness probe
GET /api/content Full content catalogue
GET /api/users Mock user profiles
POST /api/recommend Top-3 personalised recommendations

Environment Variables

Variable Default Description
PORT 7860 Server listen port
HF_TOKEN β€” Enables LLM re-ranking
OPENROUTER_API_KEY β€” Alternative LLM key
LLM_MODEL moonshotai/Kimi-K2.5:novita Chat-completion model
LLM_BASE_URL HuggingFace Router Chat-completion endpoint

License

MIT