1 What We Built Today
In a single session we built and deployed a complete recruitment intelligence platform spanning three systems, five AI agents, and six HTML guides — from zero to running on Cloudflare's global edge.
Huly ATS
Open-source ATS running locally on Docker/OrbStack with 11 staff, 10 clients, 15 vacancies, 30 candidates across 9 pipeline stages.
Cloudflare Portal
Workers app with A.G.I.L.E. agents, Edge AI (Llama 3.1 8B), D1 database, simulated M365, and interactive demo UI.
Documentation
6 HTML guides covering architecture, training, setup, sales demo, DNS deployment, and this master guide.
By the Numbers
| Metric | Count |
|---|---|
| TypeScript source files | 8 files, 1,095 lines |
| HTML portal + guides | 8 files, ~3,500 lines |
| Shell scripts (Huly setup) | 4 files |
| SQL schemas | 2 (CockroachDB + D1) |
| Markdown architecture doc | 1 file, 450+ lines |
| Git commits | 4 (2nth-ai/agilex-portal) |
| Cloudflare services deployed | Worker + D1 + KV + Pages |
| Docker containers running | 14 (Huly stack) |
| Huly staff accounts | 11 (joined to workspace) |
| Huly candidate records | 30 across 9 pipeline stages |
| D1 candidate records | 15 + seeded demo data |
2 Architecture
API + UI
BGE embeddings
Agent logs
Sessions
pages.dev
Minimal metadata
OneDrive links
ATS = Metadata Only
Huly stores names, stages, skills, and OneDrive URLs. Documents live in M365 — never duplicated in the ATS.
M365 = Source of Truth
Every CV, offer, reference, and contract is stored in OneDrive/SharePoint. Version history, compliance, and access control by Microsoft.
3 Running Everything Locally
Prerequisites
# macOS
brew install orbstack node git
npm install -g wrangler
wrangler login
A. Start Huly ATS (Docker)
cd /Users/craig/Projects/AgileX/huly-selfhost
# Quick setup — localhost:8087, no prompts
./setup.sh --quick
# Wait ~60 seconds for all 14 services
docker compose ps
# Open Huly
open http://localhost:8087
Admin login: admin@agilex.co.za / AgileX2024! — All staff: firstname.lastname@agilex.co.za / AgileX2024!
B. Start AgileX Portal (Cloudflare Worker — local dev)
cd /Users/craig/Projects/AgileX/agilex-portal
npm install
npm run db:init # create local D1 tables
npm run dev # start on localhost:8788
# Seed demo data
curl -X POST http://localhost:8788/api/seed
# Open portal
open http://localhost:8788
Note: Workers AI (Edge inference) only works when deployed to Cloudflare. Locally, agents use fallback demo responses.
C. Open Guides (no server needed)
# All guides open directly from file
open /Users/craig/Projects/AgileX/huly-selfhost/demo/index.html # Sales demo
open /Users/craig/Projects/AgileX/huly-selfhost/demo/architecture.html # Architecture
open /Users/craig/Projects/AgileX/huly-selfhost/demo/setup.html # Portal setup
open /Users/craig/Projects/AgileX/huly-selfhost/demo/dns-guide.html # DNS & status
open /Users/craig/Projects/AgileX/huly-selfhost/demo/deployment-guide.html # This guide
open /Users/craig/Projects/AgileX/huly-selfhost/guide.html # Huly setup
open /Users/craig/Projects/AgileX/huly-selfhost/training-guide.html # ATS training
4 Deployment Timeline
Day 0 — Today Complete
Local development environment fully operational.
- Huly ATS running on Docker/OrbStack (14 containers)
- 11 staff accounts created and joined to workspace
- 10 SA enterprise clients (5 banking, 5 retail)
- 15 vacancies across AI, DevOps, Banking, Retail, Graduates
- 30 candidates across 9 pipeline stages in CockroachDB
- AgileX portal deployed to Cloudflare Worker + D1 + KV
- 5 A.G.I.L.E. agents with working API endpoints
- Edge AI tested — Llama 3.1 8B parsed CV on Cloudflare edge
- Simulated M365 endpoints (OneDrive, SharePoint, Teams, Entra)
- Static pages deployed to agilex-app.pages.dev
- Code pushed to github.com/2nth-ai/agilex-portal
- 7 HTML guides + 1 markdown architecture doc
Week 1 — Infrastructure Next
Move Huly to Hetzner, connect via Cloudflare Tunnel, add DNS and email.
- Add DNS:
AAAA agilex 100::on 2nth.ai zone → activates full portal - Provision Hetzner CPX31 (4 vCPU, 8GB, 160GB — ~R280/mo)
- Deploy Huly Docker stack to VPS
- Configure Cloudflare Tunnel →
huly.agilex.co.za - Configure Resend SMTP + DNS (SPF/DKIM/DMARC)
- Disable public signup, seed production data
- Update Worker
HULY_URLtohttps://huly.agilex.co.za
Week 2 — Intelligence Planned
Add AI Gateway for multi-model routing, Vectorize for semantic search.
- Create Cloudflare AI Gateway (
agilex-recruitment) - Add Claude, GPT-4o, Gemini as fallback models via Gateway
- Create Vectorize index for candidate embeddings
- Connect Acquire agent to Huly transactor via WebSocket
- Implement RAG pipeline: CV → embedding → Vectorize → match
- Deploy portal to
app.agilex.co.za
Week 3 — Microsoft 365 Planned
Replace simulated M365 with real Entra ID, Graph API, OneDrive, SharePoint, Teams.
- Register app in Microsoft Entra ID
- Create SharePoint site + document libraries + content types
- Create Teams team + per-client channels
- Create OneDrive shared folder structure via Graph API
- Swap simulated
/api/m365/*for real Graph API calls - Test document flow: agent → OneDrive → link in Huly ATS
Week 4 — Full Integration Planned
Complete all agents, end-to-end testing, client demo readiness.
- Implement Integrate agent → Google/Outlook Calendar
- Implement Leverage agent → auto-generated SharePoint reports
- Implement Engage agent → real Resend email + Teams posting
- Feedback loop: consultant overrides → prompt refinement
- End-to-end test with real candidate submission
- Client demo readiness review
5 File Map — Everything We Built
AgileX Portal (Cloudflare Worker)
/Users/craig/Projects/AgileX/agilex-portal/ — github.com/2nth-ai/agilex-portal
| File | Lines | Purpose |
|---|---|---|
src/index.ts | 97 | Worker entry: router, CORS, types |
src/agents/router.ts | 378 | All 5 A.G.I.L.E. agents with Edge AI |
src/api/candidates.ts | 52 | Candidate CRUD endpoints |
src/api/ai.ts | 88 | Edge AI inference + embeddings |
src/api/activity.ts | 14 | Agent activity feed |
src/api/huly.ts | 74 | Huly ATS bridge + integration map |
src/api/seed.ts | 94 | Demo data seeder |
src/sim/m365.ts | 212 | Simulated Microsoft Graph API |
schema.sql | 86 | D1 schema (6 tables) |
public/index.html | 430 | Interactive portal UI |
public/setup.html | ~500 | Architecture explainer & setup |
public/dns-guide.html | ~400 | DNS & deployment status |
wrangler.toml | 30 | Cloudflare config: AI, D1, KV, route |
Huly Self-Hosted (Docker)
/Users/craig/Projects/AgileX/huly-selfhost/
| File | Purpose |
|---|---|
compose.yml | Docker Compose stack (14 services) |
huly_v7.conf | Generated config (secrets, DB URL, host) |
setup-recruitment.sh | Create 10 staff accounts |
join-staff.sh | Invite & join staff to workspace |
seed-recruitment.mjs | Generate SQL for clients, vacancies, candidates |
guide.html | Huly setup guide |
training-guide.html | ATS training guide (roles, pipeline, features) |
DEPLOYMENT-ARCHITECTURE.md | Full architecture document (450+ lines) |
Demo Guides (static HTML — no server needed)
/Users/craig/Projects/AgileX/huly-selfhost/demo/
Sales Demo Portal
Interactive A.G.I.L.E. agent demo with animated chat, role dashboards, pipeline board
demo/index.htmlArchitecture Guide
Visual 5-layer architecture, AI Gateway model routing, M365 structure, cost estimate
demo/architecture.htmlPortal Setup Guide
12-section explainer: agents, stack, project structure, API reference, Edge AI
demo/setup.htmlDNS & Deployment Status
Live status dashboard, DNS setup steps with Cloudflare form mock, test sequence
demo/dns-guide.htmlThis Guide
Master deployment guide — everything built, file map, URLs, 4-week timeline
demo/deployment-guide.htmlHuly Setup Guide
Docker setup, account creation, staff onboarding, seed data, login reference
huly-selfhost/guide.htmlATS Training Guide
User roles, staff workflows, candidate data model, pipeline stages, daily guides
huly-selfhost/training-guide.html6 All URLs
| Resource | URL | Status |
|---|---|---|
| Portal (static) | agilex-app.pages.dev | Live |
| Setup guide | agilex-app.pages.dev/setup.html | Live |
| DNS guide | agilex-app.pages.dev/dns-guide.html | Live |
| Full portal + API | agilex-app.pages.dev | DNS needed |
| Git repo | github.com/2nth-ai/agilex-portal | Private |
| Local Huly | localhost:8087 | If running |
| Local portal | localhost:8788 | npm run dev |
One DNS Record Activates the Full Stack
Cloudflare Dashboard → 2nth.ai zone → DNS → Add Record:
| Type | Name | Content | Proxy |
|---|---|---|---|
AAAA | agilex | 100:: | Proxied (orange cloud) |
7 Cost Summary
| Component | Monthly Cost (ZAR) | Tier |
|---|---|---|
| Cloudflare (Workers, D1, KV, Pages, AI Gateway, DNS, CDN) | R0 | Free |
| Workers AI (CV parsing, scoring, embeddings) | ~R90 – R360 | Usage |
| Claude API via AI Gateway (scoring, drafting, reports) | ~R360 – R900 | Usage |
| Hetzner CPX31 (Huly Docker host) | ~R280 | Paid |
| Resend (transactional email, 100/day) | R0 | Free |
| Microsoft 365 Business Basic (per user) | ~R110/user | If needed |
| Total (excl. M365 licenses) | R730 – R1,540 |