Architecture Overview
The Argument Analysis Tool uses a modern component architecture built on top of shadcn/ui, which provides beautifully designed, accessible components built with Radix UI primitives and styled with Tailwind CSS.Technology Stack
shadcn/ui
Customizable component library with copy-paste components
Radix UI
Unstyled, accessible UI primitives
Tailwind CSS
Utility-first CSS framework with custom theme
Lucide Icons
Beautiful open-source icon library
shadcn/ui Configuration
The project is configured with shadcn/ui using the following setup fromcomponents.json:
components.json
Key Configuration Details
Enables React Server Components support for Next.js 13+
Base color scheme for the component theme
Uses CSS variables for theming, enabling dynamic theme switching
Icon library used throughout the application (Lucide React)
Component Structure
Components are organized into three main directories:/src/components/ui/
Base UI components from shadcn/ui. These are the building blocks:
- Form Controls:
button.tsx,input.tsx,textarea.tsx,checkbox.tsx,select.tsx - Layout:
card.tsx,separator.tsx,scroll-area.tsx,tabs.tsx - Overlays:
dialog.tsx,sheet.tsx,popover.tsx,tooltip.tsx - Feedback:
toast.tsx,alert.tsx,skeleton.tsx - Data Display:
table.tsx,badge.tsx,avatar.tsx
/src/components/common/
Shared application components:
Header.tsx- Application header with navigationLoadingSpinner.tsx- Loading indicatorThemeProvider.tsx- Dark/light theme contextThemeToggle.tsx- Theme switcher componentCursorGlow.tsx- Cursor glow effect
/src/components/analysis/
Argument analysis visualization components:
AnalysisAndSocialLayout.tsx- Main layout with analysis and social viewsAnalysisView.tsx- Analysis visualization containerAnalysisToolbar.tsx- Toolbar for switching views and exporting- Visualization modes:
BalancedView.tsx,TreeView.tsx,PillarView.tsx,CircularView.tsx,FlowchartView.tsx - Supporting components:
ArgumentCard.tsx,DetailPanel.tsx,ExportModal.tsx SocialView.tsx- Social media pulse displayTweetCard.tsx- Individual tweet display
/src/components/home/
Home page specific components:
InputForm.tsx- Main input form for topics, URLs, and documents
Tailwind Configuration
The project uses a custom Tailwind configuration with extended theme settings:tailwind.config.ts
Custom Theme Tokens
- Typography
- Colors
- Animations
Font Families
font-body: Space Grotesk - Used for body textfont-headline: Bai Jamjuree - Used for headings
Utility Functions
Thecn() utility function merges Tailwind classes intelligently:
src/lib/utils.ts
Usage Example
- Conditional class application
- Class merging without duplicates
- Component className prop overrides
Design System
The component library follows a neobrutalism design aesthetic:Visual Characteristics
- Bold borders: 2-4px solid borders on all major components
- Box shadows: Hard drop shadows (e.g.,
shadow-[8px_8px_0px_hsl(var(--border))]) - No gradients: Flat, solid colors throughout
- High contrast: Strong color differentiation
- Sharp corners: Minimal border radius (
rounded-sm)
Example: Button Component
src/components/ui/button.tsx
- Bold font weight
- 2px borders
- Hard box shadows that expand on hover
- Active state with
translate-y-pxfor press effect
Adding New Components
To add a new shadcn/ui component:- Download the component to
src/components/ui/ - Install any required dependencies
- Update
components.jsonif needed
Best Practices
Always use the cn() utility
Always use the cn() utility
Merge class names properly to avoid conflicts:
Leverage CSS variables for theming
Leverage CSS variables for theming
Use semantic color tokens instead of hard-coded colors:
Compose with Radix primitives
Compose with Radix primitives
When building custom components, use Radix UI primitives for accessibility:
Follow the design system
Follow the design system
Maintain visual consistency:
- Use
border-2orborder-4for borders - Use hard box shadows:
shadow-[Xpx_Xpx_0px_color] - Prefer
rounded-smover larger border radius - Use
font-headlinefor headings,font-bodyfor text
Next Steps
UI Components
Explore the key custom components
Architecture Overview
Learn about system architecture