1st Place, 4h Sprint

JCR Platform, Serverless AI Course Recommender

JCR Platform, Serverless AI Course Recommender
Role
Lead Developer
Timeline
April 2025
Duration
4-hour sprint
Team
2 engineers

Overview

A course recommender for a student club, trained and deployed in four hours. It learns from member profiles to suggest up to three courses each person is likely to want, and runs entirely on Cloudflare's edge so it responds fast anywhere, at no hosting cost.

The problem

The JCR sprint gave four hours to ship a real AI app with tight rules: no traditional servers, works for users worldwide, has real login, and puts AI to genuine use.

What I built

  1. 01

    An ensemble that recommends

    Two models, gradient boosting and a random forest, each score how well a course fits a member; their scores are blended, courses already taken are dropped, and the top few are returned.

  2. 02

    Runs at the edge

    The whole app runs on Cloudflare Workers, so there's no server to manage and no cold start, and it talks to a serverless Postgres over HTTP because normal database connections don't work in that environment.

  3. 03

    Fast to build, hard to break

    A type-safe query layer caught database mistakes at build time rather than in the demo, which matters when the clock is four hours, and login runs on a WebAssembly build of bcrypt that works at the edge.

Architecture

01 · Offline Training02 · Edge03 · DataXGBoost + RF.joblib exportCloudflare WorkerHono.js · Drizzle · bcryptNeon Postgres

The models train offline and export their predictions. A single Cloudflare Worker handles every route and query against a serverless Postgres, checks the login on each request, and serves each member their filtered recommendations. Built and deployed in four hours.

Tech stack

XGBoost + Random Forest Ensemble

Multi-label classification with 50/50 blended probabilities, randomized search tuning, 400 RF estimators, 0.40 threshold, top-3 recommendations

Data Pipeline (Python)

One-hot encoding (Filière, Cellule, Sexe), numeric normalization/clipping, multi-label binarization, course-already-taken filtering

Cloudflare Workers

Edge compute runtime in 300+ global data centers, zero cold starts

Neon Serverless Postgres

HTTP driver for edge compatibility in V8 isolates, zero-cold-start database access

Drizzle ORM + Hono.js

Type-safe SQL queries + ultra-lightweight edge web framework

WebAssembly bcrypt

Edge-compatible password hashing compiled to WASM for Cloudflare runtime

Results

1st Place

Won the 4-hour JCR sprint challenge

Custom ML Model

XGBoost + Random Forest ensemble trained, tuned, and deployed in the 4-hour window

< 50ms

Global response time from any location via Cloudflare edge

Top-3 Recs

Personalized course recommendations per member with 0.40 probability threshold

$0 Hosting

Runs on Cloudflare's free tier (100K requests/day)

Moments

1st Place, JCR Sprint Closing Ceremony at INSAT, April 2025
1st Place, JCR Sprint Closing Ceremony at INSAT, April 2025

What I took away

  1. 01

    Training a real ML model (XGBoost + Random Forest ensemble) and deploying a full platform with auth in 4 hours required extreme prioritization. The key was splitting work: one person on the ML pipeline (data cleaning → training → prediction export) while the other built the serverless API and frontend in parallel.

  2. 02

    The 50/50 ensemble blend with a 0.40 threshold was a pragmatic choice, we didn't have time to optimize weights, but the ensemble still outperformed either model individually on micro-F1. Sometimes 'good enough fast' beats 'perfect never'.

  3. 03

    Cloudflare Workers + Neon is the best serverless stack for time-constrained challenges, zero configuration, instant deployment, and no cold starts.

  4. 04

    Drizzle ORM's compile-time SQL validation saved us from at least 3 runtime bugs that would have cost 30+ minutes each to debug in a 4-hour sprint.