Instructor cheat sheet
Full-Stack AI-Assisted Development
Eight build cycles · one architecture · one shipped container. Deck ↔ editor, ten times. Architecture diagram is the spine.
- Install prompt (paste verbatim): “I need to set up a development environment on [Windows / Mac]. Install Go 1.22+, Node.js 20 LTS, Git, VS Code, and Docker Desktop. Step-by-step for my OS, including verify. After install I should run
go version,node --version,npm --version,git --versionand see numbers for all four.” - Scaffold in terminal:
mkdir my-staff-app && cd my-staff-app→go mod init my-staff-app→mkdir -p cmd/server internal data→npm create vite@latest web -- --template react-ts.
- Prompt 1: single-file Go server in
cmd/server/main.go, port 8080,-portand-devflags,/api/v1/healthreturning{"status":"ok"}. - Prompt 2: extract
SetupRouterintointernal/api/router.gowithwriteJSON/writeErrorhelpers. - Prompt 3: add hardcoded
/api/v1/itemswith five military-flavored items. - Verify after each:
go run ./cmd/server -dev→ hit endpoint in browser. Paste any error back — do not hand-debug.
- Prompt 1: define a
DataStoreGo interface and anItemstruct ininternal/data/store.go(list, get, create, update). Plus aJSONStoreimplementation readingdata/items.json. - Prompt 2: generate 20 realistic, military-flavored seed items into
data/items.json. - Prompt 3: rewire
main.goto load the store and serve from it; add/api/v1/items/{id}. - Verify:
curl /api/v1/itemsand/api/v1/items/3.
- Prompt 1: add Tailwind CSS to the existing Vite + React + TS app in
web/; configure PostCSS. - Prompt 2: set up a Vite dev proxy in
web/vite.config.tsthat forwards/apitohttp://localhost:8080. - Prompt 3: write a small API client and render the items table at
localhost:5173. - Two terminals: backend in one,
npm run devin the other. CORS error → fix is the proxy, not middleware.
- Prompt 1: add
react-router-domwith a Layout, Dashboard, Items, Settings; dark sidebar (navy#1a1f36) with active-link highlighting. - Prompt 2: item detail page at
/items/:id; make titles in the items table click through. - Prompt 3: dashboard with stat cards, recent items, quick actions — using API data, Tailwind defaults.
- Pre-flight: confirm
OPENAI_API_KEYis set in every shell. - Prompt 1: chat service in
internal/ai/chat.goagainstgpt-4o; exposePOST /api/v1/chat. - Prompt 2: register a
lookup_itemstool with status / priority / query params; call intoDataStore. - Prompt 3:
ChatPage.tsxwith markdown rendering and loading states. - Land it: ask “what are my high-priority items?” — show the tool call in the server log.
- Prompt 1: middleware package — CORS, security headers, auth, chain helper.
- Prompt 2:
/auth/me+/auth/switchendpoints; role picker dropdown in the header (Admin / Staff / User) with a role cookie. - Prompt 3: role-based filtering across existing handlers (Admin sees all, User sees only their items); conditional sidebar.
- Demo: dev tools → cookies → show role; switch role → data changes.
- Path A — default (no Azure needed): add a SQLite-backed
DataStoreimplementation usingmodernc.org/sqlite(pure Go); auto-create tables; parameterized queries;-dbflag toggles JSON vs SQLite. - Path B — Azure AD shop: Microsoft Graph client (OAuth2 client-credentials, token cache, commercial & GCC High); add
/calendar/todayand/mail/summary. - Verify (A): restart with
-db sqlite, add an item, restart again, confirm it persists; flip back to-db json.
- Prompt 1: generate a multi-stage
Dockerfile— web-builder (Node), go-builder (Go), runtime (Alpine). Go server serves the React build in production. SPA fallback for non-API routes. Include a.dockerignore. - Build:
docker build -t my-staff-app . - Run:
docker run -p 8080:8080 -e OPENAI_API_KEY=… my-staff-app→ openlocalhost:8080. - Optional: push to ACR; deploy to Azure Container Apps for a public URL.