What inspired us

Electrical safety incidents kill hundreds of workers every year. Lockout/Tagout (LOTO) procedures exist precisely to prevent accidental energisation of equipment during maintenance — but learning them correctly requires practicing on real switchgear, which is expensive, scarce, and genuinely dangerous for trainees who don't yet know what they're doing.

We work adjacent to datacenter and energy infrastructure, where the demand for LOTO-certified technicians is growing faster than training capacity. A $500k switchgear panel is not a teaching tool. We wanted to change that.

What we built

LOTO Academy is a browser-based electrical safety training platform with four core components:

  • SLD Simulator — an interactive single-line diagram where trainees operate circuit breakers, isolators, earth switches, and voltage testers in sequence
  • LOTO Rules Engine — a real-time client-side state machine that validates every action against the EN 50110 consignation sequence, giving instant pass/fail feedback
  • AI Safety Buddy — a chat coach powered by Kimi/Moonshot LLM that explains why a step was wrong, citing the relevant standard
  • Audit Dashboard — every action logged to Amazon DynamoDB with userId, timestamp, action type, result, and sequence number — exportable for OSHA/ATEX compliance audits

The correct sequence the engine enforces is:

$$\text{Open breaker} \rightarrow \text{Open isolator} \rightarrow \text{Verify voltage} \rightarrow \text{Apply earth}$$

Skipping or reordering any step triggers an immediate critical fail with an explanation — the same way a real mistake would trigger a lockout on site, without the injury.

How we built it

The stack is fully serverless:

  • Next.js 16 + React 19 on Vercel Edge for the frontend and API routes
  • Amazon DynamoDB (on-demand capacity) as the audit and certification store — chosen for its sub-millisecond write latency and zero operational overhead
  • Vercel OIDC tokens for AWS authentication — no API keys stored anywhere
  • Kimi API for the AI Safety Buddy, prompted with EN 50110 and NFPA 70E context

DynamoDB was the natural fit for audit logging. Every trainee action is a timestamped write; the access pattern is always userId + time range; and the load is completely unpredictable — a training institution might run 10 sessions a day or 500 during an onboarding sprint. On-demand billing means we pay for exactly what we use.

Challenges we faced

Getting the rules engine right. The EN 50110 consignation sequence sounds simple — four steps — but the edge cases multiply fast. What if a trainee opens the earth switch before verifying voltage? What if they skip the isolator? Each invalid transition needed a specific, instructive error message, not just "wrong." Building a state machine that covered every invalid permutation and paired it with a meaningful AI explanation took most of the first day.

OIDC authentication with AWS. Wiring Vercel's native OIDC token to an IAM role with the right trust policy and least-privilege DynamoDB permissions was fiddly. The Vercel + AWS integration documentation covers the happy path well, but debugging a malformed trust relationship with no direct error message from DynamoDB was a few hours of careful IAM policy reading.

Making failure feel educational, not punishing. The instinct in a simulator is to flash red and say "try again." But LOTO mistakes in the real world have consequences — we wanted the failure state to feel serious and instructive. Getting the AI Buddy to respond in context (referencing the specific step that failed, the standard it violates, and the correct next action) required careful prompt engineering and a few iterations of the system prompt.

What we learned

Serverless databases are genuinely underrated for compliance use cases. The instinct is to reach for PostgreSQL — structured data, relational queries, familiar. But for an audit trail where every write is independent, the access pattern is known, and scale is unpredictable, DynamoDB's model fits better. No schema migrations, no connection pooling to manage, no idle capacity to pay for.

We also learned that the best safety training tools are the ones that let you fail safely and learn immediately — which turns out to be a good design principle for software too.

Built With

Share this project:

Updates