Samih · Software developer

Software for shops, and for markets.

I build offline-first commerce systems and quantitative trading research: software that has to stay correct when the network drops and the market moves.

  • Open to interesting work
  • Tadjena POS v1.0.0 shipped 20 Sept 2026

samih.online

Life & work ledger

Printed


QtyItemRef
1Tadjena POSv1.0.0
1Tadjena marketplaceNext.js
1Postgres backend28+ migrations
1FX reinforcement learning28 pairs
2MQL5 Q-learning EAsresearch
1C → WASM Mini AppTelegram

Subtotal7 systems
Sync status✓ all rows merged
Total1 developer

Paid withcuriosity + coffee

samih.online

Thank you · scroll for the details ↓

  • Tadjena POS v1.0.0: Windows · Android · Web
  • A sale never waits for the network
  • 28+ numbered SQL migrations
  • 29 / 29 tables restored byte-identical in a backup drill
  • 28 FX pairs · 8 currencies observed
  • SHA-256 checksums on every release file
  • Research, not signals
01How I build

Four rules I won’t trade away.

  1. 01

    A sale never waits for the network.

    Every sale lands in a local SQLite database first. Sync is background work that can fail, retry and catch up. It is never allowed to block the till.

  2. 02

    Ledgers, not overwrites.

    Stock is an append-only ledger: what is on the shelf is always the sum of what happened. Client-generated UUIDs make every push safe to retry.

  3. 03

    A backup is real once you have restored it.

    Encrypted nightly exports, and a drill that deleted tables, restored them and compared a fresh backup byte for byte: 29 of 29 identical.

  4. 04

    A result is not a result until it survives out-of-sample.

    Walk-forward folds, deflated Sharpe, bootstrap intervals. Each trading repo states its status plainly: what is built, what is tested, and what is not.

02Store side

Tadjena: commerce for a small city’s stores

An offline-first point of sale and a public marketplace on one Postgres backend. Stores keep selling when the internet drops; neighbors browse what is in stock and reserve items for pickup.

platforms
3one Flutter codebase
SQL migrations
28+RLS, RPCs, Realtime
tables restored
29/29byte-identical in a drill
latest release
v1.0.020 Sept 2026
DevicesPOS devicesWindows · Android · WebSQLite ledger, works offline
BackendSupabase PostgresRLS · RPCs · Realtime · pg_cronOne shared backend
PublicMarketplaceNext.js 16 · server-renderedBrowse, reserve, pickup

CI/CD with a manual production gate · encrypted nightly backups · hourly health checks

Flutter · SQLite

Point of sale

One Flutter codebase for Windows, Android and web, with native Fluent UI on Windows and Material 3 on Android. Cash-drawer shifts, returns, expenses, reports, running customer balances, owner and cashier roles, and a hardware layer for ESC/POS printing, USB and camera barcode input and cash drawers (unit-tested).

  • Flutter
  • Dart
  • drift
  • SQLite
  • ESC/POS

Offline-first

A sync engine you can retry blindly

Append-only rows (stock, sales, returns, expenses) merge as a union, deduplicated by UUID. Editable data is last-write-wins. Pulls use a per-table watermark. Two offline tills can sell the last unit; the ledger stays correct and shows negative stock for the owner to resolve.

  • Idempotent
  • Append-only
  • Watermarks

Supabase

Postgres is the contract

Plain, numbered SQL migrations: row-level security, SECURITY DEFINER RPCs, per-device auth tokens, scheduled reservation expiry. Schema ships backend-first, to dev before prod, with a typed confirmation to touch production.

  • PostgreSQL
  • RLS
  • RPC
  • pg_cron
  • GitHub Actions

Marketplace

Public, searchable, live

Next.js 16 and React 19, server-rendered so search engines can index it. Stores, people, products and services; reserve-for-pickup; a household shopping list that updates in real time; a license storefront and admin.

  • Next.js
  • React 19
  • TypeScript
  • Realtime
  • Vercel

Operations

Boring on purpose

Nightly encrypted backups with weekly permanent archives and a tested restore. Hourly health checks that also probe the security gate. Importers that move real shops off OpenSourcePOS and a Delphi/Firebird system. Checksummed Windows and Android builds.

  • Backups
  • Monitoring
  • Importers
  • Releases
03Lab · offline-first

Try to break my sync.

Two tills share one bottle of olive oil. Take both offline, sell it twice, then reconnect. Ledger rows merge as a union, editable fields are last-write-wins, and every push is safe to retry.

Or drive it yourself: switch a counter offline, sell, restock, edit the price.

Counter A

Windows POS

Olive oil 1 L · stock here

1

Price8.50
Pending sync: 0

    Cloud

    Postgres

    Sum of all ledger rows

    1

    Price (last write wins)8.50

    insert … on conflict (id) do nothing

      Counter B

      Android POS

      Olive oil 1 L · stock here

      1

      Price8.50
      Pending sync: 0

        Event log

        A simplified model of the real engine, which adds per-table watermarks, per-device tokens and Postgres RPCs (sync_push, sync_pull).

        04Market side

        Markets: research, not signals

        Reinforcement-learning experiments on forex, engineered like production systems: safety rules in code, leakage tests, walk-forward validation. It is all research. None of it is advice, a track record or a product.

        forex_rl_v4

        Python · PyTorch

        public repo

        Research code

        A graph encoder over 28 pairs and 8 currencies feeds a PPO policy. A safety layer (exposure caps, max-hold, volatility circuit breaker, VaR cap, forced flatten) runs identically in training and inference.

        Universe
        28 pairs · 8 currencies
        Learner
        GNN encoder + PPO
        Validation
        Walk-forward folds
        Evaluation
        Deflated Sharpe · bootstrap CIs · stress tests
        github.com/samdotbin/martin

        QTrader

        MQL5 · MetaTrader 5

        private repo

        Backtest-only research · never run live

        One shared Q-table decides once per H1 bar on seven USD pairs. State comes from triangulated pivot and RSI lines plus a PCA currency-strength meter. Illegal actions are masked out, not learned.

        Table
        54 states × 5 actions
        Universe
        28 pairs observed · 7 traded
        Risk
        1% per trade · 3% open-risk cap
        Discipline
        Flat before the daily rollover

        TQLearning

        MQL5 · MetaTrader 5

        private repo

        Research code v2.00 · trading off by default

        Eight instruments (seven USD pairs and gold), one independent Q-learner each, deciding once a day. A fixed-random temporal graph encoder that is never trained feeds the state; a rule engine hedges currency exposure.

        Table
        81 states × 3 actions each
        Encoder
        Echo-state graph reservoir
        Cadence
        One decision per day
        Execution
        Simulated ledger first

        How I treat results

        • Status is written down, not implied.

          “Research / backtest only. Not a proven profitable system” is the first thing in QTrader, TQLearning records no results at all, and forex_rl_v4 keeps a progress file that says what is still untested.

        • Risk is code, not a promise.

          Limits are enforced by the same path in training, testing and live use, so a backtest cannot quietly assume a rule the live system would not follow.

        • Specs get cut when the data says so.

          QTrader’s state space went from 243 states to 54 because most cells never reached a trustworthy visit count. The redesign lifted the usable share from about 40% to about 79%, and a deviations table records why.

        05Lab · reinforcement learning

        Watch a Q-table learn. Then feed it noise.

        A tiny trader (27 states × 3 actions) learns on a synthetic market with the same update rule my MQL5 experts use: Q ← Q + α (r + γ · max Q′ − Q). The last 30% of bars are a frozen, out-of-sample test. Then try twenty random markets and pick the best: the trap that deflated Sharpe exists to catch.

        Q-learning agentBuy & holdCoin-flip traderseed 0

        Q-table · how much better each action looks

        Learning starts when this lab scrolls into view.

        Learning phase P&L
        explores and pays costs
        Test P&L · frozen policy
        Buy & hold · same test bars
        zero drift market
        Test z-score

        Synthetic data with a visible seed, so every run is reproducible. P&L is in units of one bar’s volatility; costs are 0.03 per unit of position change. This demonstrates a method and a trap. It is not a strategy, a backtest or advice.

        • On noise, there is nothing to find.

          After paying for its lessons, the agent mostly learns to sit out, which is the right answer. When it does trade, it is chasing phantom patterns.

        • A planted pattern is learnable.

          Same code, same random numbers, but each return leans a little toward the last. The table finds it, and the frozen policy keeps earning on bars it never saw.

        • Pick the best of twenty and you will find a genius.

          Try enough random markets and one will look like skill. That is why I freeze the policy, test walk-forward across folds, and correct for how many things I tried.

        06Build log

        A ledger of what shipped.

        Milestones, not commit counts. A number of commits says little about what was actually shipped.

        1. Feb 2023

          On GitHub, writing C

          The account opens with C notes on threads, processes, sockets and sed: the operating system underneath everything else.

        2. Oct–Nov 2025

          The Market Ark

          An Expo and Next.js monorepo with a hybrid local/server ledger: idempotency, an offline queue, reconciliation. Alongside it, a C core compiled to WebAssembly and wired into a Telegram Mini App demo.

        3. 25 Aug 2026

          Tadjena begins

          Flutter POS, Supabase backend and Next.js marketplace scaffolded. The first working POS screens (products, stock, customers, reports, returns) land the same day.

        4. 26–28 Aug 2026

          Licensing, public marketplace, sync engine

          A license storefront, a browsable store directory that needs no login, and an outbox-to-Postgres sync deduplicated by event ID.

        5. Aug 2026

          forex_rl_v4

          GNN and PPO trading research with a safety layer and a walk-forward harness, in a public repository.

        6. 3 Sep 2026

          Reservations, household cart, shared catalog

          Reserve-for-pickup with expiry, a live shared shopping list, and a canonical product catalog that de-duplicates marketplace search.

        7. Sep 2026

          TQLearning and QTrader

          Two tabular Q-learning experts for MetaTrader 5, each with an honest status section instead of a results table.

        8. 19 Sep 2026

          Production hardening

          Device authentication on every sync call, separate dev and prod environments, and CI/CD with a manual production gate. Domains live on Cloudflare.

        9. 20 Sep 2026

          Tadjena POS 1.0.0

          Windows installer, portable build, Android APK and web app, with checksums and bilingual install notes.

        10. 20 Sep 2026

          samih.online

          This site: a portfolio that runs its own experiments.

        07Toolbelt & now

        What I reach for, and what I’m on.

        Apps

        • Flutter
        • Dart
        • drift · SQLite
        • Next.js 16
        • React 19
        • TypeScript
        • Expo / React Native
        • Astro

        Data & backend

        • PostgreSQL
        • Supabase
        • Row-level security
        • SQL migrations
        • Realtime
        • pg_cron
        • GitHub Actions
        • Vercel
        • Cloudflare

        Systems

        • C
        • WebAssembly (Emscripten)
        • Node.js
        • PowerShell
        • Telegram Mini Apps

        Quant & ML

        • Python
        • PyTorch
        • PPO
        • Graph neural nets
        • Q-learning
        • MQL5 · MetaTrader 5
        • PCA / SVD

        Retail hardware

        • ESC/POS printing
        • Barcode input (USB, camera)
        • Cash-drawer control
        • OpenSourcePOS · MySQL
        • Firebird
        08Contact

        Building something that has to keep its promises? Let’s talk.

        ↑ ↓ to move · Enter to open