x-forecast · paper portfolio
Research · Live

Reproducibility Kit

Clone the repo, run one script — get the exact same NAV numbers shown on this site. Designed for interview demos.

One-liner

git clone https://github.com/<account>/x-forecast.git && cd x-forecast && npm install && pip install -r scripts/requirements.txt && npm run data:all && npm run dev
Then open http://localhost:4321 — same numbers as production.

Step by step

  1. 1. Prerequisites
    • Node.js ≥ 18 (test: node -v)
    • Python ≥ 3.9 (test: python --version)
    • git ≥ 2.30
  2. 2. Clone
    git clone https://github.com/<account>/x-forecast.git
    cd x-forecast
  3. 3. Install dependencies
    npm install
    pip install -r scripts/requirements.txt
  4. 4. Fetch prices + compute NAV
    npm run data:all
    # → python scripts/fetch_prices.py
    # → python scripts/compute_nav.py
    Writes data/prices/*.csv and data/nav/nav-history.json. ~1 min on a clean network.
  5. 5. Serve locally
    npm run dev   # http://localhost:4321
    npm run build # → dist/  (static)

Verify

After step 4, compare your local nav-history.json against the live JSON API:

diff <(jq '.history' data/nav/nav-history.json) \
     <(curl -s https://x-forecast.com/api/v1/nav.json | jq '.history')
Should output nothing (i.e., identical). Differences mean upstream data revision since the last site build — common, not a bug.

Container build (optional)

# Dockerfile (sketch — full version in repo /Dockerfile)
FROM node:20-bookworm-slim
RUN apt-get update && apt-get install -y python3 python3-pip
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY scripts/requirements.txt ./scripts/
RUN pip install -r scripts/requirements.txt
COPY . .
RUN npm run data:all && npm run build
EXPOSE 4321
CMD ["npm", "run", "preview"]

This kit is what makes a live interview demo possible — "let me show you the actual data flow now" is far stronger than slides.