Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smart Internal Link Strategy Tool

A Flask web application that generates an internal-linking strategy for e-commerce category pages using rule-based semantic scoring and tier-based filtering.

Features

  • 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

Requirements

  • Python 3.10+
  • pip

Installation

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

Running

# 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.py

Open http://127.0.0.1:5001 in your browser.

Configuration

Environment Variable Default Description
FLASK_DEBUG False Enable Flask debug mode (true/false)
FLASK_PORT 5001 Port the development server listens on

Input CSV Format

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.

Output Format

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

Architecture

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.

License

MIT License. Copyright (c) 2026 sungurkeremgezergun. See LICENSE for details.

About

Flask tool to generate internal-linking strategies from CSV/Excel category data with semantic scoring

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages