A Flask web application that generates an internal-linking strategy for e-commerce category pages using rule-based semantic scoring and tier-based filtering.
- CSV and Excel (.xlsx) file upload with drag-and-drop support
- Semantic similarity scoring via root-word matching, adjective sharing, and contextual grouping
- Three-tier category ranking: RICH (high product count), PRIORITY (user-defined keywords), DEFAULT
- Assigns up to 5 outgoing internal links per category
- Starving-category balancing — redistributes link equity to under-linked pages
- Downloadable result file in the same format as the input (CSV or Excel)
- 16 MB upload limit with binary-content rejection for CSV uploads
- Python 3.10+
- pip
git clone https://github.com/sungurkeremgezergun/internal-link-strategy-tool.git
cd internal-link-strategy-tool
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt# Development
python app.py
# Using Flask CLI
flask --app app run --port 5001
# Production (set FLASK_DEBUG=False before deploying behind a real WSGI server)
FLASK_PORT=5001 python app.pyOpen http://127.0.0.1:5001 in your browser.
| Environment Variable | Default | Description |
|---|---|---|
FLASK_DEBUG |
False |
Enable Flask debug mode (true/false) |
FLASK_PORT |
5001 |
Port the development server listens on |
The uploaded file must contain at minimum the column below. Column names are matched case-insensitively.
| Column | Required | Description |
|---|---|---|
Category Name |
Yes | Human-readable category label |
Product Count |
No | Number of products in the category (integer) |
Link |
No | URL slug or full URL for the category page |
See example_input.csv for a ready-to-use sample.
The result file contains all original columns plus five new columns appended to the right:
| Column | Description |
|---|---|
Internal Link 1 |
Category name of the first recommended link |
Internal Link 2 |
... |
Internal Link 3 |
... |
Internal Link 4 |
... |
Internal Link 5 |
Category name of the fifth recommended link |
app.py Flask routes, file upload/download, request validation
link_algorithm.py Category class, tier assignment, candidate scoring, process_data()
templates/index.html Single-page React UI (Babel in-browser transpile, Tailwind CSS)
The algorithm runs entirely in memory — no database required.
Tier system:
| Tier | Condition | Role in linking |
|---|---|---|
RICH |
product count > 5 | Preferred candidate for semantic links |
PRIORITY |
name contains a user-supplied keyword | Safe-harbour fallback target |
DEFAULT |
everything else | Used only when higher tiers are absent |
Candidate selection order per category: root match → sibling match → parent backfill → contextual match → PRIORITY fallback → starving-category fill → RICH fill.
MIT License. Copyright (c) 2026 sungurkeremgezergun. See LICENSE for details.