ChiSquare
← Engineering Case Studies

CHISQUARE PRODUCT / FORECASTING SAAS

Forely — From Predictive Models to Production Software

Connect demand estimates, inventory constraints and reviewable decisions in one software product.

Key idea Make forecasting a traceable engineering pipeline: owned data, explicit models, saved predictions, evidence-aware reviews and practical planning.

01 / DATA INPUTS

Amazon SP-API · Stripe data · Manual / CSV

02 / APPLICATION

React interface ↔ Django REST APIs

BACKGROUND COMPUTATION

Celery + Redis
Ingestion · Forecast fitting · Review

PERSISTED RECORDS

Sales · Forecast history
Inventory · Planning context

03 / DECISION SUPPORT

Forecasts → Inventory planning → Reviewed actions

Code-verified component roles · simplified architecture · not a deployment-topology or scale claim

Forely is a ChiSquare product, independently developed by the company; not a client engagement.

01

The Problem

Forely is an independently developed demand forecasting and inventory-planning SaaS product by ChiSquare. The engineering problem spans more than predicting a number: sellers need dated product sales, a usable inventory context and reasons to review a recommended action.

Forecast demand, observed sales and a proposed action’s expected effect remain different quantities. An action recommendation or completion click is not proof of additional revenue.

02

Data & Modelling Challenges

The implemented data paths include Amazon SP-API, a separate Stripe store-data connection, and manual or CSV sales input. Ingestion must resolve products and owners, validate dates and quantities, and handle overlapping records. A missing observation cannot automatically be treated as zero sales.

Sparse sales, incomplete history, stock constraints, price changes and overlapping events complicate evaluation. Inventory planning additionally needs usable stock, dated confirmed incoming supply, lead time, minimum order quantity and pack size. Missing inputs can defer quantity advice.

03

Mathematical Reasoning

The reviewed forecasting implementation combines a baseline with signed event components. Event effects use asymmetric Gaussian shapes, allowing different build-up and decay widths; weekly effects aggregate daily weights. The final quantity is constrained to be non-negative.

The fitting code uses bounded L-BFGS-B optimisation with a weighted log-error objective and prior penalties. Sales-pattern decomposition and evidence-aware event review support interpretation. These are custom mathematical and statistical components; their presence does not establish a universal accuracy advantage.

04

Modelling & Engineering Approach

A React interface communicates with authenticated Django REST APIs. Python ingestion and modelling code, Celery background tasks with Redis, persisted sales and forecast records, and inventory-planning endpoints form the product pipeline. Saved forecast history supports later comparisons without replacing the original prediction.

The replenishment planner consumes saved weekly forecasts, allocates them across days as a planning approximation, and considers stock, confirmed incoming supply, lead time, coverage, MOQ and pack size. This is bounded planning, not a claimed profit optimum. Supplier dispatch requires user approval and is not supplier acceptance.

The repositories include Docker builds, GitHub Actions and an EC2 deployment workflow, with migrations and separate application/background-task roles. This case describes verified implementation and deployment configuration, not a fresh uptime, security-certification or load-capacity audit.

Visual Explanation

01 / DATA INPUTS

Amazon SP-API · Stripe data · Manual / CSV

02 / APPLICATION

React interface ↔ Django REST APIs

BACKGROUND COMPUTATION

Celery + Redis
Ingestion · Forecast fitting · Review

PERSISTED RECORDS

Sales · Forecast history
Inventory · Planning context

03 / DECISION SUPPORT

Forecasts → Inventory planning → Reviewed actions

Code-verified component roles · simplified architecture · not a deployment-topology or scale claim

Saved predictions are compared with later observations. Incomplete evidence can defer model review or inventory advice. Arrows describe information flow, not automatic order execution.

06

Validation & Findings

The code includes synthetic held-out baseline tests, ingestion and learning regressions, event-review and calibration tests, and inventory-planning tests. The baseline tests construct estimates from earlier weeks and score later unseen weeks; synthetic examples are software checks, not evidence of real-customer forecast accuracy.

Post-window event review compares saved expectations with observed sales and can defer attribution for incomplete coverage, uncertain stock, price changes or overlapping actions and events. Compatibility with a forecast is not proof of causation. No customer count, aggregate forecast score, deployment scale or measured business improvement is claimed here.

07 / ENGINEERING INSIGHT

A forecasting product needs reliable data boundaries, preserved predictions and reviewable decisions as well as a fitted model.

Evidence basis: Read-only implementation review, 9 November 2026: Forely React client, Django REST APIs, daily-sales ingestion, forecast fitting and calibration, inventory planner, tests and Docker/GitHub deployment configuration. No customer-performance benchmark is claimed.. No independently reproduced benchmark or commercial performance claim is included.

08 / RELEVANT ENGAGEMENT

Working on a Similar
Modelling Challenge?

If your team is facing a related forecasting, anomaly detection, optimisation, or mathematical modelling problem, we’d be interested in understanding the technical requirements.

Discuss Your Modelling Challenge ↗