Overview
CryptoDash follows a modular React architecture with clear separation of concerns. The project uses Vite as the build tool and follows modern React patterns with hooks and context.Root Directory Structure
Source Directory (src/)
The source directory is organized into feature-based modules:
API Layer
The API layer is organized by feature domain:API Client Setup
The base axios client is configured insrc/api/axios.js:
src/api/axios.js
Components Organization
Components are grouped by feature and complexity:- Common
- Dashboard
- Layout
- Feature Components
Reusable components used across the application:
CountUpValue.jsx- Animated number counterErrorBoundary.jsx- Error boundary wrapperSkeletonLoader.jsx- Loading placeholdersToastContainer.jsx- Toast notification display
Pages
Page components represent full routes:Routing Architecture
The application uses React Router v7 with a nested layout structure:src/router/AppRouter.jsx
Utilities
Utility modules provide helper functions:dashboardCharts.js- SVG path generation for chartsdashboardFormatters.js- Number and currency formattingcsvExport.js- CSV export functionality
Constants
navigation.js- Navigation menu configuration
Internationalization
translations.js- Translation strings for English and Spanish
Entry Points
Key Dependencies
Frompackage.json:
Best Practices
Component Placement
Component Placement
- Place reusable components in
components/common/ - Place feature-specific components in their respective feature folders
- Keep page components simple and focused on layout
API Organization
API Organization
- Group API functions by feature domain
- Use the shared axios client from
api/axios.js - Implement caching at the API layer when appropriate
File Naming
File Naming
- Use PascalCase for component files:
ComponentName.jsx - Use camelCase for utility files:
utilityName.js - Use kebab-case for CSS files:
style-name.css
Next Steps
State Management
Learn about Context API and custom hooks
API Integration
Understand the CoinGecko API integration
Theming
Explore the dark/light theme system
