Prompt file imported from jonathan-vella/hack-ops (
.github/prompts/app-01-scaffold.prompt.md). Copyright stays with the author.
Scaffold HackOps Monorepo
Set up the Turborepo + Next.js 15 monorepo, shared type packages, local SQL Server (Docker) config, and dev environment.
Mission
Create the entire project scaffold so that npm run build
succeeds, the dev server starts, and the health endpoint
returns { status: "ok" }. This prompt does NOT implement
business logic — only project structure and plumbing.
Scope & Preconditions
- Plan reference:
.github/prompts/plan-hackOps.prompt.md— readPhase 1: Monorepo Scaffold & Dev Environment - Data model:
docs/data-model.md— 10 table interfaces to create inpackages/shared/types/ - API contract:
packages/shared/types/api-contract.ts— already exists; do NOT overwrite - Env config:
docs/environment-config.md— variable reference for.env.example - Skills: Read
nextjs-patterns,zod-validation, andhackops-domainskills before starting
Workflow
Step 1 — Read context
Read these files (in order):
.github/prompts/plan-hackOps.prompt.md— Phase 1 sectiondocs/data-model.md— all 10 table schemasdocs/environment-config.md— env var referencepackages/shared/types/api-contract.ts— existing types.github/skills/nextjs-patterns/SKILL.md
Step 2 — Create monorepo structure
- Initialize Turborepo at project root with
turbo.jsondefining pipelines:build,lint,type-check,test - Create
apps/web/with Next.js 15 (App Router), TypeScript, Tailwind CSS 4, ESLint - Create
packages/shared/withpackage.json(@hackops/shared) exporting types fromtypes/ - Configure workspace references so
apps/webcan import from@hackops/shared
Step 3 — Install dependencies
In apps/web/:
mssql,@azure/identity— SQL Database client + authzod— runtime validationnext-themes— dark mode support- Dev:
vitest,@testing-library/react,@types/node
Install and configure shadcn/ui — init + base components:
Button, Card, Table, Badge, Dialog, Input,
Select, Tabs, DropdownMenu, Sheet
Step 4 — Create shared types
In packages/shared/types/, create one file per table
matching docs/data-model.md interfaces:
hackathon.ts,team.ts,hacker.ts,score.ts,submission.ts,rubric.ts,config.ts,role.ts,challenge.ts,progression.tsindex.ts— re-exports all interfaces
Do NOT duplicate types already in api-contract.ts. Import
and re-export where appropriate.
Step 5 — Create core lib files
In apps/web/src/lib/:
sql.ts— SQL Database client singleton with factory function: connection string auth for local SQL Server, managed identity (DefaultAzureCredential) for production. Export typed query helpers (query<T>,queryOne<T>,execute,transaction) for all 10 tables.auth.ts— stub with Easy Auth header parsing signature (implementation in app-02)validation/index.ts— stub for Zod middleware (implementation in app-02)
Step 6 — Create initial pages
apps/web/src/app/layout.tsx— root layout with Tailwind, font setup, metadataapps/web/src/app/page.tsx— landing page (hello world or login redirect stub)apps/web/src/app/api/health/route.ts— returns{ status: "ok", timestamp: ISO string }
Step 7 — Environment configuration
- Create
apps/web/.env.examplefromdocs/environment-config.md - Create
apps/web/.env.local(gitignored) with local SQL Server (Docker) defaults - Add
trustServerCertificate: truefor local dev
Step 8 — Seed script
Create scripts/seed-sql.ts:
- Creates all 10 tables with correct primary keys and indexes
- Inserts sample documents from
docs/data-model.mdexamples - Idempotent — safe to run multiple times
Step 9 — Validate
Run these commands and fix any errors:
npm install— all dependencies resolvenpm run build— TypeScript compiles, Next.js buildsnpm run type-check— zero type errorsnpm run lint— zero lint errors
Output Expectations
- Monorepo at project root with
turbo.json - Next.js 15 app in
apps/web/ - Shared types in
packages/shared/ - Health endpoint at
/api/health - Seed script at
scripts/seed-sql.ts .env.examplewith all required variables
Exit Criteria
npm run buildsucceeds with zero errorsnpm run type-checkpasses- Health route returns
{ status: "ok" }
Quality Assurance
- Turborepo pipelines configured (
build,lint,type-check,test) - All 10 table interfaces created in
packages/shared/types/ -
@hackops/sharedimportable fromapps/web - SQL Database client singleton with local/production factory
-
.env.examplematchesdocs/environment-config.md - shadcn/ui initialized with base components
- No hardcoded secrets in committed files