LudexSite is the web application interface for Ludex, a fully offline, hybrid Content-Based + Collaborative Filtering recommendation engine designed to provide high-quality, diverse, and personalized Steam game suggestions.
Built with Flask, LudexSite allows users to authenticate via Steam OpenID, analyze their gaming history, and receive tailored game recommendations that outperform standard discoverability algorithms by blending metadata, player history, and diversity-aware ranking.
The recommendation engine powers the site using three core components:
- Content-Based Filtering (CBF): Analyzes metadata such as descriptions, tags, genres, and developers using TF-IDF and One-Hot Encoding.
- Collaborative Filtering (CF): Finds similar users and recommends games based on playtime and ownership behavior patterns.
- MMR Re-ranking (Maximal Marginal Relevance): Ensures the final recommended list is both highly relevant and diverse.
LudexSite/
│── CBF/ # Content-Based Filtering models and logic
│── CF/ # Collaborative Filtering models and logic
│── data/ # Processed feature matrices and catalogues
│── static/ # CSS, JS, and image assets
│── templates/ # Flask HTML templates
│── app.py # Main Flask application (Render optimized)
│── app_local.py # Full-featured Flask application for local testing
│── requirements.txt # Python dependencies
To successfully deploy LudexSite on Render's free tier, which imposes a strict 512MB RAM limit, app.py has been heavily optimized compared to its original state. The modifications include:
- Reduced Candidate Pools: Decreased
CANDIDATE_POOL_SIZEfrom 300 down to 50 to limit the number of items processed in memory simultaneously. - Incremental MMR Computation: Replaced full similarity matrix multiplication (
cand_vecs @ cand_vecs.T) with incremental dot products in a loop (row_vec.dot(sel_vecs.T)) during the MMR re-ranking phase. - Sparse Matrix Handling: Leveraged
.toarray().ravel()on sparse matrix slices to resolveValueErrorexceptions and prevent memory crashes when calculating similarities. - Lazy Loading & Concurrency: Adjusted cache behavior via
get_cbf_data()and reducedMETADATA_THREADSfrom 4 to 2 to minimize parallel memory allocation spikes.
Tip
If you are running the project locally and have sufficient RAM, it is recommended to run app_local.py instead. This version retains the original CANDIDATE_POOL_SIZE of 300 and the full matrix similarity operations for more accurate and diverse recommendations.
Ensure you have Python 3.12+ installed. Create a virtual environment and install the required packages:
python -m venv venv
source venv/bin/activate # On Linux/Mac
venv\Scripts\activate # On Windows
pip install -r requirements.txtCreate a .env file in the LudexSite directory and add your Steam API key and secret key:
STEAM_API_KEY=YOUR_STEAM_API_KEY
LUDEX_SECRET=your_secret_key_hereTo run the fully-featured local version (recommended):
python app_local.pyTo run the Render-optimized version:
python app.pyThe application will be available at http://127.0.0.1:5000.
MIT License
© 2026 Ludex Project Authors