CaseFlow
Caseworker Decision Support Tool — Built for DSIT AI Engineering Lab Hackathon, Challenge 3: Supporting Casework Decisions.
What it does
CaseFlow helps government caseworkers make faster, better-informed decisions by surfacing the right information at the right moment. It supports three user types named in the challenge brief:
Demo guide
Start here: Visit the landing page and select a role to explore the system.
- Role selector (
/) — Choose “Caseworker”, “Team leader”, or “Applicant” to switch views instantly - Caseworker view (
/cases) — Browse cases, create new cases, review evidence, take workflow actions - Case detail — Click any case to see SLA countdown (deadline urgency at a glance), related cases, timeline filtering, evidence tracker, AI summary, and workflow actions
- Team leader view (
/dashboard) — Monitor team performance, analytics charts, escalated cases, reassign workload - Applicant view (
/status-check) — Enter a reference number (e.g. REF-77291) to check case status - Use “Switch role” in the header to jump between views at any time
For caseworkers
- Case list dashboard — 60 cases at a glance with colour-coded status indicators, deadline alerts, filtering by status/type/team, free-text search, and sortable columns
- Create new case — GOV.UK form with full validation to create cases (case type, applicant details, team assignment)
- Case detail view — Structured timeline, applicant details, case notes, current workflow state, applicable policies, SLA countdown, and related cases
- Interactive workflow actions — Transition cases between states, mark evidence received, add notes, and request evidence directly from the case view
- Policy matching — Automatically surfaces relevant policies based on case type with key thresholds highlighted
- Workflow state visualisation — Shows where a case sits in the state machine, required actions, and allowed transitions
- Evidence tracker — Checklist-style panel showing which evidence items are received, outstanding, or overdue for each case, cross-referencing policy requirements against the case timeline
- Deadline alerts — Calculates and flags overdue evidence based on policy thresholds (28-day reminder, 56-day escalation)
- SLA countdown — Visual progress bar showing case age against 28-day reminder and 56-day escalation thresholds (green → amber → red), with GOV.UK warning text for overdue cases
- Related cases — Automatically surfaces up to 5 related cases by applicant, case type + team, or cross-references in case notes, helping caseworkers spot patterns
- Timeline filtering — Filter timeline events by category: All events, Key decisions, Evidence, or Notes, with event counts
- AI case summarisation — Returns realistic summaries with key facts, recommended actions, and risk level (mocked endpoint, designed for easy replacement with a real LLM)
- Batch actions — Select multiple cases for bulk reassignment or CSV export
- Keyboard shortcuts — Power-user navigation with keyboard shortcuts (press
?to view)
For team leaders
- Team leader dashboard — Caseload overview across teams, escalated cases, risk/overdue summary, capacity indicators, status and type breakdowns
- Analytics charts — CSS bar charts showing cases by status, type, age distribution, and weekly trends
- Case reassignment — Reassign escalated cases to a different team directly from the dashboard using a GOV.UK select dropdown
- CSV export — Download all cases as a CSV file with case ID, applicant, type, status, team, dates, priority, days open, and alert counts
- Recent activity feed — Live timeline of the 20 most recent events across all cases, linking directly to the relevant case
For applicants
- Status check page — Applicants enter their reference number to see: current case status, what it means in plain English, last update date, next expected action, and estimated timeline
Tech stack
| Layer | Technology |
|---|---|
| Frontend | React 18 + GOV.UK Design System (govuk-frontend 5.x) |
| Backend | Node.js / Express 4.x + Helmet (security headers) |
| Data | 60 synthetic cases, 10 policy extracts, 3 workflow type definitions (JSON) |
| Architecture | npm workspaces monorepo |
| Styling | GOV.UK Design System CSS — header, footer, tables, tags, summary lists, panels, form elements |
| Accessibility | WCAG 2.2 patterns: skip links, ARIA labels, keyboard navigation, semantic HTML |
| Responsive | CSS media queries for tablet (768px) and mobile (320px) |
Quick start
npm install
npm run devThis starts both the backend (port 3001) and frontend dev server (port 3000) concurrently.
To use a custom backend port, set CASEFLOW_PORT (takes precedence over PORT):
CASEFLOW_PORT=4000 npm run devRun individually
npm run backend # Express API on :3001
npm run frontend # React dev server on :3000Production build
npm run build # Builds React frontend into packages/frontend/build
npm start # Serves both API and static frontend from Express on :3001Project structure
caseflow/
├── package.json # Root workspace config
├── packages/
│ ├── backend/
│ │ ├── package.json
│ │ └── src/
│ │ ├── server.js # Express entry point
│ │ ├── data/
│ │ │ ├── cases.json # 60 synthetic cases
│ │ │ ├── policy-extracts.json # 10 government policies
│ │ │ └── workflow-states.json # State machines for 3 case types
│ │ └── routes/
│ │ ├── cases.js # Case CRUD with deadline alerts
│ │ ├── policies.js # Policy lookup
│ │ ├── workflow.js # Workflow state definitions
│ │ ├── ai.js # Mocked AI summarisation
│ │ ├── dashboard.js # Team leader statistics
│ │ ├── status-check.js # Applicant status lookup
│ │ ├── actions.js # Interactive workflow actions
│ │ ├── evidence.js # Evidence tracker endpoint
│ │ ├── export.js # CSV export endpoint
│ │ ├── activity.js # Activity feed endpoint
│ │ ├── reassign.js # Case reassignment endpoint
│ │ ├── search.js # Full-text case search
│ │ ├── notes.js # Case notes editor
│ │ ├── analytics.js # Analytics endpoint
│ │ └── batch.js # Batch operations
│ └── frontend/
│ ├── package.json
│ ├── public/
│ │ └── govuk/ # GOV.UK Design System assets
│ └── src/
│ ├── App.js # Router + role-aware GOV.UK layout
│ ├── pages/
│ │ ├── RoleSelector.js # Landing page with role cards
│ │ ├── CaseList.js # Main case dashboard
│ │ ├── CreateCase.js # New case form
│ │ ├── CaseDetail.js # Individual case view
│ │ ├── CaseCompare.js # Side-by-side case comparison
│ │ ├── Dashboard.js # Team leader overview + analytics
│ │ ├── StatusCheck.js # Applicant status check
│ │ ├── Accessibility.js # Accessibility statement
│ │ ├── Cookies.js # Cookie policy
│ │ ├── Feedback.js # User feedback form
│ │ └── NotFound.js # GOV.UK 404 page
│ └── components/
│ ├── StatusTag.js
│ ├── AlertBadge.js
│ ├── CaseTypeLabel.js
│ ├── Timeline.js
│ ├── WorkflowVisualisation.js
│ ├── PolicyPanel.js
│ ├── AISummary.js
│ ├── WorkflowActions.js
│ ├── EvidenceTracker.js
│ ├── SlaCountdown.js
│ ├── RelatedCases.js
│ ├── ErrorBoundary.js
│ └── KeyboardShortcuts.js
API endpoints
| Endpoint | Method | Description |
|---|---|---|
/api/cases | GET | List all cases (filters: ?status=, ?case_type=, ?assigned_to=, ?search=, ?sort=, ?order=) |
/api/cases | POST | Create a new case ({ case_type, applicant_name, reference, date_of_birth, notes, assigned_to }) |
/api/cases/:id | GET | Get case with matching policies, workflow info, and deadline alerts |
/api/cases/:id/available-actions | GET | Get valid transitions and quick actions for current case state |
/api/cases/:id/actions | POST | Perform a workflow action (transition state, add note, mark evidence received) |
/api/cases/:id/actions | GET | Get action history for a case |
/api/policies | GET | List policies (filter: ?case_type=) |
/api/policies/:id | GET | Get single policy |
/api/workflow | GET | Get all workflow definitions |
/api/workflow/:caseType | GET | Get workflow for a specific case type |
/api/dashboard | GET | Team leader overview (totals, status/type/team breakdowns, overdue counts) |
/api/status-check/:reference | GET | Applicant status lookup by reference number |
/api/ai/summarise/:caseId | POST/GET | Mocked AI case summarisation with key facts and recommended actions |
/api/cases/:id/evidence | GET | Evidence tracker — required items with received/outstanding/overdue status |
/api/cases/:id/reassign | POST | Reassign a case to a different team ({ assigned_to: "team_b" }) |
/api/cases/search | GET | Full-text search across all case fields (?q=term) with ranked results and match context |
/api/cases/:id/notes | POST | Add a case note to the timeline ({ note: "text" }) |
/api/cases/export/csv | GET | Download all cases as CSV |
/api/cases/batch/reassign | POST | Batch reassign cases ({ caseIds: [...], assigned_to: "team_b" }) |
/api/activity | GET | Recent activity feed across all cases (default: last 20 events) |
/api/analytics | GET | Analytics data (status/type/age breakdowns, weekly trends) |
/api/cases/:id/related | GET | Find related cases (by applicant, type+team, cross-references in notes) |
/api/health | GET | Health check with version, features, uptime, and case count |
User journeys
1. Select a role (start here)
Landing page → choose Caseworker, Team leader, or Applicant → redirected to the appropriate view
2. Caseworker reviews their caseload
Cases → filter by team/status → click case → view timeline, policies, alerts → use action buttons to transition state or add notes
3. Caseworker creates a new case
Cases → “Create case” → fill in GOV.UK form → submit → redirected to new case detail
4. Team leader monitors risk
Dashboard → see overdue/at-risk counts → review analytics charts → review escalated cases → reassign workload
5. Applicant checks their case
Check your status → enter reference number (e.g. REF-77291) → see status, what it means, next steps, and estimated timeline
What is mocked vs. what would be real
| Feature | Current (demo) | Production |
|---|---|---|
| Case data | 60 synthetic JSON cases loaded at startup | Database (PostgreSQL) with real case records |
| AI summarisation | Pre-written summaries returned from a map | LLM API call (e.g. Claude) with case context |
| Workflow actions | In-memory state changes (reset on restart) | Persisted to database with audit trail |
| Case creation | In-memory (reset on restart) | Database insert with validation and audit |
| Case reassignment | In-memory team change (reset on restart) | Database update with audit log and notifications |
| Authentication | Role selector (sessionStorage) | GOV.UK One Login / internal SSO |
| Applicant status check | Direct JSON lookup | Authenticated portal with rate limiting |
| Policy matching | JSON filter by case type | Policy engine with version control |
Design decisions
- GOV.UK Design System throughout — follows established government design patterns for familiarity, consistency, and accessibility
- Role selector — One-click demo experience for judges to switch between all three user types
- Mocked AI — The summarisation endpoint returns realistic pre-written summaries, architected so a real LLM can replace it by changing one function. Summaries include key facts, recommended actions, and risk level
- Deadline calculation — Uses policy thresholds from the workflow state machine, not hardcoded values. Handles partial evidence receipt, reminder, and escalation thresholds
- Interactive actions — In-memory workflow transitions demonstrate the tool’s interactivity without needing a database
- Three user types — Caseworker dashboard, team leader overview, and applicant status check cover all three users named in the brief
- Responsive design — CSS media queries for tablet (768px) and mobile (320px) layouts
- Loading states — GOV.UK-styled spinners for perceived performance during data fetches
- Security headers — Helmet middleware adds Content-Security-Policy, X-Frame-Options, X-Content-Type-Options, and other production security headers out of the box
- Error handling — GOV.UK-styled 404 page with catch-all route and ErrorBoundary for graceful failure recovery
- Accessibility — WCAG 2.2 patterns: skip links, ARIA labels, keyboard navigation, semantic HTML, colour not used as sole indicator
What we’d do next
- Real AI integration — Replace mocked summaries with Claude API calls, using case timeline + notes + policies as context for truly intelligent case analysis
- Persistent state — PostgreSQL database for cases, actions, audit trail, and user sessions
- Authentication & authorisation — GOV.UK One Login for applicants, internal SSO for caseworkers, role-based access control
- Notification system — Email/SMS alerts for approaching deadlines, case status changes, and applicant updates
- Document upload — Allow applicants to upload evidence directly through the status check portal
- Enhanced analytics — Processing time trends, bottleneck identification, and deeper evidence tracking metrics
- Bulk operations — Expand batch actions with bulk-approve decisions and team capacity planning
- API versioning — RESTful API with versioning for integration with other government systems
- Automated policy updates — When policies change, automatically flag affected open cases for re-review
How we built this — fully autonomous AI development
CaseFlow was built entirely by an autonomous AI agent team, with no human writing any code. This is our strongest differentiator for the “how you used AI tools” question.
The team
| Role | Agent | Responsibility |
|---|---|---|
| CEO | Strategic AI agent | Sets priorities, reviews output, creates iteration briefs, manages sprint planning |
| CTO | Implementation AI agent | Reads briefs, implements features, writes tests, commits code, reports progress |
Both agents are powered by Claude (Anthropic) and coordinated through Paperclip, an AI agent orchestration platform. The human’s role was limited to reviewing pull requests — no code was written manually.
Iteration timeline
| Version | What shipped | Commits |
|---|---|---|
| v1 | Monorepo scaffold, Express API, React frontend, 10 seed cases | 2 |
| v2 | 50 additional synthetic cases, filtering, sorting, policy matching | 3 |
| v3 | AI summarisation, workflow state visualisation, deadline alerts | 3 |
| v4 | Interactive workflow actions, applicant status check, team leader dashboard | 3 |
| v5 | Evidence tracker, activity feed, CSV export, case reassignment | 3 |
| v6 | GOV.UK service standard pages, security headers, 404 page, 30 automated tests | 4 |
| v7 | Cross-case search, case notes editor, case comparison view | 6 |
| v8 | Analytics dashboard, batch actions, keyboard shortcuts, error boundary | 5 |
| v9 | Role selector, case creation, responsive design, loading states | 5 |
| v10 | SLA countdown, related cases, timeline filtering, enhanced health endpoint, integration tests | 4 |
| v11 | Final quality pass — build fix, global error handler, edge case handling, accessibility fixes | 3 |
Total: 11 iterations, 42 commits, 56 tests, fully autonomous.
How the AI workflow works
- CEO agent reads the competition brief, identifies the highest-impact features to build next, and writes a structured implementation ticket with clear requirements and constraints
- CTO agent picks up the ticket, explores the codebase, implements each feature in order, commits after each improvement, and runs all tests
- CEO agent reviews the output, identifies gaps, and creates the next iteration ticket
- Repeat until the product is competition-ready
What this demonstrates
- AI agents can plan, implement, test, and iterate on a real product autonomously
- The CEO/CTO split shows AI can handle both strategic thinking (what to build, in what order) and technical execution (writing code, testing, debugging)
- 11 iteration cycles show the agents can build incrementally — each version extends the last without breaking existing functionality
- The autonomous workflow is reproducible — the same agent team could build another product from a different brief
License
MIT