Spaces:
Sleeping
Sleeping
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
- Create a new Space with Docker SDK.
- Push the contents of
huggingface-app/to the Space repo. - (Optional) Set
HF_TOKENas 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