Architecture Report55/100

01_demo_lovable

Failures

5

Passed

3

Unknown

0

When

Mar 29, 02:19 PM

🏗️ Architecture3/8

5 issues found

55/100AI Chaos Index — Moderate

Structural problems present. Medium regression risk. Learn how scoring works →

Breakdown

RC01Architecture Drift
35 pts
RC02Dependency Corruption
0 pts
RC03Structural Entropy
10 pts
RC04Test Infrastructure
0 pts
RC05Deployment Safety
10 pts

Failed Checks (5)

ARCH-01criticalreview

Business logic (DB calls, API calls, state mutations) in page files or components creates the 'god component' pattern — everything is coupled, nothing is testable, and AI tools amplify the chaos on every prompt.

Fix prompt
Issue: Supabase/DB calls found in pages/components (9 files)
Affected files: src/pages/AdminDashboard.tsx, src/pages/AdminUsers.tsx, src/pages/Billing.tsx, src/pages/Dashboard.tsx, src/pages/InvoiceCreate.tsx

Move all Supabase/database calls out of page files and components into a domains/ directory. Create domain-specific modules: domains/billing/actions.ts, domains/auth/queries.ts, etc. Pages should only import and call domain functions — never make DB calls directly. Example: instead of supabase.from('invoices').select() in a page, create domains/billing/queries.ts with export async function getInvoices() { ... } and import it.
ARCH-02criticalautofix

Without a domains/ directory, business logic has nowhere structured to go. AI tools dump everything into pages, components, or lib — creating a monolith.

Fix prompt
Issue: 103 source files but no domains/ directory
Affected files: Create domains/<domain>/<slice>/ for business logic

Create a domains/ directory at the root of your src/ folder. Inside, create subdirectories for each business domain: domains/auth/, domains/billing/, domains/admin/. Each domain should contain its own actions, queries, types, and UI components. This is the first structural boundary — without it, business logic has nowhere organized to go. Start by: mkdir -p src/domains/auth src/domains/billing src/domains/admin.
ARCH-04highreview

Fat page files (>80 LOC) mix routing, layout, state, and business logic in one place. AI tools generate entire features in a single page.tsx — the 'god page' anti-pattern.

Fix prompt
Issue: 10 pages over 80 lines — extract logic to domains/
Affected files: src/pages/AdminUsers.tsx (144 lines), src/pages/Billing.tsx (211 lines), src/pages/Dashboard.tsx (224 lines), src/pages/Index.tsx (86 lines), src/pages/InvoiceCreate.tsx (316 lines)

Refactor fat page files to be thin wrappers under 80 lines. Pages should only handle: layout, data fetching (calling domain functions), and rendering domain components. Extract all business logic, form handling, and state management into domain modules. Example: a 200-line Billing page becomes: import { BillingDashboard } from '@/domains/billing/ui/BillingDashboard'; export default function BillingPage() { return <BillingDashboard />; }.
ARCH-06highreview

AI tools add code to whichever file already contains related logic. After 50-100 prompts, files grow to 500-1000+ lines. At that point the AI itself loses context — it contradicts previous logic, introduces regressions, and can no longer reason about the file.

Fix prompt
Issue: 1 file over 500 lines — split into smaller modules
Affected files: src/components/ui/sidebar.tsx (638 lines)

Split any source file over 500 lines into smaller, focused modules. Large files indicate mixed responsibilities. For a 600-line component: extract sub-components, move utility functions to separate files, split form logic from display logic. For a large API route: extract handler functions, validation, and business logic into separate files. Target: no file over 300 lines, ideally under 200.
STR-01highautofix

Without a CI/CD pipeline, code goes from developer (or AI tool) to production unchecked. Guard can't run, safety scans happen only when someone remembers.

Fix prompt
Issue: No CI/CD pipeline found — code goes from developer to production unchecked

Add a CI/CD pipeline to your project. Create .github/workflows/ci.yml with at minimum: checkout, install dependencies, lint, and build steps. For safety enforcement, add: npx @vibecodiq/cli guard check. Example workflow: on: [push, pull_request] → jobs: ci: runs-on: ubuntu-latest → steps: checkout, setup-node, npm ci, npm run build, npx @vibecodiq/cli guard check.
Passed Checks (3)
CLI v0.6.0Mode: architectureSource: cli8 total checks

This is a static source-code analysis report. It is not a complete security audit. Results may contain false positives or miss certain issues. Always verify findings manually.