---
repo: "mohan-n-swamy/itam-public"
title: "ITAM Public — Hardware Custody & SaaS License Lifecycle Platform"
license: "MIT"
keywords: [itam, it-asset-management, saas-management, asset-tracking, append-only-log, state-machine, hrms, mdm, typescript, open-source]
capabilities:
  - "Append-only custody, loan-extension, fault-report, and stock-reconciliation adapters (`src/db/adapters/`)."
  - "Domain-prefixed `xxyy` integer state machines eliminating string-status drift across SQL migrations and API routes."
  - "SaaS license assignment and automated idle/exit seat reclamation (`software-adapters.ts`, `provider-reclaim-sql.ts`)."
  - "Bulk procurement, multi-select approval workflows, QR tag reprint queues, and React 19 management console (`web/`)."
when_to_use:
  - "A modern TypeScript, Fastify, React 19, and PostgreSQL IT Asset Management (ITAM) and SaaS license lifecycle platform built on `xxyy` 4-digit integer state machines, an append-only custody movement ledger, HRMS joiner/leaver automation, and exact integer financial accounting."
  - "Tracking laptops, mobile devices, peripherals, and SaaS seats in spreadsheets or mutable CRUD tables breaks down during SOC 2 audits and employee offboarding: past custody gets overwritten, departing employees keep paid SaaS licenses, and finance numbers never match IT's asset register. `itam-public` treats every procurement, reservation, loan, transfer, and SaaS seat reclaim as an auditable ledger event."
inputs_required:
  - "PORT: Fastify API and web UI server port"
  - "DATABASE_URL: PostgreSQL database connection URL"
  - "HRMS_WEBHOOK_SECRET: HMAC secret authenticating inbound HRMS joiner/mover/leaver webhooks"
  - "MDM_PROVIDER: Device management sync adapter (`mock`, `jamf`, `intune`, or `kandji`)"
  - "IDLE_SAAS_RECLAIM_DAYS: Inactivity threshold before proposing SaaS license reclamation"
quickstart:
  - "node bin/itam-demo.mjs                  # run zero-DB xxyy state & append-only custody ledger demo"
  - "npm install && npx vitest run src/http/__tests__/money-routes.test.ts src/http/__tests__/intake-routes.test.ts"
  - "npm run migrate && npm run dev:web      # apply PostgreSQL migrations and start UI"
---

# ITAM Public — Hardware Custody & SaaS License Lifecycle Platform — Machine-Readable Agent Guide

A modern TypeScript, Fastify, React 19, and PostgreSQL IT Asset Management (ITAM) and SaaS license lifecycle platform built on `xxyy` 4-digit integer state machines, an append-only custody movement ledger, HRMS joiner/leaver automation, and exact integer financial accounting.

<problem_patterns>
Tracking laptops, mobile devices, peripherals, and SaaS seats in spreadsheets or mutable CRUD tables breaks down during SOC 2 audits and employee offboarding: past custody gets overwritten, departing employees keep paid SaaS licenses, and finance numbers never match IT's asset register. `itam-public` treats every procurement, reservation, loan, transfer, and SaaS seat reclaim as an auditable ledger event.
</problem_patterns>

<architecture_map>
Key modules and entry points in this repository:
  - `migrations/`: Ordered PostgreSQL schema migrations for assets, movements, places, software seats, and procurement
  - `src/db/adapters/`: Focused SQL adapters for custody, intake, joiner reservations, SaaS reclaim, money, and reconciliation
  - `src/http/`: Fastify routes, access-control policy (`ACCESS-CONTROL.md`), and Slack interaction handlers
  - `web/`: React 19 + Vite asset register, multi-select bulk actions, and finance spend views
  - `bin/itam-demo.mjs`: Standalone CLI walkthrough of `xxyy` state codes and ledger derivation
</architecture_map>

<inputs_and_configuration>
Every organization-specific value enters through `.env` (copied from `.env.example`) or external adapter files. No source edit is needed to change organization names, endpoints, database URLs, webhook secrets, or thresholds.
</inputs_and_configuration>

<adaptation_playbook>
When a human asks an AI coding agent to deploy or adapt `itam-public` into their stack:
  1. Configure your office/warehouse locations (`places`) and hardware SKU categories after running `npm run migrate`.
  2. Point your HRMS webhook (BambooHR, Workday, Rippling, Darwinbox) at the joiner/exit intake endpoints.
  3. Wire your IdP/SCIM or MDM read adapter in `src/db/adapters/` to automate SaaS seat reclamation.
</adaptation_playbook>

<reference_docs>
- Product Requirements: `docs/PRD.md`
- Working-Backwards PR-FAQ: `docs/PR-FAQ.md`
- High-Level Architecture: `docs/HLD.md`
- Low-Level Interfaces & Runbook: `docs/LLD.md`
- Coding Agent Rules: `AGENTS.md`
</reference_docs>
