Skip to content

About

AI-assisted construction traffic control planning. Planners enter a job address, Claude suggests MUTCD-compliant device placement on an interactive map, plans are saved to Supabase, and a supervisor approves before field crew can act. Expo + React Native + Supabase + Anthropic.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

TrafficPlanApp

AI-assisted construction traffic control planning. Planners enter a job address, Claude suggests MUTCD-compliant device placement on an interactive map, plans are saved to Supabase, and a supervisor approves before field crew can act.


How it works

  1. Planner enters the work zone address and selects road type and speed limit.
  2. Planner draws the work zone on the map and (optionally) traces road restrictions.
  3. Claude reads the address, road type, work zone polyline, and notes, then returns devices as offsets (along_m, lateral_m) which the server projects into exact GPS positions along the polyline using haversine geometry.
  4. Planner fine-tunes positions by dragging markers.
  5. Plan saves as a Draft. A supervisor must approve before field crew can view it — every AI plan carries a "Requires Licensed Supervisor Approval" disclaimer.

Tech Stack

Layer Technology
Framework Expo SDK 54 / React Native 0.81.5
Routing Expo Router v6 (server output for API routes)
Map Mapbox GL JS v3 (web)
Database Supabase (PostgreSQL + RLS + Realtime)
AI Claude claude-sonnet-4-6 via @anthropic-ai/sdk

Running it locally

1. Environment variables

Create .env.local in the project root (see .env.example):

EXPO_PUBLIC_MAPBOX_ACCESS_TOKEN=pk.xxx...
EXPO_PUBLIC_SUPABASE_URL=https://xxx.supabase.co
EXPO_PUBLIC_SUPABASE_ANON_KEY=sb_publishable_xxx...
ANTHROPIC_API_KEY=sk-ant-api03-xxx...

EXPO_PUBLIC_ vars are exposed to the browser. ANTHROPIC_API_KEY is server-side only and never sent to the client.

No Anthropic key? The AI falls back to a mock device layout so you can still test the UI.

2. Supabase schema

Run supabase/schema.sql in Supabase Dashboard → SQL Editor to create the tables, RLS policies, updated_at trigger, and realtime publication.

3. Install and run

npm install
npm run web

Opens at http://localhost:8081.


Screens

Screen Path Description
Plans list /(tabs) All plans with Draft/Approved badges, realtime sync
New plan /plan/new Address → draw work zone → AI → save
Plan detail /plan/[id] View/drag devices, approve plan
Team /(tabs)/explore Team members list

About

AI-assisted construction traffic control planning. Planners enter a job address, Claude suggests MUTCD-compliant device placement on an interactive map, plans are saved to Supabase, and a supervisor approves before field crew can act. Expo + React Native + Supabase + Anthropic.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages