How antiwork/shortest works
Main components
• Frontend (Web Dashboard)
• Next.js App (app/ and components/)
• UI Components & Layouts
• Backend/API (Server-side)
• Next.js API Routes (app/api/*)
– generate-tests
– GitHub webhook
– Stripe checkout & webhook
– test/assert-bearer
• Shared server logic (lib/*)
– Database (lib/db via Drizzle ORM + migrations)
– Payments (lib/payments/stripe)
– GitHub integrations (lib/github, lib/github-stars)
– Utilities (lib/utils-server)
• Database
• Postgres (managed via Vercel Postgres)
• Drizzle ORM migrations + seed
• Authentication
• Clerk (GitHub-only login, 2FA)
• Third-Party Services
• Anthropic Claude AI API
• Stripe (Payments & Webhooks)
• Mailosaur (Email testing)
• GitHub OAuth & Webhooks
• CLI Package (“@antiwork/shortest” in packages/shortest)
• CLI entrypoint & command definitions (src/cli)
• Core layers (src/core):
– Framework detector
– App analyzer (Next.js AST + file tree)
– Builder & Compiler (bundling test code)
– Test planner & generator (system prompts → code)
– Runner (spawns Playwright, orchestrates test execution)
• AI layer (src/ai): Provider adapters + prompts + tools
• Browser integration (Playwright)
• Cache, logging, utils
• Developer Machine
• Local code editor & terminal
• “shortest init” → config + .env
• “pnpm shortest” → runs CLI tests
Relationships and data flows
• User → Browser → Next.js Frontend
• Frontend ↔ Clerk (Auth)
• Frontend/API → Database (Drizzle → Postgres)
• API webhook endpoints → Third-party services (Stripe, GitHub)
• Developer → CLI (shortest) →
• AI Provider (Anthropic)
• CLI Core → Playwright → Local browser → Next.js app (UI & API) → DB & externals
• Lifecycle hooks/callbacks in tests → direct DB queries via lib/db
Architectural patterns & design principles
• Monorepo with pnpm workspaces (next.config.ts, pnpm-workspace.yaml)
• Next.js 14 using Server Actions & Server Components
• Layered architecture in CLI: CLI → Core → AI → Browser → Runner
• API routes as micro-endpoints for distinct concerns
• Shared code (lib/) to avoid duplication between web and tests