- Initialized the create react app and installed axios
- Created app in the spotify API and retrieved the client id and the Oauth token for accessing API and stored it in .env file
- Done connecting to the spotify API, and displayed a sample result!
- Create a page in react which contains images of the album, song title and song artist
- Created the layout in the App.jsx file
- Used the data from https://gist.githubusercontent.com/aryapradipta9/0b8d0a1a113e3594d34c68c72ec32daf/raw/cb5d20b494bd2cb259d31596b9e8eea02e0f6d1e/single-sample.js
Refactored the code into beautifully written React components!! 😊😊😊
- Updated the data from https://gist.githubusercontent.com/aryapradipta9/4085f18a47101f10f685a6140385b2bf/raw/e32426bc2d954274e984b03c601f14c08eb47a0b/all-sample.js (This contains array of tracks.)
- Looped over the list to create the cards list of the tracks! 🎵
- Added hyperlink on the artist text to go to Spotify playlists!
- Implemented a search bar
- Put client ID in .env
- Used the query in the input text to modify the endpoint in spotify API
- Looped through the json list in the results and put it in the props of SongItem
- Refactored all the code to functional components instead of class components
- Refactored the state to useState using React hooks
- Select button on item changes to deselect button when clicked
- Fixed previous bug on local database for selected albums
- Post request worked to the spotify REST API for creating new playlists!
Refactored the accessToken to storing in react redux using createSlice
- Added react router to project
- After login, the path will be to "/create-playlist"
path="/"
path="/create-playlist"
- Fix any impure functions / mutable codes
- Fix the eslint problems -> Declaring PropTypes, deleting unused components
- Used flexbox for the SongItem component
- Wrapped the data mapping with grid-container
- Refactored login button to using material - ui component
- Refactored the create playlist form to using material - ui component
- Refactored the search bar to using material - ui component
- Adding typescript to my app
- Refactor all the components to typescript
- Refactor homepage to typescript
Created test for song tracks component by using data from utils
import '@testing-library/jest-dom';
import React from 'react';
import { render,screen } from '@testing-library/react';
import SongItem from './components/SongItem/index';
import data from './utils/albumData'
for (let i = 0;i < data.length; i++){
it(`Item ${i}: ${data[i].album.name}`,()=>{
render(
<SongItem
status={false}
id={"1"}
imgUrl={data[i].album.images[0].url}
songTitle={data[i].album.name}
artist={data[i].artists[0].name}
/>
)
//selectButton
expect(screen.getByText("Select")).toBeInTheDocument();
//imgUrl
const albumImg = screen.getByRole('img');
expect(albumImg).toHaveAttribute('src',data[i].album.images[0].url);
//songTitle
expect(screen.getByText(data[i].album.name)).toBeInTheDocument();
//artist
expect(screen.getByText(data[i].artists[0].name));
});
}
Just deployed my app!🚀 Can access it through https://spotifynya-brian.vercel.app/