<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Xage Development roadmap]]></title><description><![CDATA[Backend Developer specializing in scalable API development and system architecture using Node.js, PostgreSQL, and modern backend tools. I write about real-world projects, microservices, performance optimization, and practical engineering solutions.]]></description><link>https://xagedev.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/69cbe937c1e86567d75194db/3ce47b5b-fd70-4760-9cf0-695fba63d3da.png</url><title>Xage Development roadmap</title><link>https://xagedev.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Sat, 05 Dec 2026 19:34:41 GMT</lastBuildDate><atom:link href="https://xagedev.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Two Frameworks, One Database: Architecting NetPredict with Django, FastAPI, and Dixon-Coles]]></title><description><![CDATA[How splitting a football probability platform across Django and FastAPI—while sharing a single PostgreSQL schema—keeps authentication, M-Pesa billing, and…]]></description><link>https://xagedev.hashnode.dev/two-frameworks-one-database-architecting-netpredict-with-django-fastapi-and-dixon-coles</link><guid isPermaLink="true">https://xagedev.hashnode.dev/two-frameworks-one-database-architecting-netpredict-with-django-fastapi-and-dixon-coles</guid><category><![CDATA[django rest framework]]></category><category><![CDATA[FastAPI]]></category><category><![CDATA[sports betting]]></category><category><![CDATA[daraja-api]]></category><category><![CDATA[Developer]]></category><dc:creator><![CDATA[Kenneth Muketha]]></dc:creator><pubDate>Fri, 27 Nov 2026 12:14:28 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/69cbe937c1e86567d75194db/f23efdb2-9abe-4af6-88b8-a381b562710f.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1>Two Frameworks, One Database: Architecting NetPredict with Django, FastAPI, and Dixon-Coles</h1>
<p><em>How splitting a football probability platform across Django and FastAPI—while sharing a single PostgreSQL schema—keeps authentication, M-Pesa billing, closed-form statistical inference, and public track-record accounting fast, atomic, and honest.</em></p>
<p>Most side projects start as a single monolith until one part of the stack starts fighting the rest. When I built <strong>NetPredict</strong>—a football match-prediction platform with user accounts, subscription tiers, M-Pesa STK push payments, fixture ingestion, walk-forward backtesting, and a vanilla JS progressive web app—I split the backend across <strong>Django</strong> and <strong>FastAPI</strong>, while keeping both services pointed at <strong>one shared database</strong> (PostgreSQL in Docker production, SQLite for tests and local development).</p>
<p>Instead of adding internal RPC layers or splitting state across separate databases, each framework owns the responsibilities it is genuinely built for. What follows is a full breakdown of the architecture, data model, statistical engine, concurrency and payment edge cases, testing strategy, and frontend trade-offs behind NetPredict.</p>
<hr />
<h2>1. High-Level Architecture and Request Flow</h2>
<p>In production, <strong>Caddy</strong> sits at the front edge under a single origin, routing <code>/</code> and <code>/api/*</code> to Django and <code>/predict-api/*</code> to FastAPI, while keeping <code>/internal/*</code> endpoints private (<code>docker-compose.yml</code>). During local development, Django typically runs on <code>:8000</code> (serving the static <code>web/</code> PWA via WhiteNoise) and FastAPI runs on <code>:8001</code> with <code>CORS_ALLOWED_ORIGINS=http://localhost:8000</code> (<code>web/js/config.js</code>, <code>fastapi_app/main.py</code>).</p>
<p>Underneath, both services share:</p>
<ul>
<li><strong>One relational database (<code>DATABASE_URL</code>):</strong> PostgreSQL 16 in Docker (<code>docker-compose.yml</code>), or SQLite in local/test runs (<code>django_app/config/settings.py</code>, <code>fastapi_app/config.py</code>).</li>
<li><strong>Redis 7:</strong> Used as the Celery broker/result backend and available for Django caching (<code>django_app/config/settings.py</code>, <code>docker-compose.yml</code>).</li>
</ul>
<p>The responsibilities split cleanly along operational lines:</p>
<ul>
<li><strong>Django (<code>django_app/</code>):</strong> Owns the database schema and migrations, user registration/login/session/CSRF security, <code>SubscriptionPlan</code> and <code>UserSubscription</code> records, <code>ApiKey</code> issuance/revocation, Safaricom Daraja M-Pesa STK initiation and callback handling, <code>football-data.org</code> v4 fixture/result ingestion, Celery tasks and beat schedules, accuracy snapshot aggregation, and WhiteNoise static hosting for <code>web/</code>.</li>
<li><strong>FastAPI (<code>fastapi_app/</code>):</strong> Owns <code>POST /predict/</code> (authenticated via <code>X-API-Key</code> or short-lived <code>Bearer</code> web token), <code>GET /health/</code>, internal pre-kickoff publishing (<code>POST /internal/publish</code>), subscription and monthly quota checks, atomic daily quota consumption, fingerprint-aware <code>EngineCache</code>, and the vectorized Dixon-Coles model.</li>
</ul>
<hr />
<h2>2. Letting Django Own Product State, Billing, and Ingestion</h2>
<p>Django handles everything around the prediction math without custom glue.</p>
<h3>Session Auth, CSRF Hardening, and Short-Lived Token Bridging</h3>
<p>Browser authentication lives in <code>django_app/netpredict_core/views/web.py</code> (<code>SignupView</code>, <code>LoginView</code>, <code>LogoutView</code>, <code>MeView</code>, <code>CsrfView</code>, <code>WebTokenView</code>):</p>
<ul>
<li><code>CsrfAlwaysSession</code> enforces CSRF checks even when a caller is not yet authenticated, protecting <code>login</code> and <code>signup</code> as CSRF targets too.</li>
<li><code>SignupView</code> normalizes emails to lowercase, validates format and uniqueness across <code>username</code> and <code>email</code> (case-insensitive), runs Django's <code>validate_password</code>, creates the user, logs them in, and relies on a <code>post_save</code> signal (<code>signals.py</code>) that assigns the cheapest active free plan (<code>price=0</code>) automatically.</li>
<li><code>LoginView</code> returns the exact same <code>400</code> error payload whether the account does not exist or the password is wrong, avoiding account enumeration.</li>
<li>When a signed-in user calls <code>POST /predict/</code> from the browser (<code>web/js/api.js</code>), the frontend does not hold long-lived API keys or session cookies for FastAPI. Instead, it calls <code>GET /api/auth/token/</code> to receive a 600-second HS256 token (<code>webtoken.py</code>) signed with <code>WEB_TOKEN_SECRET</code>, and attaches <code>Authorization: Bearer &lt;token&gt;</code>. External scripts and bots pass <code>X-API-Key</code> instead.</li>
</ul>
<h3>API Keys: Single-Reveal Raw Keys and SHA-256 Storage</h3>
<p>Users on plans with <code>api_access=True</code> can hold up to <code>MAX_KEYS_PER_USER = 5</code> active keys (<code>ApiKeyListCreateView</code>, <code>ApiKeyRevokeView</code>):</p>
<ul>
<li><code>ApiKey.issue()</code> generates an <code>np_</code> prefixed token via <code>secrets.token_urlsafe(32)</code>, stores only <code>prefix=raw[:10]</code> and <code>key_hash=sha256(raw)</code>, and returns the raw key once in the <code>201</code> creation response. Subsequent <code>GET /api/keys/</code> calls never expose the raw secret.</li>
<li>Revoking a key (<code>DELETE /api/keys/&lt;uuid:pk&gt;/</code>) sets <code>is_active=False</code> and records <code>revoked_at</code>; FastAPI's <code>repo.find_key()</code> filters on <code>is_active IS TRUE</code> and updates <code>last_used_at</code> at most once every 5 minutes (<code>touch_key</code>) to avoid unnecessary write amplification on every request.</li>
</ul>
<h3>M-Pesa Daraja STK Push, Callback Security, and Subscription Lifecycle</h3>
<p>Payments are modeled through <code>PaymentTransaction</code> (<code>PENDING</code>, <code>SUCCESS</code>, <code>FAILED</code>) and <code>UserSubscription</code> (one-to-one per user):</p>
<ul>
<li><strong>Phone normalization and STK push (<code>payment_initiation.py</code>, <code>mpesa_utils.py</code>, <code>daraja/client.py</code>):</strong> Blocks inactive or free plans, normalizes Kenyan numbers (<code>0712345678</code>, <code>712345678</code>, <code>+254712345678</code>, <code>254712345678</code>, <code>0112345678</code> -&gt; <code>254...</code>), creates a <code>PENDING</code> transaction with a 12-character <code>provider_reference</code> (<code>NP</code> + 10 hex chars, matching Daraja's <code>AccountReference</code> length constraint), caches OAuth tokens in <code>DarajaClient</code> until expiry, and stores <code>CheckoutRequestID</code> and <code>MerchantRequestID</code> on the transaction. Any network error, non-zero <code>ResponseCode</code>, or missing <code>CheckoutRequestID</code> marks the transaction <code>FAILED</code> and raises <code>PaymentInitiationError</code>.</li>
<li><strong>Un-signed callback defense (<code>views/__init__.py</code>, <code>payment_confirmation.py</code>):</strong> Safaricom Daraja STK callbacks are not cryptographically signed by Safaricom, so the callback route <code>/api/payments/mpesa/callback/&lt;str:secret&gt;/</code> embeds <code>MPESA_CALLBACK_SECRET</code> and validates it with <code>hmac.compare_digest</code> (returning <code>404</code> when missing or mismatched).</li>
<li><strong>Idempotency, row locking, and underpayment protection:</strong> <code>confirm_mpesa_payment()</code> runs inside <code>@transaction.atomic</code> and acquires a row lock via <code>select_for_update()</code> on <code>checkout_request_id</code>. Unknown checkout IDs log a warning and return <code>"unknown"</code> with a <code>200</code> <code>ResultCode: 0</code> response so Safaricom stops retrying. If <code>txn.status != PENDING</code>, it immediately returns <code>"duplicate"</code>—guaranteeing that replayed callbacks never extend a subscription twice. On <code>ResultCode == 0</code>, it compares <code>result.amount</code> against <code>txn.amount.to_integral_value(rounding=ROUND_UP)</code>: if <code>result.amount</code> is missing or less than expected, it marks the transaction <code>FAILED</code> with an <code>"Amount mismatch..."</code> message and does <strong>not</strong> activate the subscription.</li>
<li><strong>Period stacking vs. plan switches (<code>periods.py</code>, <code>subscription_activation.py</code>):</strong> <code>new_end_date()</code> adds <code>plan.duration</code> (<code>1</code>, <code>30</code>, or <code>365</code> days) onto <code>current_end</code> <strong>only</strong> when renewing the exact same plan while still active (<code>is_current(now)</code>); switching plans or subscribing after expiry starts a fresh period from <code>now</code>. A scheduled task (<code>expire_subscriptions</code>) downgrades lapsed paid subscriptions back to the free plan (<code>end_date=None</code>) or deactivates them if no free plan exists.</li>
</ul>
<h3>Fixture Ingestion and 90-Minute Data Hygiene</h3>
<p><code>django_app/netpredict_core/ingest/football_data.py</code> and <code>sync.py</code> keep ingestion pure and idempotent:</p>
<ul>
<li><code>FootballDataClient</code> paces requests with a configurable minimum interval (<code>6.5s</code> by default for ~10 req/min free-tier limits), retries on HTTP <code>429</code> using <code>Retry-After</code>, and inspects <code>X-Requests-Available-Minute</code> and <code>X-RequestCounter-Reset</code> headers to wait out exhausted minute quotas.</li>
<li><code>parse_matches()</code> skips undecided knockout slots (<code>homeTeam</code> or <code>awayTeam</code> missing <code>id</code> or <code>name</code>), marks <code>stage == "FINAL"</code> as <code>is_neutral=True</code>, maps <code>AWARDED</code> to <code>CANCELLED</code> so unplayed/awarded games do not enter training, and extracts <strong>90-minute regulation goals</strong> (<code>regularTime</code> when <code>duration != "REGULAR"</code>, returning <code>(None, None)</code> when regulation score is unavailable rather than guessing from extra time or penalties).</li>
<li><code>sync_competition()</code> upserts <code>League</code>, <code>Team</code> by <code>(source, external_id)</code>, and <code>Match</code> by <code>(source, external_id)</code> inside an atomic transaction.</li>
</ul>
<hr />
<h2>3. Letting FastAPI Own Inference, Caching, and Atomic Quotas</h2>
<h3>From Monte Carlo to Vectorized L-BFGS + Closed-Form Dixon-Coles</h3>
<p>Rather than simulating thousands of random draws per request or refitting models on every call, <code>fastapi_app/ml/</code> uses analytical optimization and exact probability matrices:</p>
<ol>
<li><strong>Time-decayed Poisson team strengths (<code>strength_model.py</code>):</strong> Each match contributes weight</li>
</ol>
<p>$$w_i = 0.5^{\text{days_ago}_i / \text{half_life_days}}$$</p>
<p>For match $i$ between home team $h$ and away team $a$ with non-neutral indicator \(\text{hf}_i = 1 - \text{neutral}_i\):</p>
<p>$$\log(\lambda_{h,i}) = \mu + \text{hf}_i \cdot \text{home_adv} + \text{attack}_h - \text{defence}_a$$</p>
<p>$$\log(\lambda_{a,i}) = \mu + \text{attack}_a - \text{defence}_h$$</p>
<p><code>StrengthModel.fit()</code> minimizes weighted Poisson negative log-likelihood plus an \(L_2\) ridge penalty <code>ridge * (sum(attack^2) + sum(defence^2))</code> using a vectorized analytic gradient and <code>scipy.optimize.minimize(..., method="L-BFGS-B")</code>. The ridge term shrinks low-history teams toward zero (league average) and stabilizes parameter estimation, while <code>MIN_LAMBDA = 0.05</code> and <code>MAX_LAMBDA = 6.0</code> guard predicted goal rates.</p>
<ol start="2">
<li><p><strong>Dixon-Coles low-score dependence (\(\rho\)):</strong> Because independent Poisson distributions misestimate low-scoring outcomes (<code>0-0</code>, <code>0-1</code>, <code>1-0</code>, <code>1-1</code>), <code>StrengthModel</code> fits a scalar parameter \(\rho \in [-0.25, 0.25]\) via <code>minimize_scalar(..., method="bounded")</code> over low-scoring matches (<code>home_goals &lt;= 1</code> and <code>away_goals &lt;= 1</code>, when at least 30 such matches exist) using the <code>dc_tau</code> adjustment factor.</p>
</li>
<li><p><strong>Closed-form scoreline matrix (<code>scoreline.py</code>):</strong> <code>score_matrix()</code> builds an \(11 \times 11\) grid (<code>0..10</code> goals per side) from <code>poisson.pmf(g, lam_h)</code> and <code>poisson.pmf(g, lam_a)</code>, applies <code>dc_tau</code> to the low-score cells when <code>rho != 0</code>, clips negatives, and normalizes to sum to <code>1.0</code>. From that single matrix, <code>summarize()</code> computes exact probabilities for <code>HOME</code> (<code>i &gt; j</code>), <code>DRAW</code> (<code>i == j</code>), <code>AWAY</code> (<code>i &lt; j</code>), <code>over_1_5</code> (<code>total &gt;= 2</code>), <code>over_2_5</code> (<code>total &gt;= 3</code>), <code>over_3_5</code> (<code>total &gt;= 4</code>), <code>btts</code> (<code>i &gt;= 1</code> and <code>j &gt;= 1</code>), expected goals, and top scorelines.</p>
</li>
</ol>
<p>Confidence is flagged (<code>low_confidence=True</code>) whenever either team's time-decayed effective match weight (<code>team_weight</code>) falls below <code>LOW_CONFIDENCE_WEIGHT = 3.0</code>. If neither team is known to the fitted model, <code>predict()</code> raises <code>UnknownTeamsError</code> (mapped to HTTP <code>422</code> on <code>/predict/</code>).</p>
<h3>Fingerprint-Aware Caching and Order of Operations in <code>POST /predict/</code></h3>
<ul>
<li><code>engine_for()</code> (<code>api/service.py</code>) retrieves a <code>PredictionEngine</code> from <code>EngineCache</code> using key <code>("all",)</code> and fingerprint <code>(COUNT(*), MAX(updated_at))</code> over <code>FINISHED</code> matches (<code>repo.training_fingerprint()</code>), subject to <code>MODEL_CACHE_TTL_SECONDS</code>. Updating finished match scores changes the fingerprint and triggers a fresh fit without needing manual cache invalidation hooks.</li>
<li>In <code>predict_match()</code> (<code>api/routes/predict.py</code>), authentication, subscription currentness (<code>is_active</code> and <code>end_date &gt; now</code> in UTC), monthly total/exact-score limits (<code>auth/limits.py</code>), team/fixture resolution (<code>404</code> if missing, <code>409</code> if ambiguous, <code>422</code> if same team or finished match), and model prediction all happen <strong>before</strong> <code>repo.consume_request()</code> runs. Failed or rejected requests do not consume daily quota.</li>
</ul>
<h3>Atomic Daily Quota Updates Without Race Conditions</h3>
<p><code>repo.consume_request()</code> (<code>db/repo.py</code>) prevents concurrent requests from exceeding <code>daily_request_limit</code> by executing a single conditional SQL statement:</p>
<pre><code class="language-sql">UPDATE np_api_usage
SET total_requests = total_requests + 1,
    exact_score_requests = exact_score_requests + CASE WHEN :exact THEN 1 ELSE 0 END
WHERE user_id = :user_id
  AND date = :day
  AND total_requests &lt; :daily_limit;
</code></pre>
<p>It retries up to 3 times if today's <code>np_api_usage</code> row does not exist yet—inserting a zero row and catching <code>IntegrityError</code> if another request created it concurrently—and returns <code>False</code> (yielding HTTP <code>429</code>) when the row exists and <code>total_requests &lt; daily_limit</code> does not match.</p>
<hr />
<h2>4. Preventing Schema Drift Across Two Frameworks</h2>
<p>Because Django owns <code>migrations/</code> while FastAPI uses SQLAlchemy Core (<code>fastapi_app/db/tables.py</code>) to query and insert into Django's tables, silent column or type drift is a classic hazard.</p>
<p>NetPredict pairs two safeguards:</p>
<ol>
<li><strong>Minimal Core column declarations:</strong> <code>db/tables.py</code> declares only the columns FastAPI actually uses, explicitly noting that Django owns the schema and migrations.</li>
<li><strong>Cross-service integration test (<code>fastapi_app/tests/test_integration.py</code>):</strong> The test fixture creates a temporary SQLite database, runs <code>manage.py makemigrations netpredict_core --noinput</code> and <code>manage.py migrate --noinput</code>, runs <code>seed_demo</code> for both <code>Pro</code> and <code>Free</code> users, imports FastAPI against that same database, tests auth, team-specific predictions, <code>exact_score</code> gating (<code>200</code> on Pro, <code>403</code> on Free), bad-input non-billing (<code>404</code>, <code>409</code>, <code>422</code>), exact <code>429</code> daily quota enforcement (<code>5</code> allowed + <code>2</code> rejected on Free), <code>Bearer</code> token auth, <code>match_id</code> lookup, <code>/internal/publish</code> idempotency, and key revocation—and then marks scheduled matches <code>FINISHED</code> in SQL and runs Django's <code>settle_predictions</code> and <code>recompute_accuracy</code> commands against the shared DB.</li>
</ol>
<hr />
<h2>5. Pre-Kickoff <code>OFFICIAL</code> Predictions, Settlement, and Backtesting</h2>
<p>To keep the public track record (<code>#/accuracy</code> and <code>GET /api/accuracy/</code>) honest and auditable:</p>
<ul>
<li>Celery Beat schedules <code>publish_official_predictions</code> every 3 hours (<code>minute=20, hour="*/3"</code>), which calls <code>POST /internal/publish</code> with <code>X-Internal-Token</code>.</li>
<li>FastAPI queries <code>fixtures_needing_official()</code> for <code>SCHEDULED</code> matches from <code>today</code> in <code>APP_TIMEZONE</code> through <code>today + OFFICIAL_DAYS_AHEAD</code> (default <code>5</code> days) that do not already have a <code>plan_name="OFFICIAL"</code> row in <code>np_prediction_log</code>, predicts them before kickoff, and logs them with <code>user_id=None</code> and <code>plan_name="OFFICIAL"</code> (<code>IntegrityError</code> on a concurrent publish is safely skipped).</li>
<li><code>settle_predictions</code> (<code>services/settlement.py</code>) scans unresolved <code>PredictionLog</code> entries from the last 120 days, matches them by <code>match_id</code> or <code>(competition, home_team, away_team, match_date)</code>, and once the match is <code>FINISHED</code> with non-null 90-minute goals, populates <code>actual_home_goals</code>, <code>actual_away_goals</code>, <code>actual_outcome</code>, <code>actual_score</code>, and <code>resolved_at</code>.</li>
<li><code>AccuracyAggregator</code> (<code>services/accuracy_aggregator.py</code>) and <code>compute_metrics()</code> (<code>services/accuracy_metrics.py</code>) compute <code>total_predictions</code>, <code>outcome_accuracy</code>, <code>exact_score_accuracy</code>, <code>top3_score_accuracy</code>, 3-way <code>brier_score</code> (<code>0</code> = perfect, <code>2</code> = worst), and <code>log_loss</code> across <code>GLOBAL</code>, <code>LEAGUE</code>, and <code>PLAN</code> scopes into <code>AccuracySnapshot</code>.</li>
</ul>
<p>Separately, <code>fastapi_app/ml/backtest.py</code> and <code>fastapi_app/scripts/backtest.py</code> run <strong>walk-forward backtests</strong>—retraining strictly on matches before each rolling window (<code>as_of = t - 1 day</code>) with zero lookahead—comparing the model against historical outcome frequencies, most-common scoreline guessing, and over/under / BTTS base rates, plus <code>reliability()</code> calibration buckets.</p>
<hr />
<h2>6. Zero-Build PWA + Mock E2E Testing</h2>
<p>The frontend (<code>web/</code>) is a dependency-free progressive web app built with vanilla ES modules, hash routing (<code>#/</code>), a custom <code>html</code> tagged template helper that escapes interpolated values by default (<code>web/js/ui.js</code>), a signature probability pitch strip (<code>strip()</code>), M-Pesa payment status polling (<code>web/js/views/pricing.js</code>), and a network-first service worker (<code>web/sw.js</code>) that caches the static shell while sending <code>/api</code> and <code>/predict-api</code> calls straight to the network.</p>
<p>Because <code>web/</code> has no bundler or framework build step, UI work can run completely standalone via <code>scripts/web_dev/mock_server.py</code> (which simulates CSRF rotation on login, plan permissions, daily quotas, and M-Pesa payment settlement) and verified end-to-end in headless Chromium with <code>scripts/web_dev/e2e.py</code> across desktop and mobile viewports.</p>
<hr />
<h2>7. Honest Rough Edges Still in the Repo</h2>
<p>Documenting what is rough or unfinished is just as useful as documenting what works:</p>
<ul>
<li><strong>Pricing &amp; config drift to clean up:</strong> <code>bootstrap.py</code> seeds <code>Pro</code> at <code>499</code> KES (<code>Free</code> <code>0</code>, <code>Elite</code> <code>1499</code>), whereas <code>test_django.py</code> (<code>PaymentInitiationTests</code> and <code>callback()</code>) asserts <code>999</code>. Likewise, <code>.env.example</code> lists <code>MODEL_HALF_LIFE_DAYS=365</code> while <code>fastapi_app/config.py</code> defaults to <code>180</code>, and <code>README.md</code> mentions <code>Export-Source.ps1</code> while the script in the repo root is <code>generate.ps1</code>.</li>
<li><strong>Planned next steps:</strong> Email password reset, social login, bookmaker odds ingestion and calibration (<code>ml/experimental/calibration.py</code> is currently a stub), player/xG features, additional payment providers, and offline model training/registry beyond per-process TTL/fingerprint caching.</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Designing HydroPulse: One Dispatch Core for LCOH Scenarios and Live Telemetry in .NET 9]]></title><description><![CDATA[Learn how HydroPulse uses one C#/.NET 9 dispatch core across 20-year green hydrogen LCOH scenarios, grid matching rules, and live SignalR telemetry.]]></description><link>https://xagedev.hashnode.dev/designing-hydropulse-one-dispatch-core-for-lcoh-scenarios-and-live-telemetry-in-net-9</link><guid isPermaLink="true">https://xagedev.hashnode.dev/designing-hydropulse-one-dispatch-core-for-lcoh-scenarios-and-live-telemetry-in-net-9</guid><category><![CDATA[#CSharpProgramming ]]></category><category><![CDATA[DOT NET Development]]></category><category><![CDATA[dotnet]]></category><category><![CDATA[simulation]]></category><category><![CDATA[green energy]]></category><category><![CDATA[renewable-energy]]></category><category><![CDATA[Sizing]]></category><category><![CDATA[plantsizing]]></category><category><![CDATA[architecture]]></category><category><![CDATA[Csharhp]]></category><dc:creator><![CDATA[Kenneth Muketha]]></dc:creator><pubDate>Fri, 27 Nov 2026 10:12:45 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/69cbe937c1e86567d75194db/d65f0b6c-29b5-4479-9287-d829e948e139.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>When building simulation software for hybrid renewable energy and green hydrogen, one of the easiest traps is duplicating business logic across batch analysis tools and live monitoring services. Over time, your historical/scenario models and your live feed drift apart.</p>
<p>In HydroPulse, I structured the solution around a pure, I/O-free domain engine (HydroPulse.Domain) where a single dispatch function (PlantDispatch.Run) drives both:</p>
<p>Multi-year levelized cost of hydrogen (LCOH) and sizing/sensitivity sweeps (ScenarioRunner and ScenarioAnalysis)</p>
<p>Real-time simulated telemetry streamed to PostgreSQL and SignalR (H2TelemetrySimulationWorker and TelemetryHub)</p>
<p>Solution Layout and Boundaries</p>
<p>The codebase follows clean layering with clear responsibilities:</p>
<p>HydroPulse.Domain: Pure models and calculations (ElectrolyzerModel, CompressionModel, PvModel, WindModel, PlantDispatch, ScenarioRunner, ScenarioAnalysis, LcohCalculator, RenewableReplay, and CSV weather parsers) with no framework or I/O dependencies.</p>
<p>HydroPulse.Application: Interfaces (ITelemetryRepository) and service abstractions.</p>
<p>HydroPulse.Infrastructure: EF Core + Npgsql persistence (HydroPulseDbContext, TelemetryRepository, and migrations).</p>
<p>HydroPulse.Api: ASP.NET Core host exposing REST endpoints (/api/plant, /api/telemetry), a SignalR hub (/hubs/telemetry), static dashboard assets, and the background simulation worker.</p>
<p>HydroPulse.ScenarioRunner &amp; HydroPulse.Domain.Tests: CLI scenario runner/dashboard builder and an xUnit test suite covering models, dispatch, replay, tariffs, mix optimization, and firm supply.</p>
<p>Keeping HydroPulse.Domain free of database and HTTP concerns makes unit testing straightforward and ensures the math behaves identically in tests, batch sweeps, and live ticks.</p>
<p>One Dispatch Function Across Batch and Live Ticks</p>
<p>Compression is modeled as a parasitic load alongside the electrolyzer stack. Because specific energy consumption (SEC) varies slightly with load fraction and cumulative operating hours, stack power and compression power are coupled.</p>
<p>PlantDispatch.Run resolves this coupling with a short fixed-point loop (5 iterations):</p>
<p>public static DispatchResult Run(ElectrolyzerModel model, double availableKw, double operatingHours, double compressionKwhPerKg)
{
    if (availableKw &lt;= 0) return default;</p>
<pre><code>var p = model.Parameters;
double rated = p.RatedPowerKw;
double minKw = rated * p.MinimumLoadFraction;

double ps = Math.Min(availableKw, rated);
double target = ps;
for (int i = 0; i &lt; FixedPointIterations; i++)
{
    double sec = model.SpecificEnergy(ps / rated, operatingHours);
    target = availableKw / (1.0 + compressionKwhPerKg / sec);
    ps = Math.Min(rated, target);
}

if (ps &lt; minKw) return default;

var state = model.Evaluate(ps, operatingHours);
return new DispatchResult(
    state.PowerUsedKw,
    state.HydrogenKgPerHour,
    state.WaterLitersPerHour,
    state.HydrogenKgPerHour * compressionKwhPerKg,
    target &gt; rated ? ElectrolyzerMode.Saturated : ElectrolyzerMode.PartLoad);
</code></pre>
<p>}</p>
<p>Why this matters in practice:</p>
<p>Standby gating: If power after accounting for compression falls below RatedPowerKw * MinimumLoadFraction, the plant stays in standby rather than running below minimum stable load.</p>
<p>Saturation vs. part-load: When target &gt; rated, the stack clamps at rated capacity and excess power is curtailed (or exported/banked depending on mode and matching rules), while compression reflects the hydrogen produced.</p>
<p>Consistent metrics: Both the scenario runner and the 3-second live worker read from the same dispatch output.</p>
<p>Operating Modes and Grid Matching Policies</p>
<p>Rather than hard-coding separate pipelines per grid arrangement, ScenarioConfig separates operating mode (OffGrid vs. GridConnected) from matching policy (None, Monthly, Hourly):</p>
<p>OffGrid: Only on-site PV and wind supply power; surplus energy is curtailed.</p>
<p>GridConnected + None: Grid import is allowed up to MaxImportKw when the active tariff (including optional local off-peak windows) is at or below MaxImportPriceUsdPerKwh, with optional monthly demand charges on peak hourly import.</p>
<p>GridConnected + Monthly: Surplus renewable energy builds a monthly bank, constraining grid imports and applying a wheeling fee.</p>
<p>GridConnected + Hourly: Consumption cannot exceed same-hour renewable generation.</p>
<p>In ScenarioRunner, each project year steps through the hourly weather series, applies PV degradation (pvFactor) and stack SEC degradation over accumulated opHours, triggers stack replacement when opHours &gt;= StackLifetimeHours, and discounts yearly cash flows and hydrogen output in LcohCalculator.</p>
<p>Bridging Hourly Weather to a Live Stream</p>
<p>For the live view, RenewableReplay takes an hourly WeatherSeries and linearly interpolates between adjacent samples—wrapping around at the series boundary—so a worker ticking every few seconds sees smooth transitions instead of step jumps.</p>
<p>In H2TelemetrySimulationWorker:</p>
<p>ReplaySetup.TryCreate resolves weather CSVs (such as nairobi-2024.csv or turkana-2024.csv) and builds a RenewableReplay plan from configuration (falling back to random demo power if disabled or unavailable).</p>
<p>Each tick computes PowerKw(simulatedUtc), calls PlantDispatch.Run, advances simulated operating hours by Interval.TotalHours * speedUp when the stack runs, and constructs a TelemetryRecord.</p>
<p>The worker persists the record via ITelemetryRepository and broadcasts ReceiveTelemetry (plus ReplayClock during replay) over TelemetryHub (/hubs/telemetry) to clients in the plant group.</p>
<p>Practical Caveats and Honest Assumptions</p>
<p>A solid engineering write-up is stronger when it calls out model scope upfront:</p>
<p>Calibration status: Several default cost and equipment figures are placeholders until replaced with vendor quotes or cited project data (tracked in docs/SOURCES.md).</p>
<p>Reanalysis vs. site data: NASA POWER reanalysis data can understate site-specific wind speeds (as noted for Lake Turkana), and MeasuredWeatherCsvParser / sites.json exist to bring in measured or site-calibrated series.</p>
<p>Scope boundaries: Ideal-gas multistage compression is an approximation at high pressures, PV uses horizontal irradiance without tilt/tracking, and the live worker is a simulator rather than a SCADA/PLC adapter.</p>
]]></content:encoded></item><item><title><![CDATA[Building a Web Scraper with Python for Data Extraction]]></title><description><![CDATA[In one of my recent projects, I built a web scraper using Python to extract and process data from online sources. The goal of this project was to automate…]]></description><link>https://xagedev.hashnode.dev/building-a-web-scraper-with-python-for-data-extraction</link><guid isPermaLink="true">https://xagedev.hashnode.dev/building-a-web-scraper-with-python-for-data-extraction</guid><category><![CDATA[software development]]></category><category><![CDATA[Python]]></category><category><![CDATA[selenium]]></category><dc:creator><![CDATA[Kenneth Muketha]]></dc:creator><pubDate>Fri, 27 Nov 2026 09:48:05 GMT</pubDate><content:encoded><![CDATA[<p>In one of my recent projects, I built a web scraper using Python to extract and process data from online sources.</p>
<p>The goal of this project was to automate data collection and transform unstructured web content into structured, usable data. I implemented efficient scraping techniques and handled challenges such as dynamic content, request handling, and data cleaning.</p>
<p>The scraped data was then processed and stored for further analysis, demonstrating how automation can significantly reduce manual effort in data gathering tasks.</p>
<p>Through this project, I strengthened my understanding of HTTP requests, parsing techniques, and data handling in Python. I am particularly interested in expanding this into more advanced data pipelines and real-time data processing systems.</p>
]]></content:encoded></item><item><title><![CDATA[Building KU CI: Engineering a Geospatial Intelligence Platform for Kenyatta University]]></title><description><![CDATA[From GPS field data collection to PostGIS spatial queries, geofencing, spatial indexing, and API-first campus intelligence.]]></description><link>https://xagedev.hashnode.dev/building-ku-ci-engineering-a-geospatial-intelligence-platform-for-kenyatta-university</link><guid isPermaLink="true">https://xagedev.hashnode.dev/building-ku-ci-engineering-a-geospatial-intelligence-platform-for-kenyatta-university</guid><category><![CDATA[software development]]></category><category><![CDATA[Software Engineering]]></category><category><![CDATA[Kenyatta University]]></category><category><![CDATA[navigation]]></category><category><![CDATA[Python]]></category><category><![CDATA[Devops]]></category><category><![CDATA[PostGIS]]></category><category><![CDATA[Geospatial]]></category><category><![CDATA[maps]]></category><dc:creator><![CDATA[Kenneth Muketha]]></dc:creator><pubDate>Tue, 31 Mar 2026 15:49:48 GMT</pubDate><content:encoded><![CDATA[<h2>1. The Problem: A Campus Is More Than a Collection of Buildings</h2>
<p>A university campus is a complex physical environment.</p>
<p>It contains academic buildings, administrative offices, lecture halls, student facilities, health services, sports grounds, security points, infrastructure, and numerous other locations. These places have relationships with one another, geographical boundaries, accessibility considerations, and information that changes over time.</p>
<p>Yet campus information is often represented as disconnected records: names, descriptions, addresses, and occasionally GPS coordinates.</p>
<p>That approach makes basic information storage possible, but it limits what an application can understand about the physical environment.</p>
<p>Consider a few questions:</p>
<ul>
<li>Which facilities are within 500 metres of a particular location?</li>
<li>How far is one building from another?</li>
<li>Does a GPS coordinate fall inside a defined campus zone?</li>
<li>How can campus locations be collected, validated, stored, and queried consistently?</li>
<li>How can other applications consume this information without implementing their own geographical data layer?</li>
</ul>
<p>These questions require more than a conventional CRUD application.</p>
<p>They require a system that understands location as structured spatial data.</p>
<p>That is the problem behind <strong>KU CI — Kenyatta University Campus Intelligence</strong>.</p>
<p>The goal is to build an API-first geospatial intelligence platform that transforms physical campus infrastructure into structured, queryable geographical information. Its foundation is a backend built around TypeScript, Fastify, PostgreSQL, and PostGIS.</p>
<h2>2. Why PostGIS Instead of Ordinary Coordinates?</h2>
<p>One of the earliest architectural decisions was how to represent geographical information.</p>
<p>A conventional database can store latitude and longitude in separate numeric columns:</p>
<pre><code class="language-sql">latitude  DOUBLE PRECISION,
longitude DOUBLE PRECISION
</code></pre>
<p>This is sufficient when coordinates are only metadata.</p>
<p>However, KU CI needs to perform geographical operations. It must calculate distances, search within a radius, work with geographical boundaries, and determine whether a point belongs to a particular zone.</p>
<p>Storing coordinates as independent numbers would mean repeatedly implementing or delegating these operations to application-level logic.</p>
<p>Instead, KU CI uses <strong>PostgreSQL with PostGIS</strong>.</p>
<p>PostGIS extends PostgreSQL with spatial data types, spatial functions, and indexing capabilities. It allows geographical operations to be performed directly inside the database.</p>
<p>This changes the role of the database. It is no longer simply storing where a location is; it can also answer questions about that location.</p>
<h2>3. Designing the Spatial Data Model</h2>
<p>The central spatial entity is the <code>Location</code>.</p>
<p>A location represents a physical point of interest within the campus environment. It can contain descriptive information alongside geographical geometry.</p>
<p>The model supports two important spatial representations:</p>
<ul>
<li><strong>POINT:</strong> represents a specific geographical coordinate, such as a building entrance or facility.</li>
<li><strong>POLYGON:</strong> represents an area or geographical boundary, such as a campus zone.</li>
</ul>
<p>Both geometries use the WGS 84 coordinate reference system, identified by SRID 4326.</p>
<p>A simplified representation of the model looks like this:</p>
<pre><code class="language-text">Location
├── id
├── name
├── coordinates: POINT (SRID 4326)
└── area: POLYGON (SRID 4326, optional)
</code></pre>
<p>The distinction between points and polygons is important.</p>
<p>A point answers the question, "Where is this facility?"</p>
<p>A polygon makes it possible to ask, "Does this coordinate fall within this defined geographical area?"</p>
<p>For GeoJSON, coordinate order also matters. Coordinates are represented as longitude followed by latitude:</p>
<pre><code class="language-json">{
  "type": "Point",
  "coordinates": [36.8219, -1.2921]
}
</code></pre>
<p>Mixing up these values can produce incorrect geographical positions, so coordinate order must remain consistent throughout data collection, validation, API requests, and database operations.</p>
<h2>4. Making Location Data Queryable</h2>
<p>Once geographical information is stored as spatial geometry, the platform can perform meaningful spatial queries.</p>
<p>One implemented capability is radius-based location discovery.</p>
<p>For example, a client can request:</p>
<pre><code class="language-http">GET /api/locations/nearby?lat=-1.2921&amp;lng=36.8219&amp;radius=5000&amp;limit=20&amp;offset=0
</code></pre>
<p>The request supplies a geographical coordinate, a search radius, and pagination parameters.</p>
<p>Rather than retrieving every location and calculating distances in application code, the database performs the spatial filtering.</p>
<p>PostGIS provides functions such as:</p>
<ul>
<li><code>ST_SetSRID</code> — assigns a spatial reference system.</li>
<li><code>ST_MakePoint</code> — constructs a point geometry.</li>
<li><code>ST_DWithin</code> — determines whether geometries fall within a specified distance.</li>
<li><code>ST_Distance</code> — calculates the distance between geometries.</li>
<li><code>ST_X</code> and <code>ST_Y</code> — extract coordinate components.</li>
</ul>
<p>A simplified illustration of a radius query is:</p>
<pre><code class="language-sql">SELECT
    id,
    name,
    ST_Distance(
        coordinates::geography,
        ST_SetSRID(
            ST_MakePoint(:longitude, :latitude),
            4326
        )::geography
    ) AS distance
