How sliceofbytes/adrenaline works
Project type and purpose
• This is a full-stack JavaScript/TypeScript project built on Next.js and React. It delivers a rich web UI (the “Adrenaline” app) plus a companion browser extension for chatting with your codebase via static analysis, vector search, and AI.
File structure
• Top-level directories:
• pages/ → Next.js pages (routes, _app, _document, app entry points)
• components/ → Reusable UI components (buttons, progress bars, code snippets, etc.)
• containers/ → Smart components or feature pages (ChatBot, CodeExplorer, RepositoryInput, etc.)
• extension/ → Browser extension’s React UI, styles, and helper libraries
• library/ → Shared utility code (data.js, mixpanel analytics, utilities.js)
• styles/ → Global and component-specific CSS, custom fonts
• Patterns:
• Container-Component pattern for view logic separation
• Shared “library” for cross-cutting concerns (analytics, utilities)
• Next.js conventions for pages and static assets
README
• Confirms: “talk to your codebase” powered by static analysis, vector search, AI
• Publicly hosted web app plus open-source UI for extension
Main components and depth-5 breakdown
Depth-1 (root tier):
– Users
– Browser (hosts Web App & Extension)
Depth-2 (platform tier):
– Next.js Web Application
– Browser Extension
Depth-3 (subsystem tier):
Next.js Web App:
• pages/ (routing layer)
• containers/ (feature logic)
• components/ (stateless UI)
• library/ (shared utilities & analytics)
• styles/ & public/ (static assets)
Browser Extension:
• extension/ (UI & logic)
Depth-4 (module tier):
Next.js Web App > pages/: _app.js, app.js, extension routes, index.js
Next.js Web App > containers/: ChatBot.js, CodeExplorer.js, etc.
Next.js Web App > components/: AddCodeButton.js, GeneratedCode.tsx, Spinner.js, etc.
Browser Extension > extension/: Extension.js, Chatbot.js, MessageInput.js, styles/, lib/
Depth-5 (leaf tier):
– extension/lib: dtos.js, mixpanel.js, utilities.js
– library/: data.js, mixpanel.js, utilities.js
– pages/extension/[owner]/[name]/index.js
– styles/fonts and other per-component CSS files
Relationships & interactions
• User → Browser UI (Web App or Extension)
• Web App & Extension ↔ Shared library for Mixpanel analytics & utilities
• Web App & Extension → External services:
• GitHub/GitLab OAuth & repository APIs
• Static analysis & vector search back-end (AI service)
• Payment gateway for subscription management
• Data flows:
• User actions (queries, code selection) → containers → API calls → AI/analysis service → vector DB → results → containers → components → user
Architectural patterns/design principles
• Separation of concerns: containers (logic) vs. components (presentation)
• Shared library for cross-cutting concerns
• Next.js for server-side rendering & routing
• Modular CSS scoped per component
• Extension sandbox isolated from main app
Detail without overthinking
• Every directory up to five levels deep
• How each layer depends on the one below
• Be explicit about external integrations and data flows