Component Architecture
EpiNeko uses client-side React components with TypeScript for type safety. All components are organized by feature area and follow consistent patterns.Anime Components
AnimeCard
Display component for anime thumbnails in lists and grids.Props Interface
Props Interface
- Hover animations with scale and shadow effects
- Rating badge overlay on hover
- Fallback image for loading errors
- Responsive sizing (w-44 on mobile, w-56 on desktop)
- 2:3 aspect ratio for consistent layout
AnimeDetailsModal
Full-screen modal for displaying detailed anime information.Props Interface
Props Interface
- Backdrop blur with fade-in animation
- Responsive two-column layout (poster + details)
- Genre tags display
- Library integration (add/remove functionality)
- Auto-dismiss on backdrop click
- Loading states during library operations
- Left Side: Anime poster with gradient overlay
- Right Side: Title, metadata, genres, synopsis, and action buttons
- Close Button: Positioned top-right with circular styling
The modal requires user authentication for library operations. Unauthenticated users see an alert when attempting to add anime.
EpisodeList
Interactive episode list with watch progress tracking.Props Interface
Props Interface
- Fetches episode data from Jikan API
- Tracks watched episodes count
- Checkmark toggle for episode completion
- Visual distinction for watched episodes (emerald theme)
- Automatic library creation on first interaction
- Progress counter display
- Handles missing episode data gracefully
LibraryButton
Comprehensive library management button with status dropdown.Props Interface
Props Interface
- Add/remove from library
- Status dropdown (watching, completed, plan_to_watch, dropped)
- Visual feedback for library state
- Loading states during operations
- Automatic page refresh after updates
- Not in Library: Shows ”➕ AÑADIR A MI LISTA” (primary button)
- In Library: Shows ”✓ EN MI LISTA” (success outline) + status dropdown
SearchBar
Autocomplete search with live results from Jikan API. Features:- Debounced search (500ms delay)
- Live suggestions with anime posters
- Click-outside to close
- Loading indicator
- Links to anime detail pages
- “View all results” footer link
- Anime poster thumbnail (10x14 pixels)
- Title in bold
- Type and score metadata
- Hover states for better UX
Layout Components
Navbar
Responsive navigation bar with authentication state.Props Interface
Props Interface
- Fixed positioning with scroll-based styling
- Background blur on scroll
- Logo with hover animations
- Desktop navigation links (Inicio, Tendencias, Mi Lista)
- Integrated SearchBar
- User dropdown menu or Login button
- Profile avatar with initial letter
- Profile (with icon)
- Settings (with icon)
- Sign Out (red theme)
Footer
Site footer with navigation and branding. Sections:- Logo & Description: Brand identity and tagline
- Quick Links: Navigation to main pages
- Legal: Terms and Privacy links
- Bottom Bar: Copyright and attribution
- Single column on mobile
- 4-column grid on desktop
- 2 columns for logo section
MainLayout
Root layout wrapper component. Responsibilities:- Renders Navbar with current user
- Wraps children with main content area
- Renders Footer
- Fetches user authentication state from Supabase
Component Patterns
Client Components
All interactive components use
"use client" directiveTypeScript Props
Every component has a typed props interface
Error Handling
Graceful fallbacks for API failures and missing data
Loading States
Visual feedback during async operations
Styling Conventions
Best Practices
Component Organization
Component Organization
- Keep components focused on a single responsibility
- Extract reusable logic into custom hooks
- Use TypeScript interfaces for all props
- Document complex prop structures
State Management
State Management
- Use
useStatefor component-local state - Fetch data in
useEffecthooks - Implement optimistic UI updates for better UX
- Handle loading and error states explicitly
Performance
Performance
- Debounce expensive operations (search, API calls)
- Use
useCallbackfor event handlers passed to children - Implement click-outside detection with refs
- Clean up event listeners in useEffect returns
Related Documentation
Services
Learn about API integration layers
Project Structure
Understand the codebase organization