-
Technologies Used:
- Next.js 12
- Tailwind CSS
- Spotify API
- NextAuth
- Recoil
-
Project Overview:
-
It is a fully functional and responsive clone of Spotify with features like search, play, pause, and change songs.
-
It has a complete search functinality with data being fetched from Spotify API.
-
Added User authentication using NextAuth.js, which provides complete authentication for next.js
-
Implemented many concepts of react components, hooks, lifecycle methods, props, and added global state management using recoil.
-
Added a custom player with controls like play, pause, and adjust the volume of songs.
-
One Limitation of spotify API is that it only works for spotify users having premium memberships.
-
-
Project Screenshots:
-
Imp Links:
-
Read about dynamic "built-in" routing in next.js
-
In next.js, any file inside the pages folder is a website page.
-
In next.js any file inside the api folder is all the back-end code.
-
Read about "built-in" server in next.js
-
Image component in next.js
-
postion: fixed; in css
-
z-index in css
-
add icons using heroicons:
-
add icons using React Icons
-
Creating your own utility custom class in TailwindCSS
-
create a folder named "styles" and add a file called "globals.css" to it
-
import this globals.css file into the _app.js file
-
create your utility classes in globals.css
-
-
Breakpoints in tailwindcss for adding responsiveness:
-
Always remember, default styling in tailwindcss is always mobile responsive first, and then breakpoints are added to make it responsive for bigger screens. 💥💥💥💥💥
-
@tailwindcss/forms:
-
tailwind-scrollbar:
-
tailwind-scrollbar-hide:
-
useState() hook in react:
-
custom google fonts:
-
Making a grid using tailwindcss
-
NextAuth authentication:
-
Getting Started:
-
NextAuth authentication for spotify api:
-
We need authentication because we need an access token and also check if the access token has expired
-
If the access token has expired, then we need to refresh the expired access token with a valid refresh token.
-
Having a valid access token, authenticates the use login, without a valid access token the user cannot access the website and it will always redirect that un-authenticated user to the login/signin page.
-
Once the user login/signup using their spotify account, the user is authenitcated and gets a valid access token.
-
What is .env.local file in react/next.js projects?
-
useSession() hook in NextAuth:
-
creating custom login/signin page in NextAuth:
-
What are callbacks in NextAuth:
-
JWT Callback:
-
Session Callback:
-
Refresh Access Token NextAuth: (💥💥💥💥💥)
-
useRouter() hook in next.js:
-
useEffect() hook in react:
-
react-loader-spinner:
-
Group-hover in tailwind css
-
https://tailwindcss.com/docs/hover-focus-and-other-states#group-hover
-
If you need to style a child element when hovering over a specific parent element, add the group class to the parent element and add the group-hover: prefix to the utility on the child element.
-
-
Recoil --> Global State Management
- https://recoiljs.org/ - Global state management using recoil.js - npm install recoil - https://recoiljs.org/docs/introduction/getting-started/
-
Recoil Atoms
- https://recoiljs.org/docs/introduction/getting-started#atom - https://recoiljs.org/docs/basic-tutorial/atoms
-
Headless UI:
-
SignOut functionality in NextAuth:
-
react-spotify-web-playback:
-
adding custom player to the spotify clone
-