2.8 KiB
2.8 KiB
System Patterns
Architecture Overview
Frontend Architecture
-
React Component Structure
- Layout components for consistent structure
- Shared components for reusability
- Page-specific components for unique features
- Context providers for state management
-
Routing System
- React Router v7 for navigation
- Client-side routing
- Protected routes where necessary
-
State Management
- React Context for global state
- Local state for component-specific data
- Notification context for toast messages
Backend Architecture
-
API Structure
- Express.js server
- RESTful endpoints
- Rate-limited routes
- Email service integration
-
Caching Layer
- Redis-backed caching
- Session management
- Rate limiting implementation
Key Technical Decisions
Development Environment
-
Build System
- Vite for fast development
- Hot Module Replacement
- TypeScript compilation
- Concurrent frontend/backend development
-
Docker Configuration
- Multi-container setup
- Development and production configurations
- Volume mounting for persistent data
- Bridge network setup
Production Setup
-
Deployment Strategy
- Multi-stage Docker builds
- Nginx for static file serving
- Node.js API server
- Automatic container restart
-
Performance Optimizations
- Tree shaking
- Code splitting
- Redis caching
- Static file optimization
Security Patterns
-
API Security
- Rate limiting
- CORS configuration
- Environment variable protection
- Secure email handling
-
Data Protection
- Form validation
- Input sanitization
- Redis session management
- Secure credential storage
Directory Structure
src/
├── api/ # Backend API routes
├── components/ # UI components
│ ├── Layout/ # Layout structure
│ └── shared/ # Reusable components
├── context/ # React Context
├── lib/ # Utility functions
├── pages/ # Route pages
└── assets/ # Static assets
public/
├── images/ # Image assets
├── subtitles/ # WebVTT files
├── transcriptions/# Text files
└── videos/ # Video content
Implementation Patterns
Component Patterns
- Functional components with hooks
- TypeScript interfaces for props
- Separation of concerns
- Reusable styling with Tailwind
Animation Patterns
- Framer Motion for complex animations
- CSS transitions for simple effects
- Intersection Observer for scroll animations
- Performance-optimized animations
Accessibility Patterns
- ARIA labels
- Semantic HTML
- Keyboard navigation
- Screen reader support
- Color contrast compliance
Testing Strategy
- Component testing
- API endpoint testing
- Integration testing
- Accessibility testing