A modern, full-stack React application for managing your music collection with advanced features like search, filtering, pagination, and performance optimizations.
- CRUD Operations: Create, Read, Update, Delete songs
- Advanced Search: Search by title, artist, album, or year
- Smart Filtering: Filter by year range and sort by multiple criteria
- Pagination: Efficient handling of large song collections
- Responsive Design: Works perfectly on desktop, tablet, and mobile
- Code Splitting: Automatic bundle splitting for faster loading
- Lazy Loading: Pages load only when needed
- Virtual Scrolling: Smooth performance with thousands of songs
- React.memo: Optimized re-rendering
- Webpack Optimizations: Vendor and common chunk splitting
- Modern Design: Clean, intuitive interface with Emotion styling
- Loading States: Smooth loading spinners and transitions
- Error Handling: Graceful error states and user feedback
- Performance Monitor: Real-time performance metrics (dev mode)
- React 18 - Modern React with hooks and functional components
- Redux Toolkit - State management with simplified Redux
- Redux-Saga - Side effects and async operations
- React Router - Client-side routing and navigation
- Emotion - CSS-in-JS styling with theming
- Webpack 5 - Custom build configuration with optimizations
- Babel - Modern JavaScript compilation
- Jest - Unit and component testing
- React Testing Library - Component testing utilities
- ESLint - Code linting and formatting
- Node.js (v16 or higher)
- npm or yarn package manager
-
Clone the repository
git clone <repository-url> cd song-manager
-
Install dependencies
npm install
-
Start development server
npm start
-
Open your browser Navigate to
http://localhost:3000
| Script | Description |
|---|---|
npm start |
Start development server with hot reload |
npm run build |
Build production bundle with optimizations |
npm run build:analyze |
Build with bundle analysis |
npm test |
Run test suite |
npm run test:watch |
Run tests in watch mode |
song-manager/
βββ src/
β βββ components/ # Reusable UI components
β βββ pages/ # Page components
β βββ store/ # Redux store configuration
β βββ sagas/ # Redux-Saga side effects
β βββ styles/ # Global styles and theming
β βββ utils/ # Utility functions
β βββ App.js # Main app component with routing
β βββ index.js # Application entry point
βββ dist/ # Production build output
βββ webpack.config.cjs # Webpack configuration
βββ .babelrc # Babel configuration
βββ jest.config.cjs # Jest testing configuration
βββ package.json # Project dependencies and scripts
- useState: Local component state management
- useEffect: Side effects and lifecycle management
- useMemo: Performance optimization for expensive calculations
- useDispatch/useSelector: Redux integration
- createSlice: Simplified Redux boilerplate
- createAsyncThunk: Async action creators
- configureStore: Enhanced store configuration
- takeEvery: Handle async actions
- call: API calls and side effects
- put: Dispatch actions
- select: Access state
- React.memo: Prevent unnecessary re-renders
- Lazy Loading: Load components on demand
- Code Splitting: Split bundles for faster loading
- Virtual Scrolling: Render only visible items
- No Create React App: The project was set up from scratch without CRA, using a custom
webpack.config.cjs. - Custom Rules:
- JavaScript/JSX handled by Babel (
babel-loader). - Images and fonts handled by Webpackβs
asset/resourcetype.
- JavaScript/JSX handled by Babel (
- Environment Variables:
- Uses
dotenv-webpackto inject variables likeAPI_BASE_URLfrom.env.
- Uses
- Why Manual:
- Manual setup demonstrates understanding of build tools, allows for custom optimizations, and meets assignment requirements.
- Code Splitting:
- Uses
optimization.splitChunksfor vendor/common chunk splitting and lazy loading for React pages.
- Uses
Create a .env file in the root directory:
REACT_APP_API_URL=https://jsonplaceholder.typicode.com
NODE_ENV=developmentThe app uses MirageJS and static data to simulate a backend. The following endpoints are available in development:
GET /api/songsβ List all songsPOST /api/songsβ Add a new songPUT /api/songs/:idβ Update a songDELETE /api/songs/:idβ Delete a song
Note:
In production, you can point API_BASE_URL to a real backend or JSONPlaceholder.
Absolutely! Hereβs a more specific and transparent statement for the βWhich parts (if any) were generated with AIβ requirement, tailored to your project:
-
AI-Assisted Sections:
- Initial project folder structure and setup instructions
- Webpack and Babel configuration (e.g.,
webpack.config.cjs,.babelrc) - Redux Toolkit and Redux-Saga boilerplate (e.g.,
store.js,songsSlice.js,sagas/) - Some React component scaffolding (e.g.,
App.js, routing, and lazy loading setup) - Troubleshooting solutions for build, deployment, and routing issues
- Documentation templates and explanations in this README
-
Manual Work:
- All business logic, UI design, and feature implementation were written, reviewed, and tested by me.
- All code was understood and adapted to fit the project requirements.
-
Verification steps:
- Run the app locally and checked all features.
- Used Jest and React Testing Library for unit/component tests.
- Manually tested UI for CRUD, filtering, and performance features.
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage
npm test -- --coverage- Unit Tests: Redux slices and utility functions
- Component Tests: React components with React Testing Library
- Integration Tests: Component interactions
The production build includes:
- Main Bundle: ~10.2 KiB (app logic)
- Vendor Bundle: ~270 KiB (React, Redux, etc.)
- Common Bundle: ~2.7 KiB (shared code)
- Lazy Chunks: 1.9-7.8 KiB each (pages)
In development mode, a performance monitor shows:
- Render time
- Memory usage
- Bundle size estimates
npm run build- Netlify: Drag and drop the
distfolder - Vercel: Connect your GitHub repository
- GitHub Pages: Use the
gh-pagespackage - AWS S3: Upload the
distfolder to S3
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Happy coding! π΅β¨