Architecture
BodyWorks uses a layered component architecture that combines Shadcn UI components with custom fitness-specific components and Aceternity UI for advanced animations.Component Layers
The component system is organized into three distinct layers:- Base UI Layer - Shadcn UI components (New York style)
- Custom Component Layer - Fitness-specific components
- Animation Layer - Aceternity UI components
Shadcn UI Integration
BodyWorks uses Shadcn UI as the foundation for its component library, configured with the New York style variant.Configuration
Base Configuration
Base Configuration
- Style: New York variant
- RSC: React Server Components enabled
- TypeScript: Full TypeScript support
- Base Color: Neutral palette
- CSS Variables: Enabled for theming
Path Aliases
Path Aliases
Custom Component Structure
Custom components are built on top of base UI components and follow a consistent pattern:Component Patterns
Card Components
- exercise-card.tsx
- routine-card.tsx
- descripted-card.tsx
- testimonial-card.tsx
Interactive Components
- search-bar.tsx
- navbar.tsx
- footer-navbar.tsx
- mode-toggle.tsx
Data Display
- workout-summary-table.tsx
- pagination-providor.tsx
- data-loading-skeleton.tsx
Utility Components
- theme-provider.tsx
- hint.tsx
- custom-spinner.tsx
Naming Conventions
Components follow these naming patterns:- UI Components: kebab-case (e.g.,
button.tsx,3d-card.tsx) - Custom Components: kebab-case with descriptive names (e.g.,
exercise-card.tsx) - React Components: PascalCase exports (e.g.,
ExerciseCard,SearchBar)
Styling Approach
BodyWorks uses Tailwind CSS with a custom configuration and CSS variable-based theming.Tailwind Configuration
Utility Function
Thecn() utility merges Tailwind classes with proper precedence:
Theme System
- Light Mode
- Dark Mode
- Custom Colors
Component Composition
BodyWorks components are highly composable, allowing for flexible layouts:Accessibility
All components follow accessibility best practices:- Semantic HTML elements
- ARIA attributes where needed
- Keyboard navigation support
- Focus management
- Screen reader compatibility
Next Steps
UI Library
Explore available UI components and their usage
React Hooks
Learn about custom hooks for data fetching and utilities