How allspaghettinocode/brokenaccesscontroldemo works
Project type & purpose (from README + tree)
This is a Next.js (TypeScript) web application that serves a website explaining/demonstrating the OWASP “Broken Access Control” vulnerability. The README indicates it’s deployed to Vercel (public URL). The file tree shows no dedicated backend service, no database, and no API routes folder—so the architecture is primarily a content/UI-focused web app.
Key signals:
• next.config.ts, next-env.d.ts, tsconfig.json → Next.js + TS
• src/app/* → Next.js App Router structure (layout/page)
• Dockerfile, Dockerfile.prod, docker-compose*.yml → containerized build/run options (dev/prod)
• No src/pages/api or src/app/api shown → likely no API layer (or it’s omitted)
Runtime / application layer
• src/app/layout.tsx → global shell (root layout)
• src/app/page.tsx → home page content and primary route (/)
• src/app/globals.css, postcss.config.mjs → styling pipeline (global CSS + PostCSS)
• src/components/Header.tsx → shared UI component(s)
• src/tools/Toolkit.ts → internal utility module (likely used by page/components)
Build & deployment layer
• package.json / package-lock.json → dependencies, scripts (build, dev, start)
• Dockerfile / Dockerfile.prod → container images (dev vs optimized prod)
• docker-compose.yml / docker-compose-prod.yml → local orchestration for running the app
• Vercel deployment (from README URL) → production hosting platform
Goal: Show who uses it and where it runs.
Include:
• User (Browser)
• BrokenAccessControlDemo Website (hosted on Vercel)
• Optional: Vercel Platform (build + CDN/edge distribution)
• User → Website: HTTPS requests
• Website → User: HTML/CSS/JS responses
Goal: Show deployable/runnable units.
Static assets/CDN edge (often handled by Vercel automatically)
Local Dev/Prod containerization as a separate deployment path:
• Developer machine → docker-compose.yml → Next.js container
• Production → Vercel build pipeline → Vercel runtime (Node/Edge)
• Browser ↔ Vercel Edge/CDN ↔ Next.js runtime (if SSR)
Goal: Show the major modules and how they compose pages.
• Root Layout (src/app/layout.tsx)
• Home Page Route (src/app/page.tsx)
• Header Component (src/components/Header.tsx)
• Toolkit Utility (src/tools/Toolkit.ts)
• Global Styles (src/app/globals.css) + PostCSS pipeline (postcss.config.mjs)
• layout.tsx → uses → Header.tsx (if imported there)
• page.tsx → uses → Header.tsx (if imported directly)
• page.tsx/Header.tsx → uses → Toolkit.ts (if applicable)
• layout.tsx → includes → globals.css
Important architectural patterns/design principles to highlight
• Next.js App Router: routing by filesystem (src/app/page.tsx, layout.tsx)
• Component-based UI composition: shared components in src/components
• Separation of concerns:
• UI components (src/components)
• Route-level composition (src/app)
• Utility/helpers (src/tools)
• Styling pipeline (global CSS + PostCSS)
• Multi-target deployment: can run via Docker locally and deploy to Vercel in production
Use consistent notation and explicit labels:
Labels
• Platform/runtime labels (e.g., “Vercel (Build + Edge/CDN + Runtime)”)