FROM locations
WHERE ST_DWithin(
    coordinates::geography,
    ST_SetSRID(
        ST_MakePoint(:longitude, :latitude),
        4326
    )::geography,
    :radius
)
ORDER BY distance
LIMIT :limit
OFFSET :offset;
</code></pre>
<p>This example illustrates the underlying spatial operation; the actual application implementation is managed through the backend's database layer.</p>
<p>Using the geography representation allows distance calculations and radius filtering to use metre-based distances rather than treating geographical coordinates as ordinary Cartesian values.</p>
<p>The result is a more useful location API: clients can request nearby facilities without needing to understand the underlying spatial calculations.</p>
<h2>5. Geofencing: Moving Beyond Individual Locations</h2>
<p>Radius searches answer questions about proximity. Geofencing answers a different question: whether a coordinate belongs to a defined geographical area.</p>
<p>This is particularly useful for a campus environment where geographical zones can represent specific sections or areas.</p>
<p>KU CI supports the creation of polygon-based geographical boundaries through:</p>
<pre><code class="language-http">POST /api/locations/geofence
</code></pre>
<p>A polygon can be supplied using GeoJSON geometry.</p>
<p>Once a boundary exists, a coordinate can be checked against it:</p>
<pre><code class="language-http">GET /api/locations/geofence/check?lat=...&amp;lng=...
</code></pre>
<p>PostGIS provides the spatial operations required for this functionality.</p>
<p>For example:</p>
<ul>
<li><code>ST_GeomFromGeoJSON</code> converts GeoJSON geometry into a spatial representation.</li>
<li><code>ST_IsValid</code> can validate polygon geometry.</li>
<li><code>ST_Contains</code> checks whether a geometry contains another geometry.</li>
<li><code>ST_MakePoint</code> constructs the coordinate being tested.</li>
</ul>
<p>This introduces an important capability: the system can reason about geographical areas, not just isolated points.</p>
<p>Potential applications include campus-zone discovery, location-aware services, and future boundary-based navigation features.</p>
<p>The distinction is important: the geofencing foundation and point-in-polygon checking are implemented capabilities, while broader location-aware applications remain part of the platform's development direction.</p>
<h2>6. Spatial Indexing and Database Performance</h2>
<p>Spatial queries can become expensive as a geographical dataset grows.</p>
<p>Without an appropriate indexing strategy, the database may need to examine a large number of records to identify locations that satisfy a geographical condition.</p>
<p>KU CI uses <strong>GIST (Generalized Search Tree) spatial indexes</strong> to support spatial queries.</p>
<p>A spatial index allows PostgreSQL and PostGIS to narrow down candidate geometries before performing more precise spatial operations.</p>
<p>For the location coordinates, the indexing strategy is based on:</p>
<pre><code class="language-sql">CREATE INDEX locations_coordinates_gist
ON locations
USING GIST (coordinates);
</code></pre>
<p>The important architectural principle is that geographical filtering belongs close to the data.</p>
<p>Instead of loading large collections of locations into the API and filtering them in JavaScript, the database performs the spatial work.</p>
<p>This reduces unnecessary data transfer and gives the database's spatial query engine the opportunity to use its indexing capabilities.</p>
<p>Indexing is not a substitute for query planning or performance testing, but it establishes the right foundation as the dataset grows.</p>
<h2>7. Building a Field Data Collection Pipeline</h2>
<p>A geospatial platform is only as useful as the quality of its geographical data.</p>
<p>The database architecture solves the storage and querying problem, but the system also needs a reliable way to collect information from the physical campus.</p>
<p>KU CI incorporates a field-data collection workflow using <strong>KoboToolbox and KoboCollect</strong>.</p>
<p>The intended workflow is:</p>
<ol>
<li>Collect campus facility information in the field.</li>
<li>Capture GPS coordinates alongside descriptive attributes.</li>
<li>Record relevant metadata, including location names, categories, types, descriptions, campus zones, accessibility, and facility information.</li>
<li>Review and clean collected records.</li>
<li>Validate geographical information and geometry.</li>
<li>Import structured geographical data into the platform.</li>
</ol>
<p>This separates field collection from the backend's responsibility for storing, validating, and exposing structured information.</p>
<p>It also provides a path towards a more comprehensive campus dataset.</p>
<p>The intended dataset spans several categories:</p>
<ul>
<li>Academic and administrative facilities.</li>
<li>Student-life facilities.</li>
<li>Health services.</li>
<li>Sports and recreation.</li>
<li>Security.</li>
<li>Infrastructure.</li>
<li>Campus landmarks.</li>
</ul>
<p>The field collection and mapping workflow establishes the foundation, while comprehensive campus coverage and dataset validation remain ongoing work.</p>
<h2>8. Backend Architecture: Fastify, TypeScript, Sequelize, and PostgreSQL</h2>
<p>KU CI follows an API-first architecture.</p>
<p>Its backend is built with Node.js and TypeScript, using Fastify as the HTTP framework.</p>
<p>The architecture separates the API into distinct responsibilities:</p>
<pre><code class="language-text">                    API Clients
                        |
                        v
                   Fastify API
                        |
          +-------------+-------------+
          |             |             |
        Auth          Routes       Middleware
          |             |             |
          +-------------+-------------+
                        |
                     Services
                        |
                        v
                     Sequelize
                        |
                        v
                 PostgreSQL + PostGIS
                        |
              Spatial Data and Indexes
