All templates
Industrial

Switchyard

Every long-lead part for your data center, on time

switchyard.cloud.nexlayer.ai
Switchyard app screen

Sourcing and lead-time tracking for the electrical and cooling gear a data center can't open without. Compare supplier quotes, see what lands after its need-by date, and act before it slips.

Who uses it: Procurement and project teams building data centers, and their suppliers.

Screens

Project board

Long-lead items with supplier, lead time, need-by date and risk.

Timeline

Every item on a timeline against the construction schedule.

Quotes

Supplier quotes side by side: price, lead time, terms.

Suppliers

Suppliers with capacity, on-time history and contacts.

Alerts

Items that turned at risk or late, and why.

How it runs

Live on Nexlayer · switchyard.cloud.nexlayer.ai
Browser
your users
/↓
web
React · Vite
/api↓
api
Go · OpenAPI
postgres.pod↓
postgres
Postgres 16 · volume

Data model

  • projects
    id, name, site, capacity_mw, energize_by
  • items
    id, project_id, kind (transformer | switchgear | breaker | cooling | generator), spec, qty, need_by
  • suppliers
    id, name, region, on_time_rate
  • quotes
    id, item_id, supplier_id, unit_price_cents, lead_weeks, valid_until, terms
  • orders
    id, item_id, quote_id, placed_on, promised_on, status
  • milestones
    id, order_id, name, due, done_at

API

  • GET/api/projects/{id}/items
    Items with computed risk
  • POST/api/items
    Add a long-lead item
  • POST/api/items/{id}/quotes
    Record a quote
  • POST/api/items/{id}/order
    Place an order from a quote
  • PATCH/api/orders/{id}
    Update promised date or status
  • GET/api/projects/{id}/timeline
    Timeline data
  • GET/api/alerts
    At-risk and late items

Build it with your agent

Copy the prompt into Claude Code, Codex, Cursor or any coding agent connected to Nexlayer. It works from a spec: contracts first, then each phase with checks that must pass, then it ships to Nexlayer and verifies the live app.

Build graph · one agent, phase by phase
  1. 1Spec + contract
  2. 2API
  3. 3Web
  4. 4End-to-end test
  5. 5Ship + verify
Build Switchyard: every long-lead part for your data center, on time. A production full-stack web application, deployed live on Nexlayer.

Work spec-first. Before writing app code, write SPEC.md (from the spec below, plus your decisions), api/openapi.yaml and the first migration, and show me a short plan. Then build in phases and don't move on until each phase's checks pass.

## Product
Sourcing and lead-time tracking for the electrical and cooling gear a data center can't open without. Compare supplier quotes, see what lands after its need-by date, and act before it slips.
Users: Procurement and project teams building data centers, and their suppliers.

## Screens
- Project board: Long-lead items with supplier, lead time, need-by date and risk.
- Timeline: Every item on a timeline against the construction schedule.
- Quotes: Supplier quotes side by side: price, lead time, terms.
- Suppliers: Suppliers with capacity, on-time history and contacts.
- Alerts: Items that turned at risk or late, and why.

## Data model (Postgres)
- projects(id, name, site, capacity_mw, energize_by)
- items(id, project_id, kind (transformer | switchgear | breaker | cooling | generator), spec, qty, need_by)
- suppliers(id, name, region, on_time_rate)
- quotes(id, item_id, supplier_id, unit_price_cents, lead_weeks, valid_until, terms)
- orders(id, item_id, quote_id, placed_on, promised_on, status)
- milestones(id, order_id, name, due, done_at)

## API
- GET /api/projects/{id}/items — Items with computed risk
- POST /api/items — Add a long-lead item
- POST /api/items/{id}/quotes — Record a quote
- POST /api/items/{id}/order — Place an order from a quote
- PATCH /api/orders/{id} — Update promised date or status
- GET /api/projects/{id}/timeline — Timeline data
- GET /api/alerts — At-risk and late items

## Seed data
One 96 MW project, 24 long-lead items, 10 suppliers, 40 quotes, orders with milestones, a few deliberately late.

## Core flow (must work end to end)
Add a transformer, record two quotes, order the faster one, push its promised date past need-by, and see it turn late on the board and in alerts.

## Stack (fixed)
- web/: React 19 + TypeScript (strict) + Vite, React Router, TanStack Query, Tailwind CSS. A typed API client generated from the OpenAPI spec. Served as static files by a small web server in its own container.
- api/: Go (latest stable), net/http with Go 1.22+ routing patterns or chi, pgx v5, sqlc for queries, golang-migrate for migrations, log/slog JSON logs, OpenAPI 3.1 spec in api/openapi.yaml as the contract.
- Postgres 16, on a persistent volume.

## Engineering bar
- Contract first: api/openapi.yaml is the source of truth; the Go handlers and the web client are generated from or checked against it.
- Errors as RFC 9457 problem+json. Validate every input at the edge. Cursor pagination on every list.
- Auth: email magic link or password with argon2id; HTTP-only, SameSite session cookies; role checks in the API, never only in the UI.
- Idempotency keys on every POST that creates or submits something. Request timeouts via context. Graceful shutdown.
- GET /api/healthz (process up) and GET /api/readyz (database reachable, migrations applied).
- Migrations run on start, forward only. Seed data behind a SEED=true flag.
- Web: loading, empty and error states on every screen; keyboard accessible; no layout shift.
- Tests: Go table-driven tests, integration tests against a real Postgres (testcontainers), and one Playwright test for the core flow. Lint and typecheck clean.

## Phases
1. Contract: SPEC.md, openapi.yaml, schema and migrations, seed data. Check: migrations apply cleanly to an empty database.
2. API: every endpoint in the spec, with auth and role checks. Check: Go tests and integration tests pass.
3. Web: every screen, wired to the API through the generated client. Check: typecheck and lint pass; every screen has loading, empty and error states.
4. End to end: the Playwright test for the core flow passes locally.
5. Ship on Nexlayer (below).

## Ship it on Nexlayer
- Load the Nexlayer skill first: call nexlayer_get_skill_content with skillName "ship-it-nexlayer" and follow it.
- Dockerfiles: multi-stage, small runtime images, built for linux/amd64.
- nexlayer.yaml: three parts. web with path "/", api with path "/api", postgres with no path (private) and a volume. Set PGDATA to a subdirectory of the volume mount. The api reaches the database at postgres.pod; the browser reaches the api at <% URL %>/api. Secrets are ${NAME} references, never values.
- Deploy with `nexlayer ship --check /api/readyz` if the Nexlayer CLI is installed, otherwise through the Nexlayer MCP (validate, deploy, check status).
- Don't stop at "deployed": open the live URL, run the core flow against it, and send me the URL with what you verified.

New to Nexlayer? Connect your agent first