AgileX A.G.I.L.E. — Complete Deployment Guide

Everything built, what's running where, and how to take it to production

Huly ATS Cloudflare Workers Workers AI D1 KV Microsoft 365 Hetzner Resend 2nth.ai

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

MetricCount
TypeScript source files8 files, 1,095 lines
HTML portal + guides8 files, ~3,500 lines
Shell scripts (Huly setup)4 files
SQL schemas2 (CockroachDB + D1)
Markdown architecture doc1 file, 450+ lines
Git commits4 (2nth-ai/agilex-portal)
Cloudflare services deployedWorker + D1 + KV + Pages
Docker containers running14 (Huly stack)
Huly staff accounts11 (joined to workspace)
Huly candidate records30 across 9 pipeline stages
D1 candidate records15 + seeded demo data

2 Architecture

CF Cloudflare Edge — Portal, Agents, AI, State
Workeragilex-portal
API + UI
Workers AILlama 3.1 8B
BGE embeddings
D1Candidates
Agent logs
KVCache
Sessions
PagesStatic guides
pages.dev
AG A.G.I.L.E. Agents
A AcquireCV parse, source
G GaugeScore, advance
I IntegrateSchedule, sync
L LeverageReports, stats
E EngageNotify, nurture
Cloudflare Tunnel (outbound only)
HZ Huly ATS — Docker on Hetzner VPS or Local Mac
Huly14 services
Minimal metadata
CockroachDBPipeline data
OneDrive links
ElasticsearchFull-text search
ResendSMTP email
Microsoft Graph API (OAuth 2.0)
MS Microsoft 365 — Golden Source of Records (simulated in demo)
OneDriveCVs, offers, refs
SharePointLibraries, search
TeamsChannels, bots
Entra IDSSO, directory

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
1

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_URL to https://huly.agilex.co.za
2

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
3

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
4

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

FileLinesPurpose
src/index.ts97Worker entry: router, CORS, types
src/agents/router.ts378All 5 A.G.I.L.E. agents with Edge AI
src/api/candidates.ts52Candidate CRUD endpoints
src/api/ai.ts88Edge AI inference + embeddings
src/api/activity.ts14Agent activity feed
src/api/huly.ts74Huly ATS bridge + integration map
src/api/seed.ts94Demo data seeder
src/sim/m365.ts212Simulated Microsoft Graph API
schema.sql86D1 schema (6 tables)
public/index.html430Interactive portal UI
public/setup.html~500Architecture explainer & setup
public/dns-guide.html~400DNS & deployment status
wrangler.toml30Cloudflare config: AI, D1, KV, route

Huly Self-Hosted (Docker)

/Users/craig/Projects/AgileX/huly-selfhost/

FilePurpose
compose.ymlDocker Compose stack (14 services)
huly_v7.confGenerated config (secrets, DB URL, host)
setup-recruitment.shCreate 10 staff accounts
join-staff.shInvite & join staff to workspace
seed-recruitment.mjsGenerate SQL for clients, vacancies, candidates
guide.htmlHuly setup guide
training-guide.htmlATS training guide (roles, pipeline, features)
DEPLOYMENT-ARCHITECTURE.mdFull architecture document (450+ lines)

Demo Guides (static HTML — no server needed)

/Users/craig/Projects/AgileX/huly-selfhost/demo/

6 All URLs

ResourceURLStatus
Portal (static)agilex-app.pages.devLive
Setup guideagilex-app.pages.dev/setup.htmlLive
DNS guideagilex-app.pages.dev/dns-guide.htmlLive
Full portal + APIagilex-app.pages.devDNS needed
Git repogithub.com/2nth-ai/agilex-portalPrivate
Local Hulylocalhost:8087If running
Local portallocalhost:8788npm run dev

One DNS Record Activates the Full Stack

Cloudflare Dashboard → 2nth.ai zone → DNS → Add Record:

TypeNameContentProxy
AAAAagilex100::Proxied (orange cloud)

7 Cost Summary

ComponentMonthly Cost (ZAR)Tier
Cloudflare (Workers, D1, KV, Pages, AI Gateway, DNS, CDN)R0Free
Workers AI (CV parsing, scoring, embeddings)~R90 – R360Usage
Claude API via AI Gateway (scoring, drafting, reports)~R360 – R900Usage
Hetzner CPX31 (Huly Docker host)~R280Paid
Resend (transactional email, 100/day)R0Free
Microsoft 365 Business Basic (per user)~R110/userIf needed
Total (excl. M365 licenses)R730 – R1,540