A modern React application built with TypeScript, Redux Toolkit, and SCSS. This project demonstrates best practices in component architecture, state management, and styling.
- Modern React: Built with React 18, TypeScript, and functional components
- State Management: Redux Toolkit for centralized state management
- Styling: SCSS with BEM methodology and CSS Modules
- Performance: React.memo for component optimization
- Error Handling: Error boundaries and loading states
- Responsive Design: Mobile-first approach with custom breakpoints
src/
βββ app/ # Redux store configuration
βββ components/ # Page-specific components
β βββ header/
β βββ categories/
β βββ collection/
β βββ about/
β βββ follow/
βββ features/ # Redux slices
β βββ typographySlice.ts
β βββ mediaSlice.ts
βββ shared/ # Shared utilities and components
β βββ components/ # Reusable components
β βββ contexts/ # React contexts
β βββ styles/ # Global styles and variables
βββ types/ # TypeScript type declarations
βββ assets/ # Static assets
- React 18 with TypeScript
- Redux Toolkit for state management
- SCSS with CSS Modules
- Vite for build tooling
- ESLint for code quality
The project follows BEM (Block Element Modifier) methodology:
.header { // Block
&__content { } // Element
&__title { } // Element
&__button { // Element
&--active { } // Modifier
}
}- Variables:
src/shared/styles/variables.scss - Mixins:
src/shared/styles/mixins.scss - Main styles:
src/shared/styles/main.scss
{
typography: {
data: TypographyData,
loading: boolean,
error: string | null
},
media: {
data: MediaData,
loading: boolean,
error: string | null
}
}fetchTypography(): Loads text content from JSONfetchMedia(): Loads image paths from JSON
- Node.js 16+
- npm or yarn
npm installnpm run devnpm run build- Strict type checking enabled
- Proper type definitions for all components
- Interface definitions for props and state
- React.memo for component memoization
- Proper dependency arrays in useEffect
- Optimized re-renders with useSelector
- Error boundaries for component error catching
- Loading states for async operations
- Graceful fallbacks for missing data
-
Component Architecture
- Single responsibility principle
- Proper separation of concerns
- Reusable component design
-
State Management
- Centralized Redux store
- Async thunks for API calls
- Proper loading and error states
-
Styling
- BEM methodology
- CSS Modules for scoping
- Responsive design with mixins
-
Performance
- Component memoization
- Optimized imports with index files
- Efficient re-renders
-
Developer Experience
- TypeScript for type safety
- ESLint for code quality
- Clean project structure
- App Initialization: Redux store is configured
- Data Fetching: Typography and media data loaded via thunks
- Component Rendering: Components consume data from Redux store
- User Interactions: Click events trigger context updates
- Error Handling: Error boundaries catch and display errors
The application uses custom breakpoints:
on1290: Max-width 1290pxon759: Max-width 759px
- Create component folder in
src/components/ - Add TypeScript interface for props
- Implement BEM styling
- Export from
src/components/index.ts
- Update JSON files in
public/ - Add types to Redux slices
- Update component selectors
- Follow the established code structure
- Use TypeScript for all new code
- Implement BEM methodology for styling
- Add proper error handling
- Include loading states for async operations
This project is for educational purposes.