</code></pre>
<p>The main components serve different purposes:</p>
<p><strong>Fastify</strong></p>
<p>Handles HTTP requests, route registration, and API-level functionality.</p>
<p><strong>TypeScript</strong></p>
<p>Provides static typing and helps maintain consistency across the backend.</p>
<p><strong>Sequelize</strong></p>
<p>Provides the application's database interaction and model layer.</p>
<p><strong>PostgreSQL and PostGIS</strong></p>
<p>Store structured application data and perform spatial operations.</p>
<p><strong>Docker</strong></p>
<p>Supports a containerized development and database environment.</p>
<p>The API is organized around resources such as authentication, buildings, and locations:</p>
<pre><code class="language-text">/api/auth
/api/buildings
/api/locations
</code></pre>
<p>The location endpoints provide the foundation for geographical discovery and spatial operations, while the other resources support the broader campus information model.</p>
<h2>9. Authentication and Access Control</h2>
<p>A campus intelligence platform may eventually serve different categories of users and applications.</p>
<p>Not every operation should be available to every client.</p>
<p>KU CI incorporates JWT-based authentication and authorization middleware.</p>
<p>The backend includes:</p>
<ul>
<li>Token verification through <code>verifyToken</code>.</li>
<li>Role-based authorization through <code>requireRole()</code>.</li>
<li>Protected routes.</li>
<li>An administrative access foundation.</li>
</ul>
<p>This establishes a separation between authentication—determining who is making a request—and authorization—determining what that user is allowed to do.</p>
<p>It also provides a foundation for future administrative workflows involving campus information management and data maintenance.</p>
<h2>10. Engineering Lessons</h2>
<p>Building KU CI has highlighted several important engineering considerations.</p>
<p><strong>1. Data representation determines what a system can do.</strong></p>
<p>Treating coordinates as ordinary numeric values is sufficient for simple storage, but spatial data types make geographical operations a first-class database capability.</p>
<p><strong>2. Spatial operations should happen close to the data.</strong></p>
<p>Using PostGIS for geographical filtering and distance calculations avoids unnecessary application-level processing and supports a more scalable query architecture.</p>
<p><strong>3. Geographical data quality is an engineering concern.</strong></p>
<p>Incorrect coordinates, invalid polygons, and inconsistent coordinate ordering can undermine an otherwise well-designed spatial system. Validation and structured field collection are therefore essential.</p>
<p><strong>4. Indexing should be considered early.</strong></p>
<p>Spatial indexing is part of the data architecture, not an optimization to postpone until the dataset becomes large.</p>
<p><strong>5. An API-first architecture creates room for multiple clients.</strong></p>
<p>The backend can serve Android applications, web interfaces, administrative tools, and future integrations without requiring each client to independently implement spatial data management.</p>
<h2>11. What's Next: From Spatial API to Campus Intelligence</h2>
<p>The current implementation establishes the backend and spatial foundation. The broader product vision extends beyond storing and querying campus locations.</p>
<p>The next stages include:</p>
<ul>
<li>Expanding and validating the campus geographical dataset.</li>
<li>Completing location and building management workflows.</li>
<li>Extending category-based and nearest-location discovery.</li>
<li>Improving API validation and documentation.</li>
<li>Developing navigation and client-facing campus discovery experiences.</li>
<li>Exploring accessibility-aware discovery and location analytics.</li>
</ul>
<p>These are development priorities rather than claims of already completed functionality.</p>
<p>The long-term objective is to make campus information more accessible, structured, and useful to both people and software systems.</p>
<p>A student should eventually be able to discover relevant facilities. An application should be able to identify nearby infrastructure. An administrator should be able to manage geographical information through a consistent platform.</p>
<p>That is the direction KU CI is designed to support.</p>
<h2>Conclusion</h2>
<p>KU CI started with a relatively straightforward question: how can geographical information about a university campus be represented and queried properly?</p>
<p>The engineering answer required more than a map and a collection of coordinates.</p>
<p>It required a spatial database, a well-defined geographical data model, indexed queries, polygon-based geofencing, a field collection strategy, and an API architecture capable of exposing those capabilities to other applications.</p>
<p>By combining TypeScript, Fastify, Sequelize, PostgreSQL, and PostGIS, KU CI establishes a foundation for turning a physical campus into a structured geographical information system.</p>
<p>The work is ongoing, but the underlying direction is clear: <strong>build the spatial intelligence layer first, then use it to power increasingly useful campus experiences.</strong></p>
<hr />
<p><em>KU CI — Kenyatta University Campus Intelligence</em></p>
<p><em>Built with TypeScript, Node.js, Fastify, PostgreSQL, PostGIS, Sequelize, Docker, and KoboToolbox/KoboCollect.</em></p>
]]></content:encoded></item></channel></rss>