This document outlines the organization of the codebase.
src/
├── pages/ # Page components and their related features
│ ├── Landing/ # Landing page and related components
│ │ ├── Landing.tsx
│ │ └── components/
│ ├── Library/ # Library page and related components
│ │ ├── Library.tsx
│ │ └── components/
│ ├── Stats/ # Stats page and related components
│ │ ├── LastFmDashboard.tsx
│ │ └── components/
│ └── Settings/ # Settings page and related components
│ ├── Settings.tsx
│ └── components/
├── shared/ # Shared components and utilities
│ ├── ui/ # Reusable UI components
│ └── layouts/ # Shared layout components
├── contexts/ # React contexts for state management
├── hooks/ # Custom React hooks
├── lib/ # Utility functions and services
└── types/ # TypeScript type definitions
-
Page-Centric Organization: Each major feature/page has its own directory under
pages/
containing:- Main page component (e.g.,
Landing.tsx
) components/
directory for components specific to that page- Other related files (styles, utils, types)
- Main page component (e.g.,
-
Shared Resources: Common components and utilities that are used across multiple pages are placed in the
shared/
directory -
Clear Boundaries: Each page directory is self-contained with its own components, making it easy to:
- Understand feature scope
- Modify features independently
- Find related code quickly
- Keep page-specific components within their respective page directories
- Use shared components for truly reusable functionality
- Keep pages focused on their core functionality
- Maintain consistent naming conventions within each